From 2192a76d57699eaa0e5fbd3ea391201f6f1e0385 Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Mon, 15 Sep 2003 09:59:11 +0000 Subject: [PATCH] 0.8.3.63: Bignum multiplication on the Alpha... ... when creating notionally unsigned 32-bit quantities from notionally unsigned 64-bit quantities, it's quite important to do a logical and not an arithmetic shift. --- NEWS | 2 ++ src/compiler/alpha/arith.lisp | 4 ++-- tests/arith.pure.lisp | 3 +++ version.lisp-expr | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 21ca817..64cff56 100644 --- a/NEWS +++ b/NEWS @@ -2069,6 +2069,8 @@ changes in sbcl-0.8.4 relative to sbcl-0.8.3: with negative last argument. ** byte specifiers with zero size and position no longer cause an error during type derivation. + ** bignum multiplication on the Alpha platform now returns the + right answer. planned incompatible changes in 0.8.x: * (not done yet, but planned:) When the profiling interface settles diff --git a/src/compiler/alpha/arith.lisp b/src/compiler/alpha/arith.lisp index 1da0e8c..5b07201 100644 --- a/src/compiler/alpha/arith.lisp +++ b/src/compiler/alpha/arith.lisp @@ -627,7 +627,7 @@ (:generator 6 (inst mulq x y lo) (inst addq lo carry-in lo) - (inst sra lo 32 hi) + (inst srl lo 32 hi) (inst mskll lo 4 lo))) @@ -646,7 +646,7 @@ (inst mulq x y lo) (inst addq lo prev lo) (inst addq lo carry-in lo) - (inst sra lo 32 hi) + (inst srl lo 32 hi) (inst mskll lo 4 lo))) (define-vop (bignum-mult) diff --git a/tests/arith.pure.lisp b/tests/arith.pure.lisp index 841f6ef..ce3cfa4 100644 --- a/tests/arith.pure.lisp +++ b/tests/arith.pure.lisp @@ -153,3 +153,6 @@ (assert (= (funcall f 1) 0)) (assert (= (funcall f most-positive-fixnum) 0)) (assert (= (funcall f -1) 0))) + +;;; Alpha bignum arithmetic bug: +(assert (= (* 966082078641 419216044685) 404997107848943140073085)) diff --git a/version.lisp-expr b/version.lisp-expr index 7eb9696..3c18389 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.8.3.62" +"0.8.3.63" -- 1.7.10.4