;; Lisp stack
(etypecase val
(integer
- (storew (fixnumize val) fp (- (1+ (tn-offset y)))))
+ (storew (fixnumize val) fp (frame-word-offset (tn-offset y))))
(symbol
(storew (+ nil-value (static-symbol-offset val))
- fp (- (1+ (tn-offset y)))))
+ fp (frame-word-offset (tn-offset y))))
(character
(storew (logior (ash (char-code val) n-widetag-bits)
character-widetag)
- fp (- (1+ (tn-offset y))))))))
+ fp (frame-word-offset (tn-offset y)))))))
(if (= (tn-offset fp) esp-offset)
;; C-call
(storew x fp (tn-offset y))
;; Lisp stack
- (storew x fp (- (1+ (tn-offset y))))))))))
+ (storew x fp (frame-word-offset (tn-offset y)))))))))
(define-move-vop move-arg :move-arg
(any-reg descriptor-reg)
(:note "fixnum untagging")
(:generator 1
(move y x)
- (inst sar y (1- n-lowtag-bits))))
+ (inst sar y n-fixnum-tag-bits)))
(define-move-vop move-to-word/fixnum :move
(any-reg descriptor-reg) (signed-reg unsigned-reg))
(:results (y :scs (signed-reg unsigned-reg)))
(:note "constant load")
(:generator 1
- (inst mov y (tn-value x))))
+ (cond ((sb!c::tn-leaf x)
+ (inst mov y (tn-value x)))
+ (t
+ (inst mov y x)
+ (inst sar y n-fixnum-tag-bits)))))
(define-move-vop move-to-word-c :move
(constant) (signed-reg unsigned-reg))
:from (:argument 0) :to (:result 0) :target y) eax)
(:generator 4
(move eax x)
- (inst test al-tn 7) ; a symbolic constant for this
- (inst jmp :z FIXNUM) ; would be nice
+ (inst test al-tn fixnum-tag-mask)
+ (inst jmp :z FIXNUM)
(loadw y eax bignum-digits-offset other-pointer-lowtag)
(inst jmp DONE)
FIXNUM
- (inst sar eax (1- n-lowtag-bits))
+ (inst sar eax n-fixnum-tag-bits)
(move y eax)
DONE))
(define-move-vop move-to-word/integer :move
(cond ((and (sc-is x signed-reg unsigned-reg)
(not (location= x y)))
;; Uses 7 bytes, but faster on the Pentium
- (inst lea y (make-ea :qword :index x :scale 8)))
+ (inst lea y (make-ea :qword :index x
+ :scale (ash 1 n-fixnum-tag-bits))))
(t
;; Uses: If x is a reg 2 + 3; if x = y uses only 3 bytes
(move y x)
- (inst shl y (1- n-lowtag-bits))))))
+ (inst shl y n-fixnum-tag-bits)))))
(define-move-vop move-from-word/fixnum :move
(signed-reg unsigned-reg) (any-reg descriptor-reg))
(:generator 20
(aver (not (location= x y)))
(let ((done (gen-label)))
- (inst mov y #.(ash lowtag-mask (- n-word-bits n-fixnum-tag-bits 1)))
+ (inst mov y #.(ash (1- (ash 1 (1+ n-fixnum-tag-bits)))
+ n-positive-fixnum-bits))
;; The assembly routines test the sign flag from this one, so if
;; you change stuff here, make sure the sign flag doesn't get
;; overwritten before the CALL!
;; Faster but bigger then SHL Y 4. The cost of doing this
;; speculatively should be noise compared to bignum consing if
;; that is needed and saves one branch.
- (inst lea y (make-ea :qword :index x :scale 8))
+ (inst lea y (make-ea :qword :index x :scale (ash 1 n-fixnum-tag-bits)))
(inst jmp :z done)
(inst mov y x)
(inst lea temp-reg-tn
((signed-stack unsigned-stack)
(if (= (tn-offset fp) esp-offset)
(storew x fp (tn-offset y)) ; c-call
- (storew x fp (- (1+ (tn-offset y)))))))))
+ (storew x fp (frame-word-offset (tn-offset y))))))))
(define-move-vop move-word-arg :move-arg
(descriptor-reg any-reg signed-reg unsigned-reg) (signed-reg unsigned-reg))