X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Falpha%2Farith.lisp;h=fccb1f049cbfef3149b5f341ba42b1a6312a8545;hb=f73c1f391342c797b8daebe4e8c27e5923341b6d;hp=7f2a0bd87423c56bc91401bbe135d3b5fe7c38cb;hpb=dd357f3be290498fb7ef172696d986337f517a93;p=sbcl.git diff --git a/src/compiler/alpha/arith.lisp b/src/compiler/alpha/arith.lisp index 7f2a0bd..fccb1f0 100644 --- a/src/compiler/alpha/arith.lisp +++ b/src/compiler/alpha/arith.lisp @@ -196,7 +196,7 @@ (:translate ash) (:policy :fast-safe) (:temporary (:sc non-descriptor-reg) ndesc) - (:temporary (:sc non-descriptor-reg :to :eval) temp) + (:temporary (:sc non-descriptor-reg) temp) (:generator 3 (inst bge amount positive) (inst subq zero-tn amount ndesc) @@ -223,7 +223,7 @@ (:translate ash) (:policy :fast-safe) (:temporary (:sc non-descriptor-reg) ndesc) - (:temporary (:sc non-descriptor-reg :to :eval) temp) + (:temporary (:sc non-descriptor-reg) temp) (:generator 3 (inst bge amount positive) (inst subq zero-tn amount ndesc) @@ -249,8 +249,8 @@ (:result-types signed-num) (:generator 1 (cond - ((< count 0) (inst sra number (- count) result)) - ((> count 0) (inst sll number count result)) + ((< count 0) (inst sra number (min 63 (- count)) result)) + ((> count 0) (inst sll number (min 63 count) result)) (t (bug "identity ASH not transformed away"))))) (define-vop (fast-ash-c/unsigned=>unsigned) @@ -266,7 +266,7 @@ (cond ((< count -63) (move zero-tn result)) ((< count 0) (inst sra number (- count) result)) - ((> count 0) (inst sll number count result)) + ((> count 0) (inst sll number (min 63 count) result)) (t (bug "identity ASH not transformed away"))))) (define-vop (signed-byte-64-len) @@ -364,11 +364,15 @@ (:generator 1 (inst not x res))) +(define-vop (fast-ash-left-mod64-c/unsigned=>unsigned + fast-ash-c/unsigned=>unsigned) + (:translate ash-left-mod64)) + (macrolet ((define-modular-backend (fun &optional constantp) (let ((mfun-name (symbolicate fun '-mod64)) (modvop (symbolicate 'fast- fun '-mod64/unsigned=>unsigned)) - (modcvop (symbolicate 'fast- fun 'mod64-c/unsigned=>unsigned)) + (modcvop (symbolicate 'fast- fun '-mod64-c/unsigned=>unsigned)) (vop (symbolicate 'fast- fun '/unsigned=>unsigned)) (cvop (symbolicate 'fast- fun '-c/unsigned=>unsigned))) `(progn @@ -379,6 +383,7 @@ `((define-vop (,modcvop ,cvop) (:translate ,mfun-name)))))))) (define-modular-backend + t) + (define-modular-backend - t) (define-modular-backend logxor t) (define-modular-backend logeqv t) (define-modular-backend logandc1) @@ -640,21 +645,21 @@ ;;;; bignum stuff (define-vop (bignum-length get-header-data) - (:translate sb!bignum::%bignum-length) + (:translate sb!bignum:%bignum-length) (:policy :fast-safe)) (define-vop (bignum-set-length set-header-data) - (:translate sb!bignum::%bignum-set-length) + (:translate sb!bignum:%bignum-set-length) (:policy :fast-safe)) (define-full-reffer bignum-ref * bignum-digits-offset other-pointer-lowtag - (unsigned-reg) unsigned-num sb!bignum::%bignum-ref) + (unsigned-reg) unsigned-num sb!bignum:%bignum-ref) (define-full-setter bignum-set * bignum-digits-offset other-pointer-lowtag - (unsigned-reg) unsigned-num sb!bignum::%bignum-set #!+gengc nil) + (unsigned-reg) unsigned-num sb!bignum:%bignum-set #!+gengc nil) (define-vop (digit-0-or-plus) - (:translate sb!bignum::%digit-0-or-plusp) + (:translate sb!bignum:%digit-0-or-plusp) (:policy :fast-safe) (:args (digit :scs (unsigned-reg))) (:arg-types unsigned-num) @@ -668,7 +673,7 @@ (inst bge temp target)))) (define-vop (add-w/carry) - (:translate sb!bignum::%add-with-carry) + (:translate sb!bignum:%add-with-carry) (:policy :fast-safe) (:args (a :scs (unsigned-reg)) (b :scs (unsigned-reg)) @@ -684,7 +689,7 @@ (inst mskll result 4 result))) (define-vop (sub-w/borrow) - (:translate sb!bignum::%subtract-with-borrow) + (:translate sb!bignum:%subtract-with-borrow) (:policy :fast-safe) (:args (a :scs (unsigned-reg)) (b :scs (unsigned-reg)) @@ -702,7 +707,7 @@ (inst mskll result 4 result))) (define-vop (bignum-mult-and-add-3-arg) - (:translate sb!bignum::%multiply-and-add) + (:translate sb!bignum:%multiply-and-add) (:policy :fast-safe) (:args (x :scs (unsigned-reg)) (y :scs (unsigned-reg)) @@ -719,7 +724,7 @@ (define-vop (bignum-mult-and-add-4-arg) - (:translate sb!bignum::%multiply-and-add) + (:translate sb!bignum:%multiply-and-add) (:policy :fast-safe) (:args (x :scs (unsigned-reg)) (y :scs (unsigned-reg)) @@ -737,7 +742,7 @@ (inst mskll lo 4 lo))) (define-vop (bignum-mult) - (:translate sb!bignum::%multiply) + (:translate sb!bignum:%multiply) (:policy :fast-safe) (:args (x :scs (unsigned-reg)) (y :scs (unsigned-reg))) @@ -751,7 +756,7 @@ (inst mskll lo 4 lo))) (define-vop (bignum-lognot) - (:translate sb!bignum::%lognot) + (:translate sb!bignum:%lognot) (:policy :fast-safe) (:args (x :scs (unsigned-reg))) (:arg-types unsigned-num) @@ -762,7 +767,7 @@ (inst mskll r 4 r))) (define-vop (fixnum-to-digit) - (:translate sb!bignum::%fixnum-to-digit) + (:translate sb!bignum:%fixnum-to-digit) (:policy :fast-safe) (:args (fixnum :scs (any-reg))) (:arg-types tagged-num) @@ -772,7 +777,7 @@ (inst sra fixnum 2 digit))) (define-vop (bignum-floor) - (:translate sb!bignum::%floor) + (:translate sb!bignum:%floor) (:policy :fast-safe) (:args (num-high :scs (unsigned-reg)) (num-low :scs (unsigned-reg)) @@ -802,7 +807,7 @@ (emit-label shift2))))) (define-vop (signify-digit) - (:translate sb!bignum::%fixnum-digit-with-correct-sign) + (:translate sb!bignum:%fixnum-digit-with-correct-sign) (:policy :fast-safe) (:args (digit :scs (unsigned-reg) :target res)) (:arg-types unsigned-num) @@ -819,7 +824,7 @@ (define-vop (digit-ashr) - (:translate sb!bignum::%ashr) + (:translate sb!bignum:%ashr) (:policy :fast-safe) (:args (digit :scs (unsigned-reg)) (count :scs (unsigned-reg))) @@ -832,12 +837,12 @@ (inst srl result 32 result))) (define-vop (digit-lshr digit-ashr) - (:translate sb!bignum::%digit-logical-shift-right) + (:translate sb!bignum:%digit-logical-shift-right) (:generator 1 (inst srl digit count result))) (define-vop (digit-ashl digit-ashr) - (:translate sb!bignum::%ashl) + (:translate sb!bignum:%ashl) (:generator 1 (inst sll digit count result)))