(defknown %%ldb (integer unsigned-byte unsigned-byte) unsigned-byte
(movable foldable flushable))
+(defun %%ldb (integer size posn)
+ (sb-kernel::%ldb size posn integer))
+
(define-vop (ldb-c/fixnum)
(:translate %%ldb)
(:args (x :scs (any-reg)))
(defknown %logbitp (integer unsigned-byte) boolean
(movable foldable flushable))
+(defun %logbitp (index integer)
+ (logbitp index integer))
+
;;; We only handle the constant cases because those are the only ones
;;; guaranteed to make it past COMBINATION-IMPLEMENTATION-STYLE.
;;; --njf, 06-02-2006
(defknown %logbitp (integer unsigned-byte) boolean
(movable foldable flushable))
+(defun %logbitp (index integer)
+ (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)
(:generator 4
- (aver (< y 29))
+ (aver (<= y 29))
(inst bt x (+ y n-fixnum-tag-bits))
(inst jmp (if not-p :nc :c) target)))
(inst bt x y)
(inst jmp (if not-p :nc :c) target)))
-(define-vop (fast-logbitp-/unsigned fast-conditional-c/unsigned)
+(define-vop (fast-logbitp-c/unsigned fast-conditional-c/unsigned)
(:translate %logbitp)
(:generator 5
(inst bt x y)
(declare (type (or (simple-array character (6))
(simple-array character (5))) x))
(aref x 0))))
+
+;;; MISC.623: missing functions for constant-folding
+(assert (eql 0
+ (funcall
+ (compile
+ nil
+ '(lambda ()
+ (declare (optimize (space 2) (speed 0) (debug 2)
+ (compilation-speed 3) (safety 0)))
+ (loop for lv3 below 1
+ count (minusp
+ (loop for lv2 below 2
+ count (logbitp 0
+ (bit #*1001101001001
+ (min 12 (max 0 lv3))))))))))))
+
+;;; MISC.624: erronous AVER in x86's %LOGBITP VOPs
+(assert (eql 0
+ (funcall
+ (compile
+ nil
+ '(lambda (a)
+ (declare (type (integer 21 28) a))
+ (declare (optimize (compilation-speed 1) (safety 2)
+ (speed 0) (debug 0) (space 1)))
+ (let* ((v7 (flet ((%f3 (f3-1 f3-2)
+ (loop for lv2 below 1
+ count
+ (logbitp 29
+ (sbit #*10101111
+ (min 7 (max 0 (eval '0))))))))
+ (%f3 0 a))))
+ 0)))
+ 22)))
;;; 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.19"
+"0.9.9.20"