X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fppc%2Farith.lisp;h=df34914159204c3611434669a8963154ffb54d1d;hb=80f222325e1f677e5cf8de01c6990906fa47f65d;hp=336033d6dc42bc77e452fba5c4de810e158132e4;hpb=4ed3f0d08c3a57a6762018d9622f253ab9d0f2b6;p=sbcl.git diff --git a/src/compiler/ppc/arith.lisp b/src/compiler/ppc/arith.lisp index 336033d..df34914 100644 --- a/src/compiler/ppc/arith.lisp +++ b/src/compiler/ppc/arith.lisp @@ -371,6 +371,8 @@ (cond ((and (minusp amount) (< amount -31)) (move result zero-tn)) ((minusp amount) (inst srwi result number (- amount))) + ;; possible because this is used in the modular version too + ((> amount 31) (move result zero-tn)) (t (inst slwi result number amount))))) (define-vop (fast-ash/signed=>signed) @@ -489,6 +491,7 @@ (:translate ,mfun-name)))))))) (define-modular-backend + t) (define-modular-backend - t) + (define-modular-backend * t) (define-modular-backend logxor t) (define-modular-backend logeqv) (define-modular-backend lognand) @@ -700,39 +703,6 @@ (emit-label done) (move result res)))) -(define-source-transform 32bit-logical-not (x) - `(logand (lognot (the (unsigned-byte 32) ,x)) #.(1- (ash 1 32)))) - -(deftransform 32bit-logical-and ((x y)) - '(logand x y)) - -(deftransform 32bit-logical-nand ((x y)) - '(logand (lognand x y) #.(1- (ash 1 32)))) - -(deftransform 32bit-logical-or ((x y)) - '(logior x y)) - -(deftransform 32bit-logical-nor ((x y)) - '(logand (lognor x y) #.(1- (ash 1 32)))) - -(deftransform 32bit-logical-xor ((x y)) - '(logxor x y)) - -(deftransform 32bit-logical-eqv ((x y)) - '(logand (logeqv x y) #.(1- (ash 1 32)))) - -(deftransform 32bit-logical-orc1 ((x y)) - '(logand (logorc1 x y) #.(1- (ash 1 32)))) - -(deftransform 32bit-logical-orc2 ((x y)) - '(logand (logorc2 x y) #.(1- (ash 1 32)))) - -(deftransform 32bit-logical-andc1 ((x y)) - '(logand (logandc1 x y) #.(1- (ash 1 32)))) - -(deftransform 32bit-logical-andc2 ((x y)) - '(logand (logandc2 x y) #.(1- (ash 1 32)))) - (define-vop (shift-towards-someplace) (:policy :fast-safe) (:args (num :scs (unsigned-reg))