0.9.13.47: Thread safety miscellania
[sbcl.git] / src / compiler / x86 / arith.lisp
index 3c08693..ce684ee 100644 (file)
                   ;; at the low five bits of the result.
                   (inst sar result (min 31 (- amount)))
                   ;; Fixnum correction.
-                  (inst and result #xfffffffc)))))))
+                  (inst and result (lognot fixnum-tag-mask))))))))
 
 (define-vop (fast-ash-left/fixnum=>fixnum)
   (:translate ash)
   (define-logtest-vops))
 
 (defknown %logbitp (integer unsigned-byte) boolean
-  (movable foldable flushable))
+  (movable foldable flushable always-translatable))
 
-(defun %logbitp (index integer)
+;;; only for constant folding within the compiler
+(defun %logbitp (integer index)
   (logbitp index integer))
 
 ;;; too much work to do the non-constant case (maybe?)
 (define-vop (fast-logbitp-c/fixnum fast-conditional-c/fixnum)
   (:translate %logbitp)
+  (:arg-types tagged-num (:constant (integer 0 29)))
   (:generator 4
-    (aver (<= y 29))
     (inst bt x (+ y n-fixnum-tag-bits))
     (inst jmp (if not-p :nc :c) target)))
 
 (define-vop (fast-logbitp/signed fast-conditional/signed)
+  (:args (x :scs (signed-reg signed-stack))
+         (y :scs (signed-reg)))
   (:translate %logbitp)
   (:generator 6
     (inst bt x y)
 
 (define-vop (fast-logbitp-c/signed fast-conditional-c/signed)
   (:translate %logbitp)
+  (:arg-types signed-num (:constant (integer 0 31)))
   (:generator 5
     (inst bt x y)
     (inst jmp (if not-p :nc :c) target)))
 
 (define-vop (fast-logbitp/unsigned fast-conditional/unsigned)
+  (:args (x :scs (unsigned-reg unsigned-stack))
+         (y :scs (unsigned-reg)))
   (:translate %logbitp)
   (:generator 6
     (inst bt x y)
 
 (define-vop (fast-logbitp-c/unsigned fast-conditional-c/unsigned)
   (:translate %logbitp)
+  (:arg-types unsigned-num (:constant (integer 0 31)))
   (:generator 5
     (inst bt x y)
     (inst jmp (if not-p :nc :c) target)))