(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
-;;;
-;;; 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))
(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)
(aref rmdr 0))
#*00000000000000000000000000000001000000000)
0))
+|#
\ No newline at end of file