0.8.5.7:
authorAlexey Dejneka <adejneka@comail.ru>
Sun, 26 Oct 2003 14:15:06 +0000 (14:15 +0000)
committerAlexey Dejneka <adejneka@comail.ru>
Sun, 26 Oct 2003 14:15:06 +0000 (14:15 +0000)
        * Fix bug MISC.99 found by Paul Dietz: on X86 in
          FAST-ASH-C/UNSIGNED=>UNSIGNED VOP add case (>= shift 32)
          (the code is shared with -MOD32 version, where "result type
          constraint" does not guarantee overflow absence).

NEWS
src/compiler/x86/arith.lisp
tests/compiler.pure.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 0b8c6c4..bb0555b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2178,6 +2178,8 @@ changes in sbcl-0.8.6 relative to sbcl-0.8.5:
   * fixed some bugs revealed by Paul Dietz' test suite:
     ** compiler failure in compiling LOGAND expressions including a
        constant 0.
+    ** implementation of ASH-MOD32 on X86 did not work for the shift
+       greater than 32.
 
 planned incompatible changes in 0.8.x:
   * (not done yet, but planned:) When the profiling interface settles
index 39efee1..36b869d 100644 (file)
           (inst lea result (make-ea :dword :index number :scale 8)))
          (t
           (move result number)
-          (cond ((plusp amount) (inst shl result amount))
-                ((< amount -31) (inst xor result result))
-                (t (inst shr result (- amount))))))))
+          (cond ((< -32 amount 32)
+                  ;; this code is used both in ASH and ASH-MOD32, so
+                  ;; be careful
+                  (if (plusp amount)
+                      (inst shl result amount)
+                      (inst shr result (- amount))))
+                (t (inst xor result result)))))))
 
 (define-vop (fast-ash-left/signed=>signed)
   (:translate ash)
index 89b8925..bd999b7 100644 (file)
 (assert (= (funcall (compile nil (lambda (x) (logand x x 0)))
                    -1)
           0))
+
+;;; MISC.99 from Paul Dietz' random tester: FAST-ASH-MOD32-C VOP
+;;; produced wrong result for shift >=32 on X86
+(assert (= 0 (funcall
+              (compile nil
+                       '(lambda (a)
+                         (declare (type (integer 4303063 101130078) a))
+                         (mask-field (byte 18 2) (ash a 77))))
+              57132532)))
index 07a3e59..55ab16b 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.5.6"
+"0.8.5.7"