0.8.5.7:
[sbcl.git] / src / compiler / x86 / arith.lisp
index 2da36e3..36b869d 100644 (file)
           (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)
 (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)