0.9.3.79:
authorNathan Froyd <froydnj@cs.rice.edu>
Fri, 26 Aug 2005 17:52:25 +0000 (17:52 +0000)
committerNathan Froyd <froydnj@cs.rice.edu>
Fri, 26 Aug 2005 17:52:25 +0000 (17:52 +0000)
SB-ROTATE-BYTE fix + tests for non-constant shifts on the x86.

NEWS
contrib/sb-rotate-byte/rotate-byte-tests.lisp
contrib/sb-rotate-byte/x86-vm.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index fc282cc..22ee18e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -46,6 +46,9 @@ changes in sbcl-0.9.4 relative to sbcl-0.9.3:
     universal time epoch and the smallest negative 32-bit time_t.
   * bug fix: ENCODE-UNIVERSAL-TIME no longer errors when passed the
     year 1899 so long as the encoded time is non-negative.
+  * bug fix: on the x86 platform, SB-ROTATE-BYTE:ROTATE-BYTE returns
+    the correct answer for non-constant rotate amounts when performing
+    an inline 32-bit rotation.
   * threads
     ** bug fix: RELEASE-FOREGROUND doesn't choke on session lock if
        there is only one thread in the session
index 518f8cb..252e06d 100644 (file)
 (assert (= (ub32 5 1) 32))
 (assert (= (ub32 5 (ash 1 26)) (ash 1 31)))
 (assert (= (ub32 5 (ash 1 27)) 1))
+
+;;; test with (contrived) register pressure on the x86 to ensure that the
+;;; rotatee doesn't get clobbered by the count.
+
+(defun ub32-reg-pressure (count integer)
+  (declare (type (unsigned-byte 32) integer)
+           (type (integer -31 31) count))
+  (rotate-byte count (byte 32 0) (ldb (byte 32 0) (+ (* 67 count)
+                                                     integer))))
+
+(assert (= (ub32-reg-pressure 1 5) 144))
+(assert (= (ub32-reg-pressure 5 5) 10880))
+(assert (= (ub32-reg-pressure 5 (ash 1 26)) 2147494368))
+(assert (= (ub32-reg-pressure 5 (ash 1 27)) 10721))
index 4a43d00..27cf845 100644 (file)
@@ -46,7 +46,7 @@
                (:arg-types sb-vm::tagged-num ,arg-type)
                (:temporary (:sc sb-vm::signed-reg :offset sb-vm::ecx-offset)
                            ecx)
-               (:results (res :scs (sb-vm::unsigned-reg)))
+               (:results (res :scs (sb-vm::unsigned-reg) :from :load))
                (:result-types sb-vm::unsigned-byte-32)
                (:generator 10
                 (let ((label (gen-label))
index eda62eb..04bea69 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.9.3.78"
+"0.9.3.79"