Index: /trunk/ccl/lisp-kernel/x86-spentry64.s
===================================================================
--- /trunk/ccl/lisp-kernel/x86-spentry64.s	(revision 5878)
+++ /trunk/ccl/lisp-kernel/x86-spentry64.s	(revision 5879)
@@ -3981,8 +3981,8 @@
         /* Unbox %arg_z.  It's either a fixnum or macptr (or bignum) ;
           if not a fixnum, get the first word */
-        __(unbox_fixnum(%arg_z,%imm0))
+        __(unbox_fixnum(%arg_z,%imm1))
 	__(testb $fixnummask,%arg_z_b)
         __(je 0f)
-        __(movq macptr.address(%arg_z),%imm0)
+        __(movq macptr.address(%arg_z),%imm1)
 0:              
 	/* Save lisp registers   */
@@ -4010,6 +4010,7 @@
 	__(movq (%rsp),%rbp)
         __ifdef([DARWIN_GS_HACK])
-         /* At this point, %imm0=%rax is live (contains
-            the entrypoint); the lisp registers are
+         /* At this point, %imm1=%rdx is live (contains
+            the entrypoint) and %imm0.b=%al contains
+            info about xmm register arguments; the lisp registers are
             all saved, and the foreign arguments are
             on the foreign stack (about to be popped
@@ -4021,9 +4022,12 @@
             a fixnum */
          __(save_tcr_linear(%save0))
-         __(movq %imm0,%save1)
+         __(movq %imm1,%save1)
+         __(movq %imm0,%save2)
          __(set_foreign_gs_base())
-         __(movq %save1,%imm0)
+         __(movq %save1,%imm1)
+         __(movq %save2,%imm0)
         __endif
 	__(addq $2*node_size,%rsp)
+        __(movq %imm1,%r11)
 	__(pop %rdi)
 	__(pop %rsi)
@@ -4032,5 +4036,5 @@
 	__(pop %r8)
 	__(pop %r9)
-	__(call *%rax)
+	__(call *%r11)
 	__(movq %rbp,%rsp)
         __ifdef([DARWIN_GS_HACK])
@@ -4087,8 +4091,8 @@
         /* Unbox %arg_z.  It's either a fixnum or macptr (or bignum) ;
           if not a fixnum, get the first word */
-        __(unbox_fixnum(%arg_z,%imm0))
+        __(unbox_fixnum(%arg_z,%imm1))
 	__(testb $fixnummask,%arg_z_b)
         __(je 0f)
-        __(movq macptr.address(%arg_z),%imm0)
+        __(movq macptr.address(%arg_z),%imm1)
 0:              
 	/* Save lisp registers   */
@@ -4103,5 +4107,5 @@
 	__(push %save2)
 	__(push %save3)
-        __(movq macptr.address(%arg_y),%save2)  /* save2 = %r13, non-volatile */
+        __(movq macptr.address(%arg_y),%rbx)  /* %rbx non-volatile */
 	__(push %fn)
 	__(push %ra0)
@@ -4117,6 +4121,7 @@
 	__(movq (%rsp),%rbp)
         __ifdef([DARWIN_GS_HACK])
-         /* At this point, %imm0=%rax is live (contains
-            the entrypoint); the lisp registers are
+         /* At this point, %imm1=%rdx is live (contains
+            the entrypoint) and %imm0.b=%al contains
+            xmm argument info; the lisp registers are
             all saved, and the foreign arguments are
             on the foreign stack (about to be popped
@@ -4129,7 +4134,10 @@
          __(save_tcr_linear(%save0))
          __(movq %imm0,%save1)
+         __(movq %imm1,%save2)
          __(set_foreign_gs_base())
          __(movq %save1,%imm0)
+         __(movq %save2,%imm1)
         __endif
+        __(movq %imm1,%r11)
 	__(addq $2*node_size,%rsp)
 	__(pop %rdi)
@@ -4139,9 +4147,9 @@
 	__(pop %r8)
 	__(pop %r9)
-	__(call *%rax)
-        __(movq %rax,(%save2))
-        __(movq %rdx,8(%save2))
-        __(movsd %xmm0,16(%save2))
-        __(movsd %xmm1,24(%save2))
+	__(call *%r11)
+        __(movq %rax,(%rbx))
+        __(movq %rdx,8(%rbx))
+        __(movsd %xmm0,16(%rbx))
+        __(movsd %xmm1,24(%rbx))
 	__(movq %rbp,%rsp)
         __ifdef([DARWIN_GS_HACK])
