From 6df5926c567b40b0217e0cc16fd604197add804f Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Fri, 26 Aug 2005 17:52:25 +0000 Subject: [PATCH] 0.9.3.79: SB-ROTATE-BYTE fix + tests for non-constant shifts on the x86. --- NEWS | 3 +++ contrib/sb-rotate-byte/rotate-byte-tests.lisp | 14 ++++++++++++++ contrib/sb-rotate-byte/x86-vm.lisp | 2 +- version.lisp-expr | 2 +- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index fc282cc..22ee18e 100644 --- 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 diff --git a/contrib/sb-rotate-byte/rotate-byte-tests.lisp b/contrib/sb-rotate-byte/rotate-byte-tests.lisp index 518f8cb..252e06d 100644 --- a/contrib/sb-rotate-byte/rotate-byte-tests.lisp +++ b/contrib/sb-rotate-byte/rotate-byte-tests.lisp @@ -51,3 +51,17 @@ (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)) diff --git a/contrib/sb-rotate-byte/x86-vm.lisp b/contrib/sb-rotate-byte/x86-vm.lisp index 4a43d00..27cf845 100644 --- a/contrib/sb-rotate-byte/x86-vm.lisp +++ b/contrib/sb-rotate-byte/x86-vm.lisp @@ -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)) diff --git a/version.lisp-expr b/version.lisp-expr index eda62eb..04bea69 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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" -- 1.7.10.4