This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

mn10300 logical operations


mn10300's logical operations don't set the C or V flags in a way that
enables us to omit a `cmp' instruction followed by certain conditional
branches.  This patch fixes GCC's expectations regarding these
instructions.  I'm checking this in.  Tested with
i686-pc-linux-gnu-x-mn10300-elf.

Index: gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* config/mn10300/mn10300.md (andsi3, iorsi3, xorsi3,
	one_complsi2, bit-clear, bit-set, iorqi3): Make them set_zn.

Index: gcc/config/mn10300/mn10300.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mn10300/mn10300.md,v
retrieving revision 1.47
diff -u -p -r1.47 mn10300.md
--- gcc/config/mn10300/mn10300.md 10 Jul 2003 03:25:32 -0000 1.47
+++ gcc/config/mn10300/mn10300.md 18 Sep 2003 02:32:18 -0000
@@ -1224,7 +1224,7 @@
     return \"and %1,%0\";
   return \"and %2,%0\";
 }"
-  [(set_attr "cc" "none_0hit,set_znv,set_znv")])
+  [(set_attr "cc" "none_0hit,set_zn,set_zn")])
 
 (define_insn ""
   [(set (match_operand:SI 0 "register_operand" "=dx,dx")
@@ -1255,7 +1255,7 @@
     return \"lsr 4,%0\;asl2 %0\;asl2 %0\";
   return \"and %2,%0\";
 }"
-  [(set_attr "cc" "none_0hit,set_znv")])
+  [(set_attr "cc" "none_0hit,set_zn")])
 
 ;; ----------------------------------------------------------------------
 ;; OR INSTRUCTIONS
@@ -1291,7 +1291,7 @@
     return \"or %1,%0\";
   return \"or %2,%0\";
 }"
-  [(set_attr "cc" "set_znv")])
+  [(set_attr "cc" "set_zn")])
 
 (define_insn ""
   [(set (match_operand:SI 0 "register_operand" "=dx")
@@ -1299,7 +1299,7 @@
 		(match_operand:SI 2 "nonmemory_operand" "dxi")))]
   ""
   "or %2,%0"
-  [(set_attr "cc" "set_znv")])
+  [(set_attr "cc" "set_zn")])
 
 ;; ----------------------------------------------------------------------
 ;; XOR INSTRUCTIONS
@@ -1335,7 +1335,7 @@
     return \"xor %1,%0\";
   return \"xor %2,%0\";
 }"
-  [(set_attr "cc" "set_znv")])
+  [(set_attr "cc" "set_zn")])
 
 (define_insn ""
   [(set (match_operand:SI 0 "register_operand" "=dx")
@@ -1343,7 +1343,7 @@
 		(match_operand:SI 2 "nonmemory_operand" "dxi")))]
   ""
   "xor %2,%0"
-  [(set_attr "cc" "set_znv")])
+  [(set_attr "cc" "set_zn")])
 
 ;; ----------------------------------------------------------------------
 ;; NOT INSTRUCTIONS
@@ -1360,14 +1360,14 @@
 	(not:SI (match_operand:SI 1 "register_operand" "0,0")))]
   "TARGET_AM33"
   "not %0"
-  [(set_attr "cc" "set_znv")])
+  [(set_attr "cc" "set_zn")])
 
 (define_insn ""
   [(set (match_operand:SI 0 "register_operand" "=dx")
 	(not:SI (match_operand:SI 1 "register_operand" "0")))]
   ""
   "not %0"
-  [(set_attr "cc" "set_znv")])
+  [(set_attr "cc" "set_zn")])
 
 ;; -----------------------------------------------------------------
 ;; BIT FIELDS
@@ -1404,7 +1404,7 @@
   "@
   bclr %N1,%A0
   and %1,%0"
-  [(set_attr "cc" "clobber,set_znv")])
+  [(set_attr "cc" "clobber,set_zn")])
 
 (define_insn ""
   [(set (match_operand:QI 0 "memory_operand" "=R,T")
@@ -1426,7 +1426,7 @@
   "@
   bset %U1,%A0
   or %1,%0"
-  [(set_attr "cc" "clobber,set_znv")])
+  [(set_attr "cc" "clobber,set_zn")])
 
 (define_expand "iorqi3"
   [(set (match_operand:QI 0 "nonimmediate_operand" "")
@@ -1449,7 +1449,7 @@
   bset %U2,%A0
   bset %2,%0
   or %2,%0"
-  [(set_attr "cc" "clobber,clobber,set_znv")])
+  [(set_attr "cc" "clobber,clobber,set_zn")])
 
 (define_insn ""
   [(set (match_operand:QI 0 "nonimmediate_operand" "=R,T,d")
@@ -1464,7 +1464,7 @@
   bset %U2,%A0
   bset %2,%0
   or %2,%0"
-  [(set_attr "cc" "clobber,clobber,set_znv")])
+  [(set_attr "cc" "clobber,clobber,set_zn")])
 
 (define_insn ""
   [(set (cc0)
-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]