From: Paul K. <pk...@us...> - 2010-10-12 05:10:16
|
Update of /cvsroot/sbcl/sbcl/src/compiler/x86-64 In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv28853/src/compiler/x86-64 Modified Files: arith.lisp Log Message: 1.0.43.47: Unfix ASH of constant shift on x86oids * The fixnum=>fixnum VOPs for ASH used to explicitly handle shifts greater than the word length by computing a zero instead. These should be constant-folded away in IR1 now. * 1.0.43.45 incidentally fixed lp #309063 (which is what the fix above was used for). Add a test case, update NEWS, and note the optimizations committed in 1.0.43.{42,43,47}. Index: arith.lisp =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/compiler/x86-64/arith.lisp,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- arith.lisp 17 Dec 2009 21:01:48 -0000 1.32 +++ arith.lisp 12 Oct 2010 05:10:07 -0000 1.33 @@ -667,6 +667,8 @@ (location= number result))))) (:result-types tagged-num) (:note "inline ASH") + (:variant nil) + (:variant-vars modularp) (:generator 2 (cond ((and (= amount 1) (not (location= number result))) (inst lea result (make-ea :qword :base number :index number))) @@ -685,8 +687,11 @@ (inst sar result (- amount)) (inst and result (lognot fixnum-tag-mask))))) ((plusp amount) + (unless modularp + (aver (not "Impossible: fixnum ASH should not be called with +constant shift greater than word length"))) (if (sc-is result any-reg) - (inst xor result result) + (zeroize result) (inst mov result 0))) (t (inst sar result 63) (inst and result (lognot fixnum-tag-mask)))))))) @@ -1367,6 +1372,7 @@ (define-vop (fast-ash-left-smod61-c/fixnum=>fixnum fast-ash-c/fixnum=>fixnum) + (:variant :modular) (:translate ash-left-smod61)) (define-vop (fast-ash-left-smod61/fixnum=>fixnum fast-ash-left/fixnum=>fixnum)) |