summaryrefslogtreecommitdiff
path: root/gcc/config/i386/i386.md
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/i386/i386.md')
-rw-r--r--gcc/config/i386/i386.md45
1 files changed, 25 insertions, 20 deletions
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 5696c2645a7..cdadf5d0e71 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -9591,10 +9591,11 @@
[(match_scratch:SI 1 "r")
(set (match_operand:SI 0 "memory_operand" "")
(const_int 0))]
- "! optimize_size && get_attr_length (insn) >= ix86_cost->large_insn
- && reg_dead_p (insn, gen_rtx_REG (CCmode, FLAGS_REG))
+ "! optimize_size
&& ! TARGET_USE_MOV0
- && TARGET_SPLIT_LONG_MOVES"
+ && TARGET_SPLIT_LONG_MOVES
+ && get_attr_length (insn) >= ix86_cost->large_insn
+ && peep2_regno_dead_p (0, FLAGS_REG)"
[(parallel [(set (match_dup 1) (const_int 0))
(clobber (reg:CC 17))])
(set (match_dup 0) (match_dup 1))]
@@ -9604,10 +9605,11 @@
[(match_scratch:HI 1 "r")
(set (match_operand:HI 0 "memory_operand" "")
(const_int 0))]
- "! optimize_size && get_attr_length (insn) >= ix86_cost->large_insn
- && reg_dead_p (insn, gen_rtx_REG (CCmode, FLAGS_REG))
+ "! optimize_size
&& ! TARGET_USE_MOV0
- && TARGET_SPLIT_LONG_MOVES"
+ && TARGET_SPLIT_LONG_MOVES
+ && get_attr_length (insn) >= ix86_cost->large_insn
+ && peep2_regno_dead_p (0, FLAGS_REG)"
[(parallel [(set (match_dup 2) (const_int 0))
(clobber (reg:CC 17))])
(set (match_dup 0) (match_dup 1))]
@@ -9617,10 +9619,11 @@
[(match_scratch:QI 1 "q")
(set (match_operand:QI 0 "memory_operand" "")
(const_int 0))]
- "! optimize_size && get_attr_length (insn) >= ix86_cost->large_insn
- && reg_dead_p (insn, gen_rtx_REG (CCmode, FLAGS_REG))
+ "! optimize_size
&& ! TARGET_USE_MOV0
- && TARGET_SPLIT_LONG_MOVES"
+ && TARGET_SPLIT_LONG_MOVES
+ && get_attr_length (insn) >= ix86_cost->large_insn
+ && peep2_regno_dead_p (0, FLAGS_REG)"
[(parallel [(set (match_dup 2) (const_int 0))
(clobber (reg:CC 17))])
(set (match_dup 0) (match_dup 1))]
@@ -9630,8 +9633,9 @@
[(match_scratch:SI 2 "r")
(set (match_operand:SI 0 "memory_operand" "")
(match_operand:SI 1 "immediate_operand" ""))]
- "! optimize_size && get_attr_length (insn) >= ix86_cost->large_insn
- && TARGET_SPLIT_LONG_MOVES"
+ "! optimize_size
+ && get_attr_length (insn) >= ix86_cost->large_insn
+ && TARGET_SPLIT_LONG_MOVES"
[(set (match_dup 2) (match_dup 1))
(set (match_dup 0) (match_dup 2))]
"")
@@ -9675,14 +9679,14 @@
;; represented using a modRM byte. The XOR replacement is long decoded,
;; so this split helps here as well.
;;
-;; Note: Can't do this as a regular split because reg_dead_p assumes
-;; resource info is live.
+;; Note: Can't do this as a regular split because we can't get proper
+;; lifetime information then.
(define_peephole2
[(set (match_operand:SI 0 "nonimmediate_operand" "=rm")
(not:SI (match_operand:SI 1 "nonimmediate_operand" "0")))]
"!optimize_size
- && reg_dead_p (insn, gen_rtx_REG (CCmode, FLAGS_REG))
+ && peep2_regno_dead_p (0, FLAGS_REG)
&& ((TARGET_PENTIUM
&& (GET_CODE (operands[0]) != MEM
|| !memory_displacement_operand (operands[0], SImode)))
@@ -9696,7 +9700,7 @@
[(set (match_operand:HI 0 "nonimmediate_operand" "=rm")
(not:HI (match_operand:HI 1 "nonimmediate_operand" "0")))]
"!optimize_size
- && reg_dead_p (insn, gen_rtx_REG (CCmode, FLAGS_REG))
+ && peep2_regno_dead_p (0, FLAGS_REG)
&& ((TARGET_PENTIUM
&& (GET_CODE (operands[0]) != MEM
|| !memory_displacement_operand (operands[0], HImode)))
@@ -9710,7 +9714,7 @@
[(set (match_operand:QI 0 "nonimmediate_operand" "=rm")
(not:QI (match_operand:QI 1 "nonimmediate_operand" "0")))]
"!optimize_size
- && reg_dead_p (insn, gen_rtx_REG (CCmode, FLAGS_REG))
+ && peep2_regno_dead_p (0, FLAGS_REG)
&& ((TARGET_PENTIUM
&& (GET_CODE (operands[0]) != MEM
|| !memory_displacement_operand (operands[0], QImode)))
@@ -9873,7 +9877,7 @@
|| GET_MODE (operands[0]) == HImode
|| GET_MODE (operands[0]) == SImode)
&& (! TARGET_USE_MOV0 || optimize_size)
- && reg_dead_p (insn, gen_rtx_REG (CCmode, FLAGS_REG))"
+ && peep2_regno_dead_p (0, FLAGS_REG)"
[(parallel [(set (match_dup 0) (const_int 0))
(clobber (reg:CC 17))])]
"operands[0] = gen_rtx_REG (SImode, true_regnum (operands[0]));")
@@ -9885,7 +9889,7 @@
"(GET_MODE (operands[0]) == HImode
|| GET_MODE (operands[0]) == SImode)
&& (optimize_size || TARGET_PENTIUM)
- && reg_dead_p (insn, gen_rtx_REG (CCmode, FLAGS_REG))"
+ && peep2_regno_dead_p (0, FLAGS_REG)"
[(parallel [(set (match_dup 0) (const_int -1))
(clobber (reg:CC 17))])]
"operands[0] = gen_rtx_REG (SImode, true_regnum (operands[0]));")
@@ -9896,7 +9900,7 @@
[(set (match_operand:SI 0 "register_operand" "")
(plus:SI (match_dup 0)
(match_operand:SI 1 "nonmemory_operand" "")))]
- "reg_dead_p (insn, gen_rtx_REG (CCmode, FLAGS_REG))"
+ "peep2_regno_dead_p (0, FLAGS_REG)"
[(parallel [(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 1)))
(clobber (reg:CC 17))])]
"")
@@ -9905,7 +9909,8 @@
[(set (match_operand:SI 0 "register_operand" "")
(mult:SI (match_dup 0)
(match_operand:SI 1 "immediate_operand" "")))]
- "reg_dead_p (insn, gen_rtx_REG (CCmode, FLAGS_REG))"
+ "exact_log2 (INTVAL (operands[1])) >= 0
+ && peep2_regno_dead_p (0, FLAGS_REG)"
[(parallel [(set (match_dup 0) (ashift:SI (match_dup 0) (match_dup 2)))
(clobber (reg:CC 17))])]
"operands[2] = GEN_INT (exact_log2 (INTVAL (operands[1])));")