X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fsparc%2Farith.lisp;h=3da21a624293652aa58f87fc9f4b9a62c427f24f;hb=69ef68ba7393e3492c1b4a756d1140f71c2922bc;hp=1bff8c8859d694304fc06861ef1e147a996b6f4d;hpb=2d111458bcb73a545ed9ce0a8f75b037b9ca44e4;p=sbcl.git diff --git a/src/compiler/sparc/arith.lisp b/src/compiler/sparc/arith.lisp index 1bff8c8..3da21a6 100644 --- a/src/compiler/sparc/arith.lisp +++ b/src/compiler/sparc/arith.lisp @@ -482,7 +482,7 @@ ;; Some special cases where we know we want a left shift. Just do the ;; shift, instead of checking for the sign of the shift. (macrolet - ((frob (name sc-type type result-type cost) + ((def (name sc-type type result-type cost) `(define-vop (,name) (:note "inline ASH") (:translate ash) @@ -503,9 +503,9 @@ (let ((amount (tn-value amount))) (aver (>= amount 0)) (inst sll result number amount)))))))) - (frob fast-ash-left/signed=>signed signed-reg signed-num signed-reg 3) - (frob fast-ash-left/fixnum=>fixnum any-reg tagged-num any-reg 2) - (frob fast-ash-left/unsigned=>unsigned unsigned-reg unsigned-num unsigned-reg 3)) + (def fast-ash-left/signed=>signed signed-reg signed-num signed-reg 3) + (def fast-ash-left/fixnum=>fixnum any-reg tagged-num any-reg 2) + (def fast-ash-left/unsigned=>unsigned unsigned-reg unsigned-num unsigned-reg 3)) (define-vop (signed-byte-32-len) @@ -647,7 +647,7 @@ ;;;; Modular functions: -(define-modular-fun lognot-mod32 (x) lognot 32) +(define-modular-fun lognot-mod32 (x) lognot :unsigned 32) (define-vop (lognot-mod32/unsigned=>unsigned) (:translate lognot-mod32) (:args (x :scs (unsigned-reg))) @@ -666,7 +666,7 @@ (vop (symbolicate 'fast- fun '/unsigned=>unsigned)) (cvop (symbolicate 'fast- fun '-c/unsigned=>unsigned))) `(progn - (define-modular-fun ,mfun-name (x y) ,fun 32) + (define-modular-fun ,mfun-name (x y) ,fun :unsigned 32) (define-vop (,modvop ,vop) (:translate ,mfun-name)) ,@(when constantp @@ -689,6 +689,14 @@ (define-vop (fast-ash-left-mod32-c/unsigned=>unsigned fast-ash-c/unsigned=>unsigned) (:translate ash-left-mod32)) + +(define-vop (fast-ash-left-mod32/unsigned=>unsigned + fast-ash-left/unsigned=>unsigned)) +(deftransform ash-left-mod32 ((integer count) + ((unsigned-byte 32) (unsigned-byte 5))) + (when (sb!c::constant-lvar-p count) + (sb!c::give-up-ir1-transform)) + '(%primitive fast-ash-left-mod32/unsigned=>unsigned integer count)) ;;;; Binary conditional VOPs: @@ -825,39 +833,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))