summaryrefslogtreecommitdiffstats
path: root/gcc
diff options
context:
space:
mode:
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2003-02-12 14:10:21 +0000
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2003-02-12 14:10:21 +0000
commit9eeb1a456f46ea3da90d2e9b702fa41a45cf3bf8 (patch)
tree45992ba0cc317944e33f5c4a1fca6cdfea76c778 /gcc
parentd22462d6816f077f11b3dcd3b8304dc7443f93d8 (diff)
downloadppe42-gcc-9eeb1a456f46ea3da90d2e9b702fa41a45cf3bf8.tar.gz
ppe42-gcc-9eeb1a456f46ea3da90d2e9b702fa41a45cf3bf8.zip
* config/h8300/h8300.md (a peephole2): Don't handle 65535.
(two peephole2): New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@62764 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/h8300/h8300.md49
2 files changed, 52 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 52c1cd7d01a..b81e4c8419c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2003-02-12 Kazu Hirata <kazu@cs.umass.edu>
+ * config/h8300/h8300.md (a peephole2): Don't handle 65535.
+ (two peephole2): New.
+
+2003-02-12 Kazu Hirata <kazu@cs.umass.edu>
+
* config/h8300/h8300.md (several peephole2): Replace
find_regno_note with peep2_reg_dead_p.
diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md
index 5c412a7bab2..c9cd5f5aff6 100644
--- a/gcc/config/h8300/h8300.md
+++ b/gcc/config/h8300/h8300.md
@@ -3500,8 +3500,7 @@
|| INTVAL (operands[1]) == 31
|| INTVAL (operands[1]) == 63
|| INTVAL (operands[1]) == 127
- || INTVAL (operands[1]) == 255
- || INTVAL (operands[1]) == 65535)"
+ || INTVAL (operands[1]) == 255)"
[(set (match_dup 0)
(and:SI (match_dup 0)
(match_dup 5)))
@@ -3516,6 +3515,52 @@
gen_rtx_EQ (VOIDmode, cc0_rtx, const0_rtx));
operands[5] = GEN_INT (~INTVAL (operands[1]));")
+;; Transform A <= 255 to (A & 0xff00) == 0.
+
+(define_peephole2
+ [(set (cc0)
+ (compare:HI (match_operand:HI 0 "register_operand" "")
+ (const_int 255)))
+ (set (pc)
+ (if_then_else (match_operator 1 "gtuleu_operator"
+ [(cc0) (const_int 0)])
+ (label_ref (match_operand 2 "" ""))
+ (pc)))]
+ "TARGET_H8300H || TARGET_H8300S"
+ [(set (cc0)
+ (and:HI (match_dup 0)
+ (const_int -256)))
+ (set (pc)
+ (if_then_else (match_dup 4)
+ (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));")
+
+;; Transform A <= 65535 to (A & 0xffff0000) == 0.
+
+(define_peephole2
+ [(set (cc0)
+ (compare:SI (match_operand:SI 0 "register_operand" "")
+ (const_int 65535)))
+ (set (pc)
+ (if_then_else (match_operator 1 "gtuleu_operator"
+ [(cc0) (const_int 0)])
+ (label_ref (match_operand 2 "" ""))
+ (pc)))]
+ "TARGET_H8300H || TARGET_H8300S"
+ [(set (cc0)
+ (and:SI (match_dup 0)
+ (const_int -65536)))
+ (set (pc)
+ (if_then_else (match_dup 4)
+ (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));")
+
;; Narrow the mode of testing if possible.
(define_peephole2
OpenPOWER on IntegriCloud