Changeset 7987


Ignore:
Timestamp:
Jan 3, 2008, 1:58:49 AM (12 years ago)
Author:
rme
Message:

Try to set up for .SPvalues correctly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ia32/level-0/X86/X8632/x8632-bignum.lisp

    r7963 r7987  
    77;;; and return multiple values.
    88;;;
    9 ;;; XXX -- figure out how we're going to handle multiple-values...
    109(defx8632lapfunction %bignum-ref ((bignum arg_y) (i arg_z))
    11   (movl (% esp) (% temp0))
     10  (movl (% esp) (% temp0))              ;.SPvalues wants return addr in temp0
    1211  (movzwl (@ (+ 2 x8632::misc-data-offset) (% bignum) (% i)) (% imm0))
    1312  (box-fixnum imm0 temp1)
     
    224223  (box-fixnum temp0 high)
    225224  (mark-as-node temp0)
     225  (movl (% esp) (% temp0))
    226226  (push (% high))
    227227  (push (% low))
    228   (movl (% esp) (% temp0))
    229228  (jmp-subprim .SPvalues))
    230229
     
    252251  (shll ($ 16) (% imm0))
    253252  (orl (% imm0) (% temp1))
    254   (cmpl ($ '1) (@ borrow (% esp)))      ;CF = 1 if borrow is 0 else CF = 0
     253  (cmpl ($ '1) (% borrow))          ;CF = 1 if borrow is 0 else CF = 0
    255254  (sbbl (% temp0) (% temp1))
    256255  (movl ($ 1) (% imm0))
     
    259258  (movzwl (% temp1.w) (% imm0))
    260259  (box-fixnum imm0 imm0)
     260  (popl (% arg_y))                      ;return address
     261  (addl ($ '5) (% esp))                 ;discard reserved frame & stack args
     262  (pushl (% arg_y))
    261263  (push (% imm0))                       ;high
    262264  (sarl ($ 16) (% temp1))
     
    267269  (push (% arg_z))                      ;borrow
    268270  (set-nargs 3)
    269   (popl (@ 16 (% esp)))                 ;relocate return addr
    270   (addl ($ '4) (% esp))                 ;discard args, part of saved frame
    271   (movl (% esp) (% temp0))
     271  (leal (@ '3 (% esp)) (% temp0))
    272272  (jmp-subprim .SPvalues))
    273273 
     
    391391(defx8632lapfunction %add-the-carry ((high 4) #|(ra 0)|# (low arg_y) (c arg_z))
    392392  (mark-as-imm temp0)
    393   (unbox-fixnum low imm0)
    394   (movl (@ high (% esp)) (% temp0))
    395   (shll ($ (- 16 x8632::fixnumshift)) (% temp0))
    396   (orl (% imm0) (% temp0))
    397   (unbox-fixnum c imm0)
    398   (addl (% imm0) (% temp0))
    399   (movzwl (% temp0.w) (% imm0))
    400   (box-fixnum imm0 temp1)
    401   (sarl ($ 16) (% temp0))
    402   (box-fixnum temp0 temp0)
    403   (push (% temp0))                      ;high
    404   (push (% temp1))                      ;low
     393  (let ((imm1 temp0)
     394        (imm1.w temp0.w))
     395    (pop (% temp1))
     396    (popl (% imm1))                     ;high
     397    (discard-reserved-frame)
     398    (push (% temp1))
     399    (shll ($ (- 16 x8632::fixnumshift)) (% temp0))
     400    (unbox-fixnum low imm0)
     401    (orl (% imm0) (% imm1))
     402    (unbox-fixnum c imm0)
     403    (addl (% imm0) (% imm1))
     404    (movzwl (% imm1.w) (% imm0))
     405    (box-fixnum imm0 temp1)
     406    (sarl ($ 16) (% imm1))
     407    (shll ($ x8632::fixnumshift) (% imm1))
     408    (push (% imm1))                     ;high
     409    (push (% temp1)))                   ;low
     410  (mark-as-node temp0)
    405411  (set-nargs 2)
    406   (mark-as-node temp0)
    407   (movl (% esp) (% temp0))
     412  (leal (@ '2 (% esp)) (% temp0))
    408413  (jmp-subprim .SPvalues))
    409414
Note: See TracChangeset for help on using the changeset viewer.