aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKazu Hirata <kazu@cs.umass.edu>2003-04-03 02:41:19 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2003-04-03 02:41:19 +0000
commit9a2dd2dd026c67d30b0937aee6b22b2472e95673 (patch)
treeb7cbc319830506358fad6081581f419646fd0ba5 /gcc
parent378683cf6216f2edcd3bb5bf2f093fa54c6aa524 (diff)
downloadgcc-9a2dd2dd026c67d30b0937aee6b22b2472e95673.zip
gcc-9a2dd2dd026c67d30b0937aee6b22b2472e95673.tar.gz
gcc-9a2dd2dd026c67d30b0937aee6b22b2472e95673.tar.bz2
h8300-protos.h: Add a prototype for gtle_operator.
* 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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/config/h8300/h8300-protos.h1
-rw-r--r--gcc/config/h8300/h8300.c12
-rw-r--r--gcc/config/h8300/h8300.h1
-rw-r--r--gcc/config/h8300/h8300.md17
5 files changed, 37 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 548f224..7d50188 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/config/h8300/h8300-protos.h b/gcc/config/h8300/h8300-protos.h
index c0b6ad3..55ef2f5 100644
--- a/gcc/config/h8300/h8300-protos.h
+++ b/gcc/config/h8300/h8300-protos.h
@@ -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));
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index cfbb959..69f0b53 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -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
diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h
index b1b57f3..dc86668 100644
--- a/gcc/config/h8300/h8300.h
+++ b/gcc/config/h8300/h8300.h
@@ -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}},
diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md
index a4c76f9..190980f 100644
--- a/gcc/config/h8300/h8300.md
+++ b/gcc/config/h8300/h8300.md
@@ -4324,7 +4324,7 @@
(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)))]
@@ -4346,9 +4346,18 @@
(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.