From 1b084c0f767bea70359d543dc2c98dc955d31bea Mon Sep 17 00:00:00 2001
From: dtc <dtc>
Date: Tue, 12 Sep 2000 07:36:01 +0000
Subject: [PATCH] Add special case VOPs for logand to handle mixed signed and
 unsigned arguments which can be inlined efficiently.

---
 compiler/x86/arith.lisp | 32 ++++++++++++++++++++++++++++++--
 1 file changed, 30 insertions(+), 2 deletions(-)

diff --git a/compiler/x86/arith.lisp b/compiler/x86/arith.lisp
index a6ca3530b..ec9c22004 100644
--- a/compiler/x86/arith.lisp
+++ b/compiler/x86/arith.lisp
@@ -7,7 +7,7 @@
 ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
 ;;;
 (ext:file-comment
- "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/x86/arith.lisp,v 1.12 2000/01/16 20:12:23 dtc Exp $")
+ "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/x86/arith.lisp,v 1.13 2000/09/12 07:36:01 dtc Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -16,7 +16,7 @@
 ;;; Written by William Lott.
 ;;;
 ;;; Debugged by Paul F. Werkowski Spring/Summer 1995.
-;;; Enhancements/debugging by Douglas T. Crosher 1996,1997.
+;;; Enhancements/debugging by Douglas T. Crosher 1996,1997,2000.
 ;;; 
 
 (in-package :x86)
@@ -330,6 +330,34 @@
 	       (inst inc r)
 	     (inst add r y))))))
 
+
+;;;; Special logand cases: (logand signed unsigned) => unsigned
+
+(define-vop (fast-logand/signed-unsigned=>unsigned
+	     fast-logand/unsigned=>unsigned)
+  (:args (x :target r :scs (signed-reg)
+	    :load-if (not (and (sc-is x signed-stack)
+			       (sc-is y unsigned-reg)
+			       (sc-is r unsigned-stack)
+			       (location= x r))))
+	 (y :scs (unsigned-reg unsigned-stack)))
+  (:arg-types signed-num unsigned-num))
+
+(define-vop (fast-logand-c/signed-unsigned=>unsigned
+	     fast-logand-c/unsigned=>unsigned)
+  (:args (x :target r :scs (signed-reg signed-stack)))
+  (:arg-types signed-num (:constant (unsigned-byte 32))))
+
+(define-vop (fast-logand/unsigned-signed=>unsigned
+	     fast-logand/unsigned=>unsigned)
+  (:args (x :target r :scs (unsigned-reg)
+	    :load-if (not (and (sc-is x unsigned-stack)
+			       (sc-is y signed-reg)
+			       (sc-is r unsigned-stack)
+			       (location= x r))))
+	 (y :scs (signed-reg signed-stack)))
+  (:arg-types unsigned-num signed-num))
+
 
 ;;;; Multiplication and division.
 
-- 
GitLab