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]

[PATCH]: Add eq_compare predicate for HC12


Hi!

Committed this patch (3_3 and mainline) to add the predicate used by dbcc/ibcc
patterns.  I also fixed the d_reg and hard_addr_reg predicates to check the operand
mode.

Stephane

2003-04-12 Stephane Carrez <stcarrez at nerim dot fr>

	* config/m68hc11/m68hc11-protos.h
	(m68hc11_eq_compare_operator): Declare
	* config/m68hc11/m68hc11.h (PREDICATE_CODES): Register new predicate.
	* config/m68hc11/m68hc11.c (m68hc11_eq_compare_operator): New predicate
	(d_register_operand): Check the operand mode.
	(hard_addr_reg_operand): Likewise.
? config/m68hc11/chg.diffs
Index: config/m68hc11/m68hc11-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m68hc11/m68hc11-protos.h,v
retrieving revision 1.18.14.5
diff -u -p -r1.18.14.5 m68hc11-protos.h
--- config/m68hc11/m68hc11-protos.h	21 Mar 2003 23:29:18 -0000	1.18.14.5
+++ config/m68hc11/m68hc11-protos.h	12 Apr 2003 21:38:48 -0000
@@ -123,6 +123,7 @@ extern int m68hc11_arith_operator PARAMS
 extern int m68hc11_non_shift_operator PARAMS((rtx, enum machine_mode));
 extern int m68hc11_shift_operator PARAMS((rtx, enum machine_mode));
 extern int m68hc11_unary_operator PARAMS((rtx, enum machine_mode));
+extern int m68hc11_eq_compare_operator PARAMS((rtx, enum machine_mode));
 extern int non_push_operand PARAMS((rtx, enum machine_mode));
 extern int hard_reg_operand PARAMS((rtx, enum machine_mode));
 extern int soft_reg_operand PARAMS((rtx, enum machine_mode));
Index: config/m68hc11/m68hc11.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m68hc11/m68hc11.c,v
retrieving revision 1.56.4.15
diff -u -p -r1.56.4.15 m68hc11.c
--- config/m68hc11/m68hc11.c	31 Mar 2003 21:02:00 -0000	1.56.4.15
+++ config/m68hc11/m68hc11.c	12 Apr 2003 21:38:51 -0000
@@ -1016,6 +1016,9 @@ d_register_operand (operand, mode)
      rtx operand;
      enum machine_mode mode ATTRIBUTE_UNUSED;
 {
+  if (GET_MODE (operand) != mode && mode != VOIDmode)
+    return 0;
+
   if (GET_CODE (operand) == SUBREG)
     operand = XEXP (operand, 0);
 
@@ -1030,6 +1033,9 @@ hard_addr_reg_operand (operand, mode)
      rtx operand;
      enum machine_mode mode ATTRIBUTE_UNUSED;
 {
+  if (GET_MODE (operand) != mode && mode != VOIDmode)
+    return 0;
+
   if (GET_CODE (operand) == SUBREG)
     operand = XEXP (operand, 0);
 
@@ -1119,6 +1125,14 @@ symbolic_memory_operand (op, mode)
     default:
       return 0;
     }
+}
+
+int
+m68hc11_eq_compare_operator (op, mode)
+     register rtx op;
+     enum machine_mode mode ATTRIBUTE_UNUSED;
+{
+  return GET_CODE (op) == EQ || GET_CODE (op) == NE;
 }
 
 int
Index: config/m68hc11/m68hc11.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m68hc11/m68hc11.h,v
retrieving revision 1.55.4.10
diff -u -p -r1.55.4.10 m68hc11.h
--- config/m68hc11/m68hc11.h	12 Apr 2003 15:16:24 -0000	1.55.4.10
+++ config/m68hc11/m68hc11.h	12 Apr 2003 21:38:52 -0000
@@ -1727,6 +1727,7 @@ do {                                    
 {"m68hc11_non_shift_operator", {AND, IOR, XOR, PLUS, MINUS}},		\
 {"m68hc11_unary_operator",   {NEG, NOT, SIGN_EXTEND, ZERO_EXTEND}},	\
 {"m68hc11_shift_operator",   {ASHIFT, ASHIFTRT, LSHIFTRT, ROTATE, ROTATERT}},\
+{"m68hc11_eq_compare_operator", {EQ, NE}},                              \
 {"non_push_operand",         {SUBREG, REG, MEM}},			\
 {"reg_or_some_mem_operand",  {SUBREG, REG, MEM}},			\
 {"tst_operand",              {SUBREG, REG, MEM}},			\

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