Index: /branches/ia32/level-0/X86/X8632/x8632-bignum.lisp
===================================================================
--- /branches/ia32/level-0/X86/X8632/x8632-bignum.lisp	(revision 7986)
+++ /branches/ia32/level-0/X86/X8632/x8632-bignum.lisp	(revision 7987)
@@ -7,7 +7,6 @@
 ;;; and return multiple values.
 ;;;
-;;; XXX -- figure out how we're going to handle multiple-values...
 (defx8632lapfunction %bignum-ref ((bignum arg_y) (i arg_z))
-  (movl (% esp) (% temp0))
+  (movl (% esp) (% temp0))		;.SPvalues wants return addr in temp0
   (movzwl (@ (+ 2 x8632::misc-data-offset) (% bignum) (% i)) (% imm0))
   (box-fixnum imm0 temp1)
@@ -224,7 +223,7 @@
   (box-fixnum temp0 high)
   (mark-as-node temp0)
+  (movl (% esp) (% temp0))
   (push (% high))
   (push (% low))
-  (movl (% esp) (% temp0))
   (jmp-subprim .SPvalues))
 
@@ -252,5 +251,5 @@
   (shll ($ 16) (% imm0))
   (orl (% imm0) (% temp1))
-  (cmpl ($ '1) (@ borrow (% esp)))	;CF = 1 if borrow is 0 else CF = 0
+  (cmpl ($ '1) (% borrow))	    ;CF = 1 if borrow is 0 else CF = 0
   (sbbl (% temp0) (% temp1))
   (movl ($ 1) (% imm0))
@@ -259,4 +258,7 @@
   (movzwl (% temp1.w) (% imm0))
   (box-fixnum imm0 imm0)
+  (popl (% arg_y))			;return address
+  (addl ($ '5) (% esp))			;discard reserved frame & stack args
+  (pushl (% arg_y))
   (push (% imm0))			;high
   (sarl ($ 16) (% temp1))
@@ -267,7 +269,5 @@
   (push (% arg_z))			;borrow
   (set-nargs 3)
-  (popl (@ 16 (% esp)))			;relocate return addr
-  (addl ($ '4) (% esp))			;discard args, part of saved frame
-  (movl (% esp) (% temp0))
+  (leal (@ '3 (% esp)) (% temp0))
   (jmp-subprim .SPvalues))
   
@@ -391,19 +391,24 @@
 (defx8632lapfunction %add-the-carry ((high 4) #|(ra 0)|# (low arg_y) (c arg_z))
   (mark-as-imm temp0)
-  (unbox-fixnum low imm0)
-  (movl (@ high (% esp)) (% temp0))
-  (shll ($ (- 16 x8632::fixnumshift)) (% temp0))
-  (orl (% imm0) (% temp0))
-  (unbox-fixnum c imm0)
-  (addl (% imm0) (% temp0))
-  (movzwl (% temp0.w) (% imm0))
-  (box-fixnum imm0 temp1)
-  (sarl ($ 16) (% temp0))
-  (box-fixnum temp0 temp0)
-  (push (% temp0))			;high
-  (push (% temp1))			;low
+  (let ((imm1 temp0)
+	(imm1.w temp0.w))
+    (pop (% temp1))
+    (popl (% imm1))			;high
+    (discard-reserved-frame)
+    (push (% temp1))
+    (shll ($ (- 16 x8632::fixnumshift)) (% temp0))
+    (unbox-fixnum low imm0)
+    (orl (% imm0) (% imm1))
+    (unbox-fixnum c imm0)
+    (addl (% imm0) (% imm1))
+    (movzwl (% imm1.w) (% imm0))
+    (box-fixnum imm0 temp1)
+    (sarl ($ 16) (% imm1))
+    (shll ($ x8632::fixnumshift) (% imm1))
+    (push (% imm1))			;high
+    (push (% temp1)))			;low
+  (mark-as-node temp0)
   (set-nargs 2)
-  (mark-as-node temp0)
-  (movl (% esp) (% temp0))
+  (leal (@ '2 (% esp)) (% temp0))
   (jmp-subprim .SPvalues))
 
