Skip to content
Snippets Groups Projects
Commit 7f9451ca authored by rtoy's avatar rtoy
Browse files

Add some vops to handle logand of signed and unsigned. Based on the

sparc version.
parent 1012ccfb
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
;;; Scott Fahlman (FAHLMAN@CMUC). ;;; Scott Fahlman (FAHLMAN@CMUC).
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/ppc/arith.lisp,v 1.9 2005/02/11 05:42:19 rtoy Exp $ ;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/ppc/arith.lisp,v 1.10 2005/11/04 04:29:46 rtoy Exp $
;;; ;;;
;;; This file contains the VM definition arithmetic VOPs for the MIPS. ;;; This file contains the VM definition arithmetic VOPs for the MIPS.
;;; ;;;
...@@ -240,6 +240,33 @@ ...@@ -240,6 +240,33 @@
(define-const-logop logxor 2 xori) (define-const-logop logxor 2 xori)
;;; Special logand cases: (logand signed unsigned) => unsigned
(define-vop (fast-logand/signed-unsigned=>unsigned
fast-logand/unsigned=>unsigned)
(:args (x :scs (signed-reg))
(y :target r :scs (unsigned-reg)))
(:arg-types signed-num unsigned-num))
(define-vop (fast-logand/unsigned-signed=>unsigned
fast-logand/unsigned=>unsigned)
(:args (x :target r :scs (unsigned-reg))
(y :scs (signed-reg)))
(:arg-types unsigned-num signed-num))
(define-vop (fast-logand-c/signed-unsigned=>unsigned fast-unsigned-binop-c)
(:args (x :scs (signed-reg)))
(:translate logand)
(:arg-types signed-num
(:constant (or (and (unsigned-byte 15) (not (integer 0 0)))
(integer #xffffffff #xffffffff))))
(:generator 1 ; Needs to be low to give this vop a chance.
(cond ((= y #xffffffff)
(move r x))
((typep y '(unsigned-byte 15))
(inst andi. r x y)))))
;;; Special case fixnum + and - that trap on overflow. Useful when we ;;; Special case fixnum + and - that trap on overflow. Useful when we
;;; don't know that the output type is a fixnum. ;;; don't know that the output type is a fixnum.
;;; ;;;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment