aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKazu Hirata <kazu@cs.umass.edu>2003-04-03 11:59:42 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2003-04-03 11:59:42 +0000
commit203dcb741cbd8542593607b34f68ce6b6dba83c3 (patch)
tree4cb00aa0185aec371858c4b4896db7df67d3c89e /gcc
parentdc00aebddf775cb5bafd517796d76fdeb716c1bd (diff)
downloadgcc-203dcb741cbd8542593607b34f68ce6b6dba83c3.zip
gcc-203dcb741cbd8542593607b34f68ce6b6dba83c3.tar.gz
gcc-203dcb741cbd8542593607b34f68ce6b6dba83c3.tar.bz2
h8300.md (a peephole2): Generalize to accept GT and LE.
* config/h8300/h8300.md (a peephole2): Generalize to accept GT and LE. (another peephole2): Likewise. From-SVN: r65199
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/h8300/h8300.md38
2 files changed, 34 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4f0d83f..c9ba702 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2003-04-03 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (a peephole2): Generalize to accept GT
+ and LE.
+ (another peephole2): Likewise.
+
2003-04-03 Nick Clifton <nickc@redhat.com>
* config/sparc/sol2-bi.h (ASM_CPU64_DEFAULT_SPEC): Add -TSO.
diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md
index 190980f..b27a077 100644
--- a/gcc/config/h8300/h8300.md
+++ b/gcc/config/h8300/h8300.md
@@ -4057,7 +4057,7 @@
(compare (match_operand:HI 0 "register_operand" "")
(const_int 255)))
(set (pc)
- (if_then_else (match_operator 1 "gtuleu_operator"
+ (if_then_else (match_operator 1 "gtle_operator"
[(cc0) (const_int 0)])
(label_ref (match_operand 2 "" ""))
(pc)))]
@@ -4066,12 +4066,21 @@
(and:HI (match_dup 0)
(const_int -256)))
(set (pc)
- (if_then_else (match_dup 4)
+ (if_then_else (match_dup 3)
(label_ref (match_dup 2))
(pc)))]
- "operands[4] = ((GET_CODE (operands[1]) == GTU) ?
- gen_rtx_NE (VOIDmode, cc0_rtx, const0_rtx) :
- gen_rtx_EQ (VOIDmode, cc0_rtx, const0_rtx));")
+ "switch (GET_CODE (operands[1]))
+ {
+ case GTU:
+ operands[3] = gen_rtx_NE (VOIDmode, cc0_rtx, const0_rtx);
+ break;
+ case LEU:
+ operands[3] = gen_rtx_EQ (VOIDmode, cc0_rtx, const0_rtx);
+ break;
+ default:
+ operands[3] = operands[1];
+ break;
+ }")
;; (compare (reg:SI) (const_int)) takes 6 bytes, so we try to achieve
;; the equivalent with shorter sequences. Here is the summary. Cases
@@ -4367,7 +4376,7 @@
(compare (match_operand:SI 0 "register_operand" "")
(const_int 65535)))
(set (pc)
- (if_then_else (match_operator 1 "gtuleu_operator"
+ (if_then_else (match_operator 1 "gtle_operator"
[(cc0) (const_int 0)])
(label_ref (match_operand 2 "" ""))
(pc)))]
@@ -4376,12 +4385,21 @@
(and:SI (match_dup 0)
(const_int -65536)))
(set (pc)
- (if_then_else (match_dup 4)
+ (if_then_else (match_dup 3)
(label_ref (match_dup 2))
(pc)))]
- "operands[4] = ((GET_CODE (operands[1]) == GTU) ?
- gen_rtx_NE (VOIDmode, cc0_rtx, const0_rtx) :
- gen_rtx_EQ (VOIDmode, cc0_rtx, const0_rtx));")
+ "switch (GET_CODE (operands[1]))
+ {
+ case GTU:
+ operands[3] = gen_rtx_NE (VOIDmode, cc0_rtx, const0_rtx);
+ break;
+ case LEU:
+ operands[3] = gen_rtx_EQ (VOIDmode, cc0_rtx, const0_rtx);
+ break;
+ default:
+ operands[3] = operands[1];
+ break;
+ }")
;; For constants like -1, -2, 1, 2, it is still cheaper to make a copy
;; of the register being tested, do the subtraction on the copy, and