0.7.8.20:
authorChristophe Rhodes <csr21@cam.ac.uk>
Tue, 8 Oct 2002 08:24:06 +0000 (08:24 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Tue, 8 Oct 2002 08:24:06 +0000 (08:24 +0000)
Fix the small-data-vector-ref/c issue for PPC, following the solution
for SPARC
... and make the test a little more exhaustive

BUGS
src/compiler/ppc/array.lisp
tests/array.pure.lisp
version.lisp-expr

diff --git a/BUGS b/BUGS
index b823166..c0b8f47 100644 (file)
--- a/BUGS
+++ b/BUGS
@@ -422,6 +422,10 @@ WORKAROUND:
   (I haven't tried to investigate this bug enough to guess whether
   there might be any user-level symptoms.)
 
+  In fact, the type system is likely to depend on this inequality not
+  holding... * is not equivalent to T in many cases, such as 
+    (VECTOR *) /= (VECTOR T).
+
 94a: 
   Inconsistencies between derived and declared VALUES return types for
   DEFUN aren't checked very well. E.g. the logic which successfully
index 8239a8f..f1e2683 100644 (file)
@@ -1,6 +1,14 @@
-;;;
-;;; Written by William Lott
-;;;
+;;;; array operations for the PPC VM
+
+;;;; This software is part of the SBCL system. See the README file for
+;;;; more information.
+;;;;
+;;;; This software is derived from the CMU CL system, which was
+;;;; written at Carnegie Mellon University and released into the
+;;;; public domain. The software is in the public domain and is
+;;;; provided with absolutely no warranty. See the COPYING and CREDITS
+;;;; files for more information.
+
 (in-package "SB!VM")
 
 \f
         (:result-types positive-fixnum)
         (:temporary (:scs (non-descriptor-reg)) temp)
         (:generator 15
-          (multiple-value-bind (word extra) (floor index ,elements-per-word)
+          (multiple-value-bind (word extra)
+              (floor index ,elements-per-word)
             (setf extra (logxor extra (1- ,elements-per-word)))
-            (let ((offset (- (* (+ word sb!vm:vector-data-offset) sb!vm:n-word-bytes)
+            (let ((offset (- (* (+ word sb!vm:vector-data-offset)
+                                sb!vm:n-word-bytes)
                              sb!vm:other-pointer-lowtag)))
               (cond ((typep offset '(signed-byte 16))
                      (inst lwz result object offset))
                      (inst lr temp offset)
                      (inst lwzx result object temp))))
             (unless (zerop extra)
-              (inst srwi result result
-                    (logxor (* extra ,bits) ,(1- elements-per-word))))
+              (inst srwi result result (* ,bits extra)))
             (unless (= extra ,(1- elements-per-word))
               (inst andi. result result ,(1- (ash 1 bits)))))))
        (define-vop (,(symbolicate 'data-vector-set/ type))
index 65a8a60..4e665ed 100644 (file)
                                                         (aref x 12))))))
          (error "error not thrown in COMPILED-DECLARED-AREF ~S" form))))))
 
-;;; On the SPARC, until sbcl-0.7.7.20, there was a bug in array references 
-;;; for small vector elements (spotted by Raymond Toy).
+;;; On the SPARC, until sbcl-0.7.7.20, there was a bug in array
+;;; references for small vector elements (spotted by Raymond Toy); the
+;;; bug persisted on the PPC until sbcl-0.7.8.20.
+(let (vector)
+  (loop for i below 64
+       for list = (make-list 64 :initial-element 1)
+       do (setf (nth i list) 0)
+       do (setf vector (make-array 64 :element-type 'bit 
+                                      :initial-contents list))
+       do (assert (= (funcall 
+                      (compile nil 
+                               `(lambda (rmdr)
+                                 (declare (type (simple-array bit (*)) rmdr)
+                                          (optimize (speed 3) (safety 0)))
+                                 (aref rmdr ,i)))
+                      vector)
+                     0))))
+#|
 (assert (= (funcall 
             (lambda (rmdr) 
               (declare (type (simple-array bit (*)) rmdr)
@@ -71,3 +87,4 @@
               (aref rmdr 0))
             #*00000000000000000000000000000001000000000)
            0))
+|#
\ No newline at end of file
index 76cdc82..7458ebb 100644 (file)
@@ -18,4 +18,4 @@
 ;;; internal versions off the main CVS branch, it gets hairier, e.g.
 ;;; "0.pre7.14.flaky4.13".)
 
-"0.7.8.19"
+"0.7.8.20"