(defknown %logbitp (integer unsigned-byte) boolean
(movable foldable flushable))
-(defun %logbitp (index integer)
+(defun %logbitp (integer index)
(logbitp index integer))
;;; We only handle the constant cases because those are the only ones
;;; --njf, 06-02-2006
(define-vop (fast-logbitp-c/fixnum fast-conditional-c/fixnum)
(:translate %logbitp)
+ (:arg-types tagged-num (:constant (integer 0 29)))
(:temporary (:scs (any-reg) :to (:result 0)) test)
(:generator 4
(if (< y 14)
(define-vop (fast-logbitp-c/signed fast-conditional-c/signed)
(:translate %logbitp)
+ (:arg-types signed-num (:constant (integer 0 31)))
(:temporary (:scs (signed-reg) :to (:result 0)) test)
(:generator 4
(if (< y 16)
(define-vop (fast-logbitp-c/unsigned fast-conditional-c/unsigned)
(:translate %logbitp)
+ (:arg-types unsigned-num (:constant (integer 0 31)))
(:temporary (:scs (unsigned-reg) :to (:result 0)) test)
(:generator 4
(if (< y 16)
(defknown %logbitp (integer unsigned-byte) boolean
(movable foldable flushable))
-(defun %logbitp (index integer)
+(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-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-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)))
(%f3 0 a))))
0)))
22)))
+
+;;; MISC.626: bandaged AVER was still wrong
+(assert (eql -829253
+ (funcall
+ (compile
+ nil
+ '(lambda (a)
+ (declare (type (integer -902970 2) a))
+ (declare (optimize (space 2) (debug 0) (compilation-speed 1)
+ (speed 0) (safety 3)))
+ (prog2 (if (logbitp 30 a) 0 (block b3 0)) a)))
+ -829253)))
+
+;; MISC.628: constant-folding %LOGBITP was buggy
+(assert (eql t
+ (funcall
+ (compile
+ nil
+ '(lambda ()
+ (declare (optimize (safety 3) (space 3) (compilation-speed 3)
+ (speed 0) (debug 1)))
+ (not (not (logbitp 0 (floor 2147483651 (min -23 0))))))))))
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.9.9.22"
+"0.9.9.23"