Changeset 9482


Ignore:
Timestamp:
May 15, 2008, 2:19:30 AM (11 years ago)
Author:
rme
Message:

Correct errors in %integer-decode-double-float.

Make %double-float->short-float take two parameters: src and result.
(64 bit platforms have immediate single floats, and don't need the
result parameter.)

File:
1 edited

Legend:

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

    r9476 r9482  
    9090
    9191    (movl (@ x8632::double-float.val-high (% n)) (% imm1))
    92     (movl (% imm1) (% imm0))
    93     (sarl ($ 31) (% imm0))              ;propagate sign
    94     (shll ($ 31) (% imm0))
    95     (box-fixnum imm0 arg_y)
     92    (movl ($ '1) (% arg_y))
     93    (movl ($ '-1) (% imm0))
     94    (btl ($ 31) (% imm1))
     95    (cmovcl (% imm0) (% arg_y))
    9696    (movl (% arg_y) (@ sign (% esp)))
    9797
    9898    (movl (% imm1) (% imm0))
    9999    (andl ($ #x7ff00000) (% imm0))      ;exponent
    100     (shll ($ (- 20 x8632::fixnumshift)) (% imm0))
     100    (shrl ($ (- 20 x8632::fixnumshift)) (% imm0))
    101101    (movl (% imm0) (@ exp (% esp)))
    102102
     
    104104    (andl ($ #x000fffff) (% imm1))      ;high 20 bits of fraction
    105105    (shldl ($ 4) (% imm0) (% imm1))     ;shift in 4 bits from low word
    106     (testl ($ 0) (@ exp (% esp)))
    107     (jz @denorm)
    108     (or ($ (ash 1 (- ieee-double-float-hidden-bit 32))) (% imm1))
     106    (cmpl ($ 0) (@ exp (% esp)))
     107    (je @denorm)
     108    (or ($ (ash 1 (- ieee-double-float-hidden-bit 28))) (% imm1))
    109109    @denorm
    110110    (box-fixnum imm1 arg_y)
     
    112112
    113113    (shll ($ 4) (% imm0))               ;shift out bits included in hi
    114     (shrl ($ (- 4 x8632::fixnumshift)) (% imm0)) ;and box 28 low bits
     114    (shrl ($ x8632::fixnumshift) (% imm0)) ;and box 28 low bits
    115115    (movl (% imm0) (@ lo (% esp))))
    116116  (mark-as-node temp0)
     
    241241  (single-value-return))
    242242
    243 (defx8632lapfunction %double-float->short-float ((src arg_z))
     243(defx8632lapfunction %double-float->short-float ((src arg_y) (result arg_z))
    244244  (get-double-float src fp1)
    245245  (cvtsd2ss (% fp1) (% fp1))
    246   (put-single-float fp1 arg_z)
     246  (put-single-float fp1 result)
    247247  (single-value-return))
    248248
Note: See TracChangeset for help on using the changeset viewer.