(inst push ebp-tn)
(inst lea
ebp-tn
- (make-ea :dword :base esp-tn :disp word-bytes))
+ (make-ea :dword :base esp-tn :disp n-word-bytes))
(inst sub esp-tn (fixnumize 2))
(inst push eax) ; callers return addr
(inst mov ecx (fixnumize 2)) ; arg count
(inst jmp
(make-ea :dword
:disp (+ nil-value
- (static-function-offset
+ (static-fun-offset
',(symbolicate "TWO-ARG-" fun)))))
DO-BODY
(move ecx res)
- (with-fixed-allocation (res bignum-type (1+ bignum-digits-offset))
- (storew ecx res bignum-digits-offset other-pointer-type))
+ (with-fixed-allocation (res bignum-widetag (1+ bignum-digits-offset))
+ (storew ecx res bignum-digits-offset other-pointer-lowtag))
OKAY)
(define-generic-arith-routine (- 10)
- ;; FIXME: This is screwed up.
- ;;; I can't figure out the flags on subtract. Overflow never gets
- ;;; set and carry always does. (- 0 most-negative-fixnum) can't be
- ;;; easily detected so just let the upper level stuff do it.
- (inst jmp DO-STATIC-FUN)
-
(move res x)
(inst sub res y)
(inst jmp :no OKAY)
+ (inst cmc) ; carry has correct sign now
(inst rcr res 1)
(inst sar res 1) ; remove type bits
(move ecx res)
- (with-fixed-allocation (res bignum-type (1+ bignum-digits-offset))
- (storew ecx res bignum-digits-offset other-pointer-type))
+ (with-fixed-allocation (res bignum-widetag (1+ bignum-digits-offset))
+ (storew ecx res bignum-digits-offset other-pointer-lowtag))
OKAY)
(define-generic-arith-routine (* 30)
(inst cmp x ecx)
(inst jmp :e SINGLE-WORD-BIGNUM)
- (with-fixed-allocation (res bignum-type (+ bignum-digits-offset 2))
- (storew eax res bignum-digits-offset other-pointer-type)
- (storew ecx res (1+ bignum-digits-offset) other-pointer-type))
+ (with-fixed-allocation (res bignum-widetag (+ bignum-digits-offset 2))
+ (storew eax res bignum-digits-offset other-pointer-lowtag)
+ (storew ecx res (1+ bignum-digits-offset) other-pointer-lowtag))
(inst jmp DONE)
SINGLE-WORD-BIGNUM
- (with-fixed-allocation (res bignum-type (1+ bignum-digits-offset))
- (storew eax res bignum-digits-offset other-pointer-type))
+ (with-fixed-allocation (res bignum-widetag (1+ bignum-digits-offset))
+ (storew eax res bignum-digits-offset other-pointer-lowtag))
(inst jmp DONE)
OKAY
(inst pop eax)
(inst push ebp-tn)
- (inst lea ebp-tn (make-ea :dword :base esp-tn :disp word-bytes))
+ (inst lea ebp-tn (make-ea :dword :base esp-tn :disp n-word-bytes))
(inst sub esp-tn (fixnumize 2))
(inst push eax)
(inst mov ecx (fixnumize 1)) ; arg count
(inst jmp (make-ea :dword
- :disp (+ nil-value (static-function-offset '%negate))))
+ :disp (+ nil-value (static-fun-offset '%negate))))
FIXNUM
(move res x)
(inst shr res 2) ; sign bit is data - remove type bits
(move ecx res)
- (with-fixed-allocation (res bignum-type (1+ bignum-digits-offset))
- (storew ecx res bignum-digits-offset other-pointer-type))
+ (with-fixed-allocation (res bignum-widetag (1+ bignum-digits-offset))
+ (storew ecx res bignum-digits-offset other-pointer-lowtag))
OKAY)
\f
TAIL-CALL-TO-STATIC-FN
(inst pop eax)
(inst push ebp-tn)
- (inst lea ebp-tn (make-ea :dword :base esp-tn :disp word-bytes))
+ (inst lea ebp-tn (make-ea :dword
+ :base esp-tn
+ :disp n-word-bytes))
(inst sub esp-tn (fixnumize 2)) ; FIXME: Push 2 words on stack,
; weirdly?
(inst push eax)
; should be named parallelly.
(inst jmp (make-ea :dword
:disp (+ nil-value
- (static-function-offset
- ',static-fn))))
+ (static-fun-offset ',static-fn))))
INLINE-FIXNUM-COMPARE
(inst cmp x y)
DO-STATIC-FN
(inst pop eax)
(inst push ebp-tn)
- (inst lea ebp-tn (make-ea :dword :base esp-tn :disp word-bytes))
+ (inst lea ebp-tn (make-ea :dword :base esp-tn :disp n-word-bytes))
(inst sub esp-tn (fixnumize 2))
(inst push eax)
(inst mov ecx (fixnumize 2))
(inst jmp (make-ea :dword
- :disp (+ nil-value (static-function-offset 'eql))))
+ :disp (+ nil-value (static-fun-offset 'eql))))
RETURN-T
(load-symbol res t)
DO-STATIC-FN
(inst pop eax)
(inst push ebp-tn)
- (inst lea ebp-tn (make-ea :dword :base esp-tn :disp word-bytes))
+ (inst lea ebp-tn (make-ea :dword :base esp-tn :disp n-word-bytes))
(inst sub esp-tn (fixnumize 2))
(inst push eax)
(inst mov ecx (fixnumize 2))
(inst jmp (make-ea :dword
- :disp (+ nil-value (static-function-offset 'two-arg-=))))
+ :disp (+ nil-value (static-fun-offset 'two-arg-=))))
RETURN-T
(load-symbol res t))
(inst xor k k)
LOOP1
(inst mov y (make-ea :dword :base state :index k :scale 4
- :disp (- (* (+ 3 sb!vm:vector-data-offset)
- sb!vm:word-bytes)
- sb!vm:other-pointer-type)))
+ :disp (- (* (+ 3 vector-data-offset)
+ n-word-bytes)
+ other-pointer-lowtag)))
(inst mov tmp (make-ea :dword :base state :index k :scale 4
- :disp (- (* (+ 1 3 sb!vm:vector-data-offset)
- sb!vm:word-bytes)
- sb!vm:other-pointer-type)))
+ :disp (- (* (+ 1 3 vector-data-offset)
+ n-word-bytes)
+ other-pointer-lowtag)))
(inst and y #x80000000)
(inst and tmp #x7fffffff)
(inst or y tmp)
(inst xor y #x9908b0df)
SKIP1
(inst xor y (make-ea :dword :base state :index k :scale 4
- :disp (- (* (+ 397 3 sb!vm:vector-data-offset)
- sb!vm:word-bytes)
- sb!vm:other-pointer-type)))
+ :disp (- (* (+ 397 3 vector-data-offset)
+ n-word-bytes)
+ other-pointer-lowtag)))
(inst mov (make-ea :dword :base state :index k :scale 4
- :disp (- (* (+ 3 sb!vm:vector-data-offset)
- sb!vm:word-bytes)
- sb!vm:other-pointer-type))
+ :disp (- (* (+ 3 vector-data-offset)
+ n-word-bytes)
+ other-pointer-lowtag))
y)
(inst inc k)
(inst cmp k (- 624 397))
(inst jmp :b loop1)
LOOP2
(inst mov y (make-ea :dword :base state :index k :scale 4
- :disp (- (* (+ 3 sb!vm:vector-data-offset)
- sb!vm:word-bytes)
- sb!vm:other-pointer-type)))
+ :disp (- (* (+ 3 vector-data-offset)
+ n-word-bytes)
+ other-pointer-lowtag)))
(inst mov tmp (make-ea :dword :base state :index k :scale 4
- :disp (- (* (+ 1 3 sb!vm:vector-data-offset)
- sb!vm:word-bytes)
- sb!vm:other-pointer-type)))
+ :disp (- (* (+ 1 3 vector-data-offset)
+ n-word-bytes)
+ other-pointer-lowtag)))
(inst and y #x80000000)
(inst and tmp #x7fffffff)
(inst or y tmp)
(inst xor y #x9908b0df)
SKIP2
(inst xor y (make-ea :dword :base state :index k :scale 4
- :disp (- (* (+ (- 397 624) 3 sb!vm:vector-data-offset)
- sb!vm:word-bytes)
- sb!vm:other-pointer-type)))
+ :disp (- (* (+ (- 397 624) 3 vector-data-offset)
+ n-word-bytes)
+ other-pointer-lowtag)))
(inst mov (make-ea :dword :base state :index k :scale 4
- :disp (- (* (+ 3 sb!vm:vector-data-offset)
- sb!vm:word-bytes)
- sb!vm:other-pointer-type))
+ :disp (- (* (+ 3 vector-data-offset)
+ n-word-bytes)
+ other-pointer-lowtag))
y)
(inst inc k)
(inst cmp k (- 624 1))
(inst jmp :b loop2)
(inst mov y (make-ea :dword :base state
- :disp (- (* (+ (- 624 1) 3 sb!vm:vector-data-offset)
- sb!vm:word-bytes)
- sb!vm:other-pointer-type)))
+ :disp (- (* (+ (- 624 1) 3 vector-data-offset)
+ n-word-bytes)
+ other-pointer-lowtag)))
(inst mov tmp (make-ea :dword :base state
- :disp (- (* (+ 0 3 sb!vm:vector-data-offset)
- sb!vm:word-bytes)
- sb!vm:other-pointer-type)))
+ :disp (- (* (+ 0 3 vector-data-offset)
+ n-word-bytes)
+ other-pointer-lowtag)))
(inst and y #x80000000)
(inst and tmp #x7fffffff)
(inst or y tmp)
(inst xor y #x9908b0df)
SKIP3
(inst xor y (make-ea :dword :base state
- :disp (- (* (+ (- 397 1) 3 sb!vm:vector-data-offset)
- sb!vm:word-bytes)
- sb!vm:other-pointer-type)))
+ :disp (- (* (+ (- 397 1) 3 vector-data-offset)
+ n-word-bytes)
+ other-pointer-lowtag)))
(inst mov (make-ea :dword :base state
- :disp (- (* (+ (- 624 1) 3 sb!vm:vector-data-offset)
- sb!vm:word-bytes)
- sb!vm:other-pointer-type))
+ :disp (- (* (+ (- 624 1) 3 vector-data-offset)
+ n-word-bytes)
+ other-pointer-lowtag))
y)
;; Restore the temporary registers and return.