aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKazu Hirata <kazu@cs.umass.edu>2003-02-11 13:43:20 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2003-02-11 13:43:20 +0000
commit717d8b714b7d7888dd0404ab61514a7d6a0a205a (patch)
tree185cbdc7c61dbdd59e46c056023e18882064d36e /gcc
parente36e8f526d8cdbd0ec5c8f12ad972cf99ef02ed7 (diff)
downloadgcc-717d8b714b7d7888dd0404ab61514a7d6a0a205a.zip
gcc-717d8b714b7d7888dd0404ab61514a7d6a0a205a.tar.gz
gcc-717d8b714b7d7888dd0404ab61514a7d6a0a205a.tar.bz2
h8300-protos.h: Add a prototype for gtuleu_operator.
* config/h8300/h8300-protos.h: Add a prototype for gtuleu_operator. * config/h8300/h8300.c (gtuleu_operator): New. * config/h8300/h8300.h (PREDICATE_CODES): Add gtuleu_operator. * config/h8300/h8300.md (a peephole2): New. From-SVN: r62696
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/h8300/h8300-protos.h1
-rw-r--r--gcc/config/h8300/h8300.c12
-rw-r--r--gcc/config/h8300/h8300.h3
-rw-r--r--gcc/config/h8300/h8300.md35
5 files changed, 58 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 809ee40..99e2b90 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2003-02-11 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300-protos.h: Add a prototype for
+ gtuleu_operator.
+ * config/h8300/h8300.c (gtuleu_operator): New.
+ * config/h8300/h8300.h (PREDICATE_CODES): Add gtuleu_operator.
+ * config/h8300/h8300.md (a peephole2): New.
+
Tue Feb 11 13:32:12 CET 2003 Jan Hubicka <jh@suse.cz>
* sched-ebb.c (schedule_ebbs): Do not verify_flow_info.
diff --git a/gcc/config/h8300/h8300-protos.h b/gcc/config/h8300/h8300-protos.h
index db91143..b65f3f4 100644
--- a/gcc/config/h8300/h8300-protos.h
+++ b/gcc/config/h8300/h8300-protos.h
@@ -70,6 +70,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 gtuleu_operator PARAMS ((rtx, enum machine_mode));
extern int h8300_eightbit_constant_address_p PARAMS ((rtx));
extern int h8300_tiny_constant_address_p PARAMS ((rtx));
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index 3a2f12e..ed5b3a0 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -1925,6 +1925,18 @@ eqne_operator (x, mode)
return (code == EQ || code == NE);
}
+/* Return nonzero if X is either GTU or LEU. */
+
+int
+gtuleu_operator (x, mode)
+ rtx x;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
+{
+ enum rtx_code code = GET_CODE (x);
+
+ return (code == GTU || code == LEU);
+}
+
/* Recognize valid operators for bit instructions. */
int
diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h
index 3465371..3331010 100644
--- a/gcc/config/h8300/h8300.h
+++ b/gcc/config/h8300/h8300.h
@@ -1293,6 +1293,7 @@ struct cum_arg
{"incdec_operand", {CONST_INT}}, \
{"bit_operator", {XOR, AND, IOR}}, \
{"nshift_operator", {ASHIFTRT, LSHIFTRT, ASHIFT}}, \
- {"eqne_operator", {EQ, NE}},
+ {"eqne_operator", {EQ, NE}}, \
+ {"gtuleu_operator", {GTU, LEU}},
#endif /* ! GCC_H8300_H */
diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md
index 69e2f72..a95957e 100644
--- a/gcc/config/h8300/h8300.md
+++ b/gcc/config/h8300/h8300.md
@@ -3480,6 +3480,41 @@
"operands[1] = GEN_INT (- INTVAL (operands[1]));
split_adds_subs (SImode, operands, 1);")
+;; Transform A <= 1 to (A & 0xfffffffe) == 0.
+
+(define_peephole2
+ [(set (cc0)
+ (compare:SI (match_operand:SI 0 "register_operand" "")
+ (match_operand:SI 1 "const_int_operand" "")))
+ (set (pc)
+ (if_then_else (match_operator 2 "gtuleu_operator"
+ [(cc0) (const_int 0)])
+ (label_ref (match_operand 3 "" ""))
+ (pc)))]
+ "(TARGET_H8300H || TARGET_H8300S)
+ && find_regno_note (insn, REG_DEAD, REGNO (operands[0]))
+ && (INTVAL (operands[1]) == 1
+ || INTVAL (operands[1]) == 3
+ || INTVAL (operands[1]) == 7
+ || INTVAL (operands[1]) == 15
+ || INTVAL (operands[1]) == 31
+ || INTVAL (operands[1]) == 64
+ || INTVAL (operands[1]) == 127
+ || INTVAL (operands[1]) == 65535)"
+ [(set (match_dup 0)
+ (and:SI (match_dup 0)
+ (match_dup 5)))
+ (set (cc0)
+ (match_dup 0))
+ (set (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));
+ operands[5] = GEN_INT (~INTVAL (operands[1]));")
+
;; Narrow the mode of testing if possible.
(define_peephole2