From 902ac71956ccaacd88bbf9fbe229a4bf4dbcddd9 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Fri, 21 Feb 2003 14:46:11 +0000 Subject: [PATCH] * config/h8300/h8300.md (a peephole2): New. From-SVN: r63224 --- gcc/ChangeLog | 4 ++++ gcc/config/h8300/h8300.md | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c57de2ddaa2..4643a79eb18 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2003-02-21 Kazu Hirata + + * config/h8300/h8300.md (a peephole2): New. + Fri Feb 21 11:05:44 CET 2003 Jan Hubicka * cfgrtl.c (commit_one_edge_insertion): Only mark BB for splitting. diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md index 254d382edd5..beb4534c903 100644 --- a/gcc/config/h8300/h8300.md +++ b/gcc/config/h8300/h8300.md @@ -3847,3 +3847,35 @@ (pc)))] "operands[4] = gen_rtx_REG (HImode, REGNO (operands[0])); operands[5] = GEN_INT (trunc_int_for_mode (INTVAL (operands[1]), HImode));") + +(define_peephole2 + [(set (match_operand:SI 0 "register_operand" "") + (and:SI (match_dup 0) + (match_operand:SI 1 "const_int_qi_operand" ""))) + (set (match_dup 0) + (xor:SI (match_dup 0) + (match_operand:SI 2 "const_int_qi_operand" ""))) + (set (cc0) + (match_dup 0)) + (set (pc) + (if_then_else (match_operator 4 "eqne_operator" + [(cc0) (const_int 0)]) + (label_ref (match_operand 3 "" "")) + (pc)))] + "peep2_reg_dead_p (3, operands[0]) + && (~INTVAL (operands[1]) & INTVAL (operands[2])) == 0" + [(set (match_dup 5) + (and:QI (match_dup 5) + (match_dup 6))) + (set (match_dup 5) + (xor:QI (match_dup 5) + (match_dup 7))) + (set (cc0) + (match_dup 5)) + (set (pc) + (if_then_else (match_op_dup 4 [(cc0) (const_int 0)]) + (label_ref (match_dup 3)) + (pc)))] + "operands[5] = gen_rtx_REG (QImode, REGNO (operands[0])); + operands[6] = GEN_INT (trunc_int_for_mode (INTVAL (operands[1]), QImode)); + operands[7] = GEN_INT (trunc_int_for_mode (INTVAL (operands[2]), QImode));")