Changeset 5879


Ignore:
Timestamp:
Feb 10, 2007, 9:26:15 PM (18 years ago)
Author:
Gary Byers
Message:

Preserve %rax when doing ff-call; use %rdx and %r11 to hold target address.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/lisp-kernel/x86-spentry64.s

    r5821 r5879  
    39813981        /* Unbox %arg_z.  It's either a fixnum or macptr (or bignum) ;
    39823982          if not a fixnum, get the first word */
    3983         __(unbox_fixnum(%arg_z,%imm0))
     3983        __(unbox_fixnum(%arg_z,%imm1))
    39843984        __(testb $fixnummask,%arg_z_b)
    39853985        __(je 0f)
    3986         __(movq macptr.address(%arg_z),%imm0)
     3986        __(movq macptr.address(%arg_z),%imm1)
    398739870:             
    39883988        /* Save lisp registers   */
     
    40104010        __(movq (%rsp),%rbp)
    40114011        __ifdef([DARWIN_GS_HACK])
    4012          /* At this point, %imm0=%rax is live (contains
    4013             the entrypoint); the lisp registers are
     4012         /* At this point, %imm1=%rdx is live (contains
     4013            the entrypoint) and %imm0.b=%al contains
     4014            info about xmm register arguments; the lisp registers are
    40144015            all saved, and the foreign arguments are
    40154016            on the foreign stack (about to be popped
     
    40214022            a fixnum */
    40224023         __(save_tcr_linear(%save0))
    4023          __(movq %imm0,%save1)
     4024         __(movq %imm1,%save1)
     4025         __(movq %imm0,%save2)
    40244026         __(set_foreign_gs_base())
    4025          __(movq %save1,%imm0)
     4027         __(movq %save1,%imm1)
     4028         __(movq %save2,%imm0)
    40264029        __endif
    40274030        __(addq $2*node_size,%rsp)
     4031        __(movq %imm1,%r11)
    40284032        __(pop %rdi)
    40294033        __(pop %rsi)
     
    40324036        __(pop %r8)
    40334037        __(pop %r9)
    4034         __(call *%rax)
     4038        __(call *%r11)
    40354039        __(movq %rbp,%rsp)
    40364040        __ifdef([DARWIN_GS_HACK])
     
    40874091        /* Unbox %arg_z.  It's either a fixnum or macptr (or bignum) ;
    40884092          if not a fixnum, get the first word */
    4089         __(unbox_fixnum(%arg_z,%imm0))
     4093        __(unbox_fixnum(%arg_z,%imm1))
    40904094        __(testb $fixnummask,%arg_z_b)
    40914095        __(je 0f)
    4092         __(movq macptr.address(%arg_z),%imm0)
     4096        __(movq macptr.address(%arg_z),%imm1)
    409340970:             
    40944098        /* Save lisp registers   */
     
    41034107        __(push %save2)
    41044108        __(push %save3)
    4105         __(movq macptr.address(%arg_y),%save2)  /* save2 = %r13, non-volatile */
     4109        __(movq macptr.address(%arg_y),%rbx)  /* %rbx non-volatile */
    41064110        __(push %fn)
    41074111        __(push %ra0)
     
    41174121        __(movq (%rsp),%rbp)
    41184122        __ifdef([DARWIN_GS_HACK])
    4119          /* At this point, %imm0=%rax is live (contains
    4120             the entrypoint); the lisp registers are
     4123         /* At this point, %imm1=%rdx is live (contains
     4124            the entrypoint) and %imm0.b=%al contains
     4125            xmm argument info; the lisp registers are
    41214126            all saved, and the foreign arguments are
    41224127            on the foreign stack (about to be popped
     
    41294134         __(save_tcr_linear(%save0))
    41304135         __(movq %imm0,%save1)
     4136         __(movq %imm1,%save2)
    41314137         __(set_foreign_gs_base())
    41324138         __(movq %save1,%imm0)
     4139         __(movq %save2,%imm1)
    41334140        __endif
     4141        __(movq %imm1,%r11)
    41344142        __(addq $2*node_size,%rsp)
    41354143        __(pop %rdi)
     
    41394147        __(pop %r8)
    41404148        __(pop %r9)
    4141         __(call *%rax)
    4142         __(movq %rax,(%save2))
    4143         __(movq %rdx,8(%save2))
    4144         __(movsd %xmm0,16(%save2))
    4145         __(movsd %xmm1,24(%save2))
     4149        __(call *%r11)
     4150        __(movq %rax,(%rbx))
     4151        __(movq %rdx,8(%rbx))
     4152        __(movsd %xmm0,16(%rbx))
     4153        __(movsd %xmm1,24(%rbx))
    41464154        __(movq %rbp,%rsp)
    41474155        __ifdef([DARWIN_GS_HACK])
Note: See TracChangeset for help on using the changeset viewer.