X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fx86%2Farith.lisp;h=36b869d71e2bcfd0a114f4c51ad413c651c3ca52;hb=d131dfb49a3e6522d2358d14252f3f52cfcd202a;hp=2da36e3eeeeb3ab80e1b5a734e240fdde6027931;hpb=b61003dec6f5af2b03549439155676666186283e;p=sbcl.git diff --git a/src/compiler/x86/arith.lisp b/src/compiler/x86/arith.lisp index 2da36e3..36b869d 100644 --- a/src/compiler/x86/arith.lisp +++ b/src/compiler/x86/arith.lisp @@ -683,9 +683,13 @@ (inst lea result (make-ea :dword :index number :scale 8))) (t (move result number) - (cond ((plusp amount) (inst shl result amount)) - ((< amount -31) (inst xor result result)) - (t (inst shr result (- amount)))))))) + (cond ((< -32 amount 32) + ;; this code is used both in ASH and ASH-MOD32, so + ;; be careful + (if (plusp amount) + (inst shl result amount) + (inst shr result (- amount)))) + (t (inst xor result result))))))) (define-vop (fast-ash-left/signed=>signed) (:translate ash) @@ -1148,11 +1152,9 @@ (define-vop (fast---mod32-c/unsigned=>unsigned fast---c/unsigned=>unsigned) (:translate --mod32)) -(defknown ash-left-constant-mod32 (integer (integer 0)) (unsigned-byte 32) - (foldable flushable movable)) -(define-vop (fast-ash-left-constant-mod32/unsigned=>unsigned - fast-ash-c/unsigned=>unsigned) - (:translate ash-left-constant-mod32)) +(define-vop (fast-ash-left-mod32-c/unsigned=>unsigned + fast-ash-c/unsigned=>unsigned) + (:translate ash-left-mod32)) ;;; logical operations (define-modular-fun lognot-mod32 (x) lognot 32)