(:result-types unsigned-num)
(:note "inline (unsigned-byte 32) arithmetic"))
-;; 32 not 64 because it's hard work loading 64 bit constants
(define-vop (fast-signed-binop-c fast-safe-arith-op)
(:args (x :target r :scs (signed-reg signed-stack)))
(:info y)
(define-vop (fast-logand-c/signed-unsigned=>unsigned
fast-logand-c/unsigned=>unsigned)
(:args (x :target r :scs (signed-reg signed-stack)))
- (:arg-types signed-num (:constant (unsigned-byte 32))))
+ (:arg-types signed-num (:constant (unsigned-byte 31))))
(define-vop (fast-logand/unsigned-signed=>unsigned
fast-logand/unsigned=>unsigned)
(:translate +)
(:args (x :target r :scs (unsigned-reg unsigned-stack)))
(:info y)
- (:arg-types unsigned-num (:constant (unsigned-byte 32)))
+ (:arg-types unsigned-num (:constant (unsigned-byte 31)))
(:results (r :scs (unsigned-reg)
:load-if (not (location= x r))))
(:result-types unsigned-num)
(:translate truncate)
(:args (x :scs (unsigned-reg) :target eax))
(:info y)
- (:arg-types unsigned-num (:constant (unsigned-byte 32)))
+ (:arg-types unsigned-num (:constant (unsigned-byte 31)))
(:temporary (:sc unsigned-reg :offset eax-offset :target quo
:from :argument :to (:result 0)) eax)
(:temporary (:sc unsigned-reg :offset edx-offset :target rem
(move result number)
(move ecx amount)
(inst or ecx ecx)
- (inst jmp :ns positive)
+ (inst jmp :ns POSITIVE)
(inst neg ecx)
(inst cmp ecx 63)
- (inst jmp :be okay)
+ (inst jmp :be OKAY)
(inst mov ecx 63)
OKAY
(inst sar result :cl)
- (inst jmp done)
+ (inst jmp DONE)
POSITIVE
;; The result-type ensures us that this shift will not overflow.
(move result number)
(move ecx amount)
(inst or ecx ecx)
- (inst jmp :ns positive)
+ (inst jmp :ns POSITIVE)
(inst neg ecx)
(inst cmp ecx 63)
- (inst jmp :be okay)
+ (inst jmp :be OKAY)
(inst xor result result)
- (inst jmp done)
+ (inst jmp DONE)
OKAY
(inst shr result :cl)
- (inst jmp done)
+ (inst jmp DONE)
POSITIVE
;; The result-type ensures us that this shift will not overflow.
(move result number)
(move ecx amount)
(inst or ecx ecx)
- (inst jmp :ns positive)
+ (inst jmp :ns POSITIVE)
(inst neg ecx)
(inst xor zero zero)
(inst shr result :cl)
(inst cmp ecx 63)
(inst cmov :nbe result zero)
- (inst jmp done)
+ (inst jmp DONE)
POSITIVE
;; The result-type ensures us that this shift will not overflow.
(inst not res)
POS
(inst bsr res res)
- (inst jmp :z zero)
+ (inst jmp :z ZERO)
(inst inc res)
- (inst jmp done)
+ (inst jmp DONE)
ZERO
(inst xor res res)
DONE))
(:result-types unsigned-num)
(:generator 26
(inst bsr res arg)
- (inst jmp :z zero)
+ (inst jmp :z ZERO)
(inst inc res)
- (inst jmp done)
+ (inst jmp DONE)
ZERO
(inst xor res res)
DONE))