X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fhppa%2Farith.lisp;h=78b3f536d8844f72fc31d69608be6c0476f0c15a;hb=15d6e7c9a2c3234f95dfe278046fa2fee1b0c007;hp=94f54c1c7759ab2051d9851d5b9827eb522e0b4a;hpb=4ed3f0d08c3a57a6762018d9622f253ab9d0f2b6;p=sbcl.git diff --git a/src/compiler/hppa/arith.lisp b/src/compiler/hppa/arith.lisp index 94f54c1..78b3f53 100644 --- a/src/compiler/hppa/arith.lisp +++ b/src/compiler/hppa/arith.lisp @@ -295,6 +295,9 @@ ;; Count=0? Shouldn't happen, but it's easy: (move number result))))) +;;; FIXME: implement FAST-ASH-LEFT/UNSIGNED=>UNSIGNED and friends, for +;;; use in modular ASH (and because they're useful anyway). -- CSR, +;;; 2004-08-16 (define-vop (signed-byte-32-len) (:translate integer-length) @@ -591,6 +594,15 @@ (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 + ;; FIXME: when FAST-ASH-LEFT/UNSIGNED=>UNSIGNED is + ;; implemented, use it here. -- CSR, 2004-08-16 + fast-ash/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)) (define-modular-fun lognot-mod32 (x) lognot 32) (define-vop (lognot-mod32/unsigned=>unsigned) @@ -631,42 +643,6 @@ (define-source-transform lognor (x y) `(lognot (logior ,x y))) -;;;; 32-bit logical operations - -(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)) - -(define-source-transform 32bit-logical-nand (x y) - `(32bit-logical-not (32bit-logical-and ,x ,y))) - -(deftransform 32bit-logical-or ((x y)) - '(logior x y)) - -(define-source-transform 32bit-logical-nor (x y) - `(logand (lognor (the (unsigned-byte 32) ,x) (the (unsigned-byte 32) ,y)) - #.(1- (ash 1 32)))) - -(deftransform 32bit-logical-xor ((x y)) - '(logxor x y)) - -(define-source-transform 32bit-logical-eqv (x y) - `(32bit-logical-not (32bit-logical-xor ,x ,y))) - -(define-source-transform 32bit-logical-orc1 (x y) - `(32bit-logical-or (32bit-logical-not ,x) ,y)) - -(define-source-transform 32bit-logical-orc2 (x y) - `(32bit-logical-or ,x (32bit-logical-not ,y))) - -(deftransform 32bit-logical-andc1 (x y) - '(logandc1 x y)) - -(deftransform 32bit-logical-andc2 (x y) - '(logandc2 x y)) - (define-vop (shift-towards-someplace) (:policy :fast-safe) (:args (num :scs (unsigned-reg))