aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Hirata <kazu@cs.umass.edu>2003-03-31 19:06:29 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2003-03-31 19:06:29 +0000
commitef3a7d56e900e4e4d6d97d025a368fd7075db4e6 (patch)
tree87833c3b1bf2f56aaa162a52e577650274a7b1e5
parent5ccd517abe18dadd9fe668b1176d77f0ba2a3146 (diff)
downloadgcc-ef3a7d56e900e4e4d6d97d025a368fd7075db4e6.zip
gcc-ef3a7d56e900e4e4d6d97d025a368fd7075db4e6.tar.gz
gcc-ef3a7d56e900e4e4d6d97d025a368fd7075db4e6.tar.bz2
* config/h8300/h8300.md (a peephole2): New.
From-SVN: r65098
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/config/h8300/h8300.md44
2 files changed, 46 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3035613..e02ab08 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2003-03-31 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (a peephole2): New.
+
2003-03-31 Michael Matz <matz@suse.de>
* config/i386/i386.h (TARGET_FLT_EVAL_METHOD): Change 1 into 0.
diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md
index d0dbb1f..3b72379 100644
--- a/gcc/config/h8300/h8300.md
+++ b/gcc/config/h8300/h8300.md
@@ -4101,8 +4101,10 @@
;; dead 0xffffff?? except -1 and -2 eq/ne xor.b and not.l
;; dead 0xffff??ff eq/ne xor.b and not.l
;;
-;; dead 1 geu/ltu and.b and test
-;; dead 3 geu/ltu and.b and test
+;; dead 1 geu/ltu shlr.l
+;; dead 3 (H8S) geu/ltu shlr.l
+;;
+;; dead 3 (H8/300H) geu/ltu and.b and test
;; dead 7 geu/ltu and.b and test
;; dead 15 geu/ltu and.b and test
;; dead 31 geu/ltu and.b and test
@@ -4223,6 +4225,44 @@
(pc)))]
"operands[4] = GEN_INT (INTVAL (operands[1]) ^ -1);")
+;; Transform
+;;
+;; cmp.l #1,er0
+;; bhi .L1
+;;
+;; into
+;;
+;; shlr.l er0
+;; bne .L1
+
+(define_peephole2
+ [(set (cc0)
+ (compare (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)
+ && peep2_reg_dead_p (1, operands[0])
+ && (INTVAL (operands[1]) == 1
+ || (TARGET_H8300S && INTVAL (operands[1]) == 3))"
+ [(parallel [(set (match_dup 0)
+ (lshiftrt:SI (match_dup 0)
+ (match_dup 5)))
+ (clobber (scratch:QI))])
+ (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 (exact_log2 (INTVAL (operands[1]) + 1));")
+
;; Transform A <= 1 to (A & 0xfffffffe) == 0.
(define_peephole2