aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2001-10-08 15:38:45 -0700
committerRichard Henderson <rth@gcc.gnu.org>2001-10-08 15:38:45 -0700
commit646ded90c6b3d96cd172dcbf18cce70d76d9d172 (patch)
treebdab30ca4adce12216ae9924a740d74b2e862df7
parente052f1a966427305f58c5c580b94e1e5a012bb51 (diff)
downloadgcc-646ded90c6b3d96cd172dcbf18cce70d76d9d172.zip
gcc-646ded90c6b3d96cd172dcbf18cce70d76d9d172.tar.gz
gcc-646ded90c6b3d96cd172dcbf18cce70d76d9d172.tar.bz2
i386.md (movsi_xor): Export.
* i386.md (movsi_xor): Export. (setcc peep2): Use it when available; add an alternative to match zero_extendhisi2_and. From-SVN: r46107
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/i386/i386.md43
2 files changed, 43 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e8f087c..bc49dc6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2001-10-08 Richard Henderson <rth@redhat.com>
+
+ * i386.md (movsi_xor): Export.
+ (setcc peep2): Use it when available; add an alternative to
+ match zero_extendhisi2_and.
+
2001-10-08 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* romp-protos.h (romp_initialize_trampoline): New function.
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index fa18782..63fefc8 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -1711,7 +1711,7 @@
[(set_attr "type" "pop")
(set_attr "mode" "SI")])
-(define_insn "*movsi_xor"
+(define_insn "movsi_xor"
[(set (match_operand:SI 0 "register_operand" "=r")
(match_operand:SI 1 "const0_operand" "i"))
(clobber (reg:CC 17))]
@@ -13126,14 +13126,45 @@
[(reg 17) (const_int 0)]))
(set (match_operand 3 "q_regs_operand" "")
(zero_extend (match_dup 1)))]
- "peep2_reg_dead_p (3, operands[1])
+ "(peep2_reg_dead_p (3, operands[1])
+ || operands_match_p (operands[1], operands[3]))
&& ! reg_overlap_mentioned_p (operands[3], operands[0])"
- [(set (match_dup 3) (const_int 0))
- (set (match_dup 4) (match_dup 0))
+ [(set (match_dup 4) (match_dup 0))
+ (set (strict_low_part (match_dup 5))
+ (match_dup 2))]
+{
+ operands[4] = gen_rtx_REG (GET_MODE (operands[0]), 17);
+ operands[5] = gen_rtx_REG (QImode, REGNO (operands[3]));
+ if (HAVE_movsi_xor)
+ emit_insn (gen_movsi_xor (operands[3], const0_rtx));
+ else
+ emit_insn (gen_movsi (operands[3], const0_rtx));
+})
+
+;; Similar, but match zero_extendhisi2_and, which adds a clobber.
+
+(define_peephole2
+ [(set (reg 17) (match_operand 0 "" ""))
+ (set (match_operand:QI 1 "register_operand" "")
+ (match_operator:QI 2 "ix86_comparison_operator"
+ [(reg 17) (const_int 0)]))
+ (parallel [(set (match_operand 3 "q_regs_operand" "")
+ (zero_extend (match_dup 1)))
+ (clobber (reg:CC 17))])]
+ "(peep2_reg_dead_p (3, operands[1])
+ || operands_match_p (operands[1], operands[3]))
+ && ! reg_overlap_mentioned_p (operands[3], operands[0])"
+ [(set (match_dup 4) (match_dup 0))
(set (strict_low_part (match_dup 5))
(match_dup 2))]
- "operands[4] = gen_rtx_REG (GET_MODE (operands[0]), 17);
- operands[5] = gen_rtx_REG (QImode, REGNO (operands[3]));")
+{
+ operands[4] = gen_rtx_REG (GET_MODE (operands[0]), 17);
+ operands[5] = gen_rtx_REG (QImode, REGNO (operands[3]));
+ if (HAVE_movsi_xor)
+ emit_insn (gen_movsi_xor (operands[3], const0_rtx));
+ else
+ emit_insn (gen_movsi (operands[3], const0_rtx));
+})
;; Call instructions.