0.8.20.2:
authorChristophe Rhodes <csr21@cam.ac.uk>
Tue, 1 Mar 2005 10:54:36 +0000 (10:54 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Tue, 1 Mar 2005 10:54:36 +0000 (10:54 +0000)
Fix the compiler note emission from COUNT and EQUAL on bit-vectors.
(reported by Lutz Euler sbcl-devel 2005-02-16)
... rewrite (1- (ash 1 <integer 1 n-word-bits>)) as
(ash #xff...ff (- n-word-bits <integer 1 n-word-bits>))

NEWS
src/compiler/generic/vm-tran.lisp
src/compiler/x86-64/arith.lisp
tests/compiler.pure.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 12d9465..75e7a42 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,9 @@ changes in sbcl-0.8.21 (0.9alpha.1?) relative to sbcl-0.8.20:
      are now more amenable to inspection by INSPECT.
   * workaround for bug 354: XEPs no longer appear in backtraces unless
      explicitly requested.
+  * fixed bug: COUNT and EQUAL no longer issue compiler efficiency
+    notes when operating on objects known to be SIMPLE-BIT-VECTORs.
+    (reported by Lutz Euler)
 
 changes in sbcl-0.8.20 (0.9alpha.0?) relative to sbcl-0.8.19:
   * fixed inspection of specialized arrays. (thanks to Simon Alexander)
index 7866594..36d4227 100644 (file)
                              (floor (1- length) sb!vm:n-word-bits))))
                   ((= i end-1)
                    (let* ((extra (1+ (mod (1- length) sb!vm:n-word-bits)))
-                          (mask (1- (ash 1 extra)))
+                          (mask (ash #.(1- (ash 1 sb!vm:n-word-bits))
+                                     (- extra sb!vm:n-word-bits)))
                           (numx
                            (logand
                             (ash mask
                                  sb!vm:n-word-bits))))
             ((= index end-1)
              (let* ((extra (1+ (mod (1- length) sb!vm:n-word-bits)))
-                   (mask (1- (ash 1 extra)))
+                   (mask (ash #.(1- (ash 1 sb!vm:n-word-bits))
+                              (- extra sb!vm:n-word-bits)))
                    (bits (logand (ash mask
                                       ,(ecase sb!c:*backend-byte-order*
                                               (:little-endian 0)
index fad7497..c4fd46e 100644 (file)
   ;; (no -C variant as x86 MUL instruction doesn't take an immediate)
   (def * nil))
 
-;;; (no -C variant as x86 MUL instruction doesn't take an immediate)
-
 (define-vop (fast-ash-left-mod64-c/unsigned=>unsigned
              fast-ash-c/unsigned=>unsigned)
   (:translate ash-left-mod64))
index f4bc19c..cf08c46 100644 (file)
                  (type number p2))
         (eql (the (complex double-float) p1) p2)))
      c0 #c(12 612/979)))))
+
+;;; reported by Lutz Euler: we shouldn't signal a compiler note for
+;;; simple-bit-vector functions.
+(handler-bind ((sb-ext:compiler-note #'error))
+  (compile nil '(lambda (x)
+                (declare (type simple-bit-vector x))
+                (count 1 x))))
+(handler-bind ((sb-ext:compiler-note #'error))
+  (compile nil '(lambda (x y)
+                (declare (type simple-bit-vector x y))
+                (equal x y))))
index a616f73..2008491 100644 (file)
@@ -17,4 +17,4 @@
 ;;; 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.8.20.1"
+"0.8.20.2"