From: stassats <sta...@us...> - 2014-07-01 10:59:52
|
The branch "master" has been updated in SBCL: via 6893588ad61e5d80df51c10956c5c33231c6d249 (commit) from 03566e4b4a527982a37b51ff15c90ba2d88c899a (commit) - Log ----------------------------------------------------------------- commit 6893588ad61e5d80df51c10956c5c33231c6d249 Author: Stas Boukarev <sta...@gm...> Date: Tue Jul 1 14:46:50 2014 +0400 Optimize (LOGIOR SIGNED UNSIGNED) on x86 and ARM. Add two VOPs for combinations of unsigned-num and signed-num arguments. --- src/compiler/arm/arith.lisp | 22 ++++++++++++++++++++++ src/compiler/x86/arith.lisp | 24 ++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 0 deletions(-) diff --git a/src/compiler/arm/arith.lisp b/src/compiler/arm/arith.lisp index cd973dd..e5ccf1f 100644 --- a/src/compiler/arm/arith.lisp +++ b/src/compiler/arm/arith.lisp @@ -173,6 +173,28 @@ (define-binop logior 2 orr) (define-binop logxor 2 eor) +(define-vop (fast-logior-unsigned-signed=>signed fast-safe-arith-op) + (:args (x :scs (unsigned-reg)) + (y :target r :scs (signed-reg))) + (:arg-types unsigned-num signed-num) + (:results (r :scs (signed-reg) :from (:argument 1))) + (:result-types signed-num) + (:note "inline (unsigned-byte 32) arithmetic") + (:translate logior) + (:generator 3 + (inst orr r x y))) + +(define-vop (fast-logior-signed-unsigned=>signed fast-safe-arith-op) + (:args (x :target r :scs (signed-reg)) + (y :scs (unsigned-reg))) + (:arg-types signed-num unsigned-num) + (:results (r :scs (signed-reg) :from (:argument 0))) + (:result-types signed-num) + (:note "inline (unsigned-byte 32) arithmetic") + (:translate logior) + (:generator 3 + (inst orr r x y))) + ;;; Multiplication (define-vop (fast-*/fixnum=>fixnum fast-fixnum-binop) diff --git a/src/compiler/x86/arith.lisp b/src/compiler/x86/arith.lisp index 0db8f76..d43ca77 100644 --- a/src/compiler/x86/arith.lisp +++ b/src/compiler/x86/arith.lisp @@ -199,6 +199,30 @@ (define-binop logior 2 or) (define-binop logxor 2 xor)) +(define-vop (fast-logior-unsigned-signed=>signed fast-safe-arith-op) + (:args (x :scs (unsigned-reg)) + (y :target r :scs (signed-reg))) + (:arg-types unsigned-num signed-num) + (:results (r :scs (signed-reg) :from (:argument 1))) + (:result-types signed-num) + (:note "inline (unsigned-byte 32) arithmetic") + (:translate logior) + (:generator 3 + (move r y) + (inst or r x))) + +(define-vop (fast-logior-signed-unsigned=>signed fast-safe-arith-op) + (:args (x :target r :scs (signed-reg)) + (y :scs (unsigned-reg))) + (:arg-types signed-num unsigned-num) + (:results (r :scs (signed-reg) :from (:argument 0))) + (:result-types signed-num) + (:note "inline (unsigned-byte 32) arithmetic") + (:translate logior) + (:generator 3 + (move r x) + (inst or r y))) + ;;; Special handling of add on the x86; can use lea to avoid a ;;; register load, otherwise it uses add. (define-vop (fast-+/fixnum=>fixnum fast-safe-arith-op) ----------------------------------------------------------------------- hooks/post-receive -- SBCL |