X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fx86%2Farith.lisp;h=6965feeb1f412e3ecbf71aff8b530179982ca6d6;hb=96aa790ea1d70810e862665c3c8be4ce405a964c;hp=be39dbd640a0fa51de1ff1d6500b8f67a281883f;hpb=0c00c2fd86be43b18d2e42b1e4e05bed653168ec;p=sbcl.git diff --git a/src/compiler/x86/arith.lisp b/src/compiler/x86/arith.lisp index be39dbd..6965fee 100644 --- a/src/compiler/x86/arith.lisp +++ b/src/compiler/x86/arith.lisp @@ -621,7 +621,7 @@ (aver (not "Impossible: fixnum ASH should not be called with constant shift greater than word length"))) (if (sc-is result any-reg) - (zeroize result) + (inst xor result result) (inst mov result 0))) (t (inst sar result 31) (inst and result (lognot fixnum-tag-mask)))))))) @@ -1574,6 +1574,42 @@ constant shift greater than word length"))) (move hi edx) (move lo eax))) +#!+multiply-high-vops +(define-vop (mulhi) + (:translate sb!kernel:%multiply-high) + (:policy :fast-safe) + (:args (x :scs (unsigned-reg) :target eax) + (y :scs (unsigned-reg unsigned-stack))) + (:arg-types unsigned-num unsigned-num) + (:temporary (:sc unsigned-reg :offset eax-offset :from (:argument 0)) + eax) + (:temporary (:sc unsigned-reg :offset edx-offset :from (:argument 1) + :to (:result 0) :target hi) edx) + (:results (hi :scs (unsigned-reg))) + (:result-types unsigned-num) + (:generator 20 + (move eax x) + (inst mul eax y) + (move hi edx))) + +#!+multiply-high-vops +(define-vop (mulhi/fx) + (:translate sb!kernel:%multiply-high) + (:policy :fast-safe) + (:args (x :scs (any-reg) :target eax) + (y :scs (unsigned-reg unsigned-stack))) + (:arg-types positive-fixnum unsigned-num) + (:temporary (:sc any-reg :offset eax-offset :from (:argument 0)) eax) + (:temporary (:sc any-reg :offset edx-offset :from (:argument 1) + :to (:result 0) :target hi) edx) + (:results (hi :scs (any-reg))) + (:result-types positive-fixnum) + (:generator 15 + (move eax x) + (inst mul eax y) + (move hi edx) + (inst and hi (lognot fixnum-tag-mask)))) + (define-vop (bignum-lognot lognot-mod32/word=>unsigned) (:translate sb!bignum:%lognot)) @@ -1592,7 +1628,7 @@ constant shift greater than word length"))) (inst sar digit n-fixnum-tag-bits))) (define-vop (bignum-floor) - (:translate sb!bignum:%floor) + (:translate sb!bignum:%bigfloor) (:policy :fast-safe) (:args (div-high :scs (unsigned-reg) :target edx) (div-low :scs (unsigned-reg) :target eax)