Changeset 13531


Ignore:
Timestamp:
Mar 15, 2010, 6:20:49 AM (10 years ago)
Author:
gb
Message:

Handle the seemingly special case of (%FIXNUM-TRUNCATE MOST-NEGATIVE-FIXNUM -1)
on x86, too.

Location:
trunk/source/level-0/X86
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-0/X86/X8632/x8632-numbers.lisp

    r13335 r13531  
    114114  (single-value-return))
    115115
     116
     117
    116118;;; We'll get a SIGFPE if divisor is 0.
    117119(defx8632lapfunction %fixnum-truncate ((dividend arg_y) (divisor arg_z))
     120  (cmpl ($ '-1) (% divisor))
     121  (je @neg)
    118122  (mark-as-imm temp0)
    119123  (mark-as-imm temp1)
     
    131135  (push (% arg_z))
    132136  (push (% arg_y))
     137  (set-nargs 2)
     138  (jmp-subprim .SPvalues)
     139  @neg
     140  (negl (% dividend))
     141  (load-constant *least-positive-bignum* arg_z)
     142  (cmovol (@ x8632::symbol.vcell (% arg_z)) (% dividend))
     143  (movl (% esp) (% temp0))
     144  (pushl (% dividend))
     145  (pushl ($ 0))
    133146  (set-nargs 2)
    134147  (jmp-subprim .SPvalues))
  • trunk/source/level-0/X86/x86-numbers.lisp

    r13327 r13531  
    112112
    113113
     114
    114115;;; We'll get a SIGFPE if divisor is 0.
    115116;;; Don't use %rbp.  Trust callback_for_interrupt() to preserve
     
    117118(defx86lapfunction %fixnum-truncate ((dividend arg_y) (divisor arg_z))
    118119  (save-simple-frame)
     120  (cmpq ($ '-1) (% divisor))
     121  (je @neg)
    119122  (unbox-fixnum divisor imm0)
    120123  (movq (% imm0) (% imm2))
     
    129132  (pushq (% arg_y))
    130133  (set-nargs 2)
     134  (jmp-subprim .SPvalues)
     135  @neg
     136  (negq (% dividend))
     137  (load-constant *least-positive-bignum* arg_z)
     138  (cmovoq (@ x8664::symbol.vcell (% arg_z)) (% dividend))
     139  (pop (% rbp))
     140  (movq (% rsp) (% temp0))
     141  (pushq (% dividend))
     142  (pushq ($ 0))
     143  (set-nargs 2)
    131144  (jmp-subprim .SPvalues))
     145 
    132146
    133147(defx86lapfunction called-for-mv-p ()
Note: See TracChangeset for help on using the changeset viewer.