From: Christophe R. <cr...@us...> - 2003-09-03 14:13:40
|
Update of /cvsroot/sbcl/sbcl/src/compiler/ppc In directory sc8-pr-cvs1:/tmp/cvs-serv14448/src/compiler/ppc Modified Files: arith.lisp Log Message: 0.8.3.31: Fix ASH bug on PPC ... add a test for it, which will probably fail on most if not all other architectures. To be continued... Index: arith.lisp =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/compiler/ppc/arith.lisp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- arith.lisp 20 Aug 2003 12:28:59 -0000 1.3 +++ arith.lisp 3 Sep 2003 14:13:36 -0000 1.4 @@ -18,7 +18,6 @@ (:effects) (:affected)) - (define-vop (fixnum-unop fast-safe-arith-op) (:args (x :scs (any-reg))) (:results (res :scs (any-reg))) @@ -52,8 +51,6 @@ (:translate lognot) (:generator 1 (inst not res x))) - - ;;;; Binary fixnum operations. @@ -83,7 +80,6 @@ (:result-types signed-num) (:note "inline (signed-byte 32) arithmetic")) - (define-vop (fast-fixnum-binop-c fast-safe-arith-op) (:args (x :target r :scs (any-reg zero))) (:info y) @@ -272,7 +268,7 @@ (inst cmpwi ndesc 31) (inst srw result number ndesc) (inst ble done) - (inst srwi result number 31) + (move result zero-tn) (inst b done) (emit-label positive) @@ -280,14 +276,12 @@ (inst slw result number amount) (emit-label done))) - (immediate (let ((amount (tn-value amount))) - (if (minusp amount) - (let ((amount (min 31 (- amount)))) - (inst srwi result number amount)) - (inst slwi result number amount))))))) - + (cond + ((and (minusp amount) (< amount -31)) (move result zero-tn)) + ((minusp amount) (inst srwi result number (- amount))) + (t (inst slwi result number amount)))))))) (define-vop (fast-ash/signed=>signed) (:note "inline ASH") |