h8300-protos.h: Add a prototype for gtle_operator.
authorKazu Hirata <kazu@cs.umass.edu>
Thu, 3 Apr 2003 02:41:19 +0000 (02:41 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Thu, 3 Apr 2003 02:41:19 +0000 (02:41 +0000)
* config/h8300/h8300-protos.h: Add a prototype for
gtle_operator.
* config/h8300/h8300.c (gtle_operator): New.
* config/h8300/h8300.h (PREDICATE_CODES): Add an entry for
gtle_operator.
* config/h8300/h8300.md (a peephole2): Generalize to accept GT
and LE.

From-SVN: r65192

gcc/ChangeLog
gcc/config/h8300/h8300-protos.h
gcc/config/h8300/h8300.c
gcc/config/h8300/h8300.h
gcc/config/h8300/h8300.md

index 548f224..7d50188 100644 (file)
@@ -1,3 +1,13 @@
+2003-04-02  Kazu Hirata  <kazu@cs.umass.edu>
+
+       * config/h8300/h8300-protos.h: Add a prototype for
+       gtle_operator.
+       * config/h8300/h8300.c (gtle_operator): New.
+       * config/h8300/h8300.h (PREDICATE_CODES): Add an entry for
+       gtle_operator.
+       * config/h8300/h8300.md (a peephole2): Generalize to accept GT
+       and LE.
+
 2003-04-02  Richard Henderson  <rth@redhat.com>
 
        * libgcc-std.ver (_Unwind_GetCFA): New.
index c0b6ad3..55ef2f5 100644 (file)
@@ -68,6 +68,7 @@ extern int incdec_operand PARAMS ((rtx, enum machine_mode));
 extern int bit_operator PARAMS ((rtx, enum machine_mode));
 extern int nshift_operator PARAMS ((rtx, enum machine_mode));
 extern int eqne_operator PARAMS ((rtx, enum machine_mode));
+extern int gtle_operator PARAMS ((rtx, enum machine_mode));
 extern int gtuleu_operator PARAMS ((rtx, enum machine_mode));
 extern int iorxor_operator PARAMS ((rtx, enum machine_mode));
 
index cfbb959..69f0b53 100644 (file)
@@ -1912,6 +1912,18 @@ eqne_operator (x, mode)
   return (code == EQ || code == NE);
 }
 
+/* Return nonzero if X is GT, LE, GTU, or LEU.  */
+
+int
+gtle_operator (x, mode)
+     rtx x;
+     enum machine_mode mode ATTRIBUTE_UNUSED;
+{
+  enum rtx_code code = GET_CODE (x);
+
+  return (code == GT || code == LE || code == GTU || code == LEU);
+}
+
 /* Return nonzero if X is either GTU or LEU.  */
 
 int
index b1b57f3..dc86668 100644 (file)
@@ -1292,6 +1292,7 @@ struct cum_arg
   {"bit_operator", {XOR, AND, IOR}},                                   \
   {"nshift_operator", {ASHIFTRT, LSHIFTRT, ASHIFT}},                   \
   {"eqne_operator", {EQ, NE}},                                         \
+  {"gtle_operator", {GT, LE, GTU, LEU}},                               \
   {"gtuleu_operator", {GTU, LEU}},                                     \
   {"iorxor_operator", {IOR, XOR}},
 
index a4c76f9..190980f 100644 (file)
        (compare (match_operand:SI 0 "register_operand" "")
                 (match_operand:SI 1 "const_int_operand" "")))
    (set (pc)
-       (if_then_else (match_operator 2 "gtuleu_operator"
+       (if_then_else (match_operator 2 "gtle_operator"
                        [(cc0) (const_int 0)])
                      (label_ref (match_operand 3 "" ""))
                      (pc)))]
        (if_then_else (match_dup 4)
                      (label_ref (match_dup 3))
                      (pc)))]
-  "operands[4] = ((GET_CODE (operands[2]) == GTU) ?
-                 gen_rtx_NE (VOIDmode, cc0_rtx, const0_rtx) :
-                 gen_rtx_EQ (VOIDmode, cc0_rtx, const0_rtx));
+  "switch (GET_CODE (operands[2]))
+     {
+     case GTU:
+       operands[4] = gen_rtx_NE (VOIDmode, cc0_rtx, const0_rtx);
+       break;
+     case LEU:
+       operands[4] = gen_rtx_EQ (VOIDmode, cc0_rtx, const0_rtx);
+       break;
+     default:
+       operands[4] = operands[2];
+       break;
+     }
    operands[5] = GEN_INT (~INTVAL (operands[1]));")
 
 ;; Transform A <= 65535 to (A & 0xffff0000) == 0.