(define_insn "*zero_extendqihi2_movzbw"
[(set (match_operand:HI 0 "register_operand" "=r")
(zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "qm")))]
- "!TARGET_ZERO_EXTEND_WITH_AND || optimize_size"
+ "(!TARGET_ZERO_EXTEND_WITH_AND || optimize_size) && reload_completed"
"movz{bw|x}\\t{%1, %0|%0, %1}"
[(set_attr "type" "imovx")])
]
(const_string "alu")))])
+;; Convert lea to the lea pattern to avoid flags dependency.
+(define_split
+ [(set (match_operand:SI 0 "register_operand" "")
+ (plus:SI (match_operand:SI 1 "register_operand" "")
+ (match_operand:SI 2 "nonmemory_operand" "")))
+ (clobber (reg:CC 17))]
+ "reload_completed
+ && true_regnum (operands[0]) != true_regnum (operands[1])"
+ [(set (match_dup 0)
+ (plus:SI (match_dup 1)
+ (match_dup 2)))]
+ "")
+
(define_insn "*addsi_2"
[(set (reg:CCNO 17)
(compare:CCNO
]
(const_string "ishift")))])
+;; Convert lea to the lea pattern to avoid flags dependency.
+(define_split
+ [(set (match_operand:SI 0 "register_operand" "")
+ (ashift:SI (match_operand:SI 1 "register_operand" "")
+ (match_operand:QI 2 "immediate_operand" "")))
+ (clobber (reg:CC 17))]
+ "reload_completed
+ && true_regnum (operands[0]) != true_regnum (operands[1])"
+ [(set (match_dup 0)
+ (mult:SI (match_dup 1)
+ (match_dup 2)))]
+ "operands[2] = GEN_INT (1 << INTVAL (operands[2]));")
+
(define_insn "*ashlsi3_cmpno"
[(set (reg:CCNO 17)
(compare:CCNO
[(parallel [(set (match_dup 0) (const_int -1))
(clobber (reg:CC 17))])]
"operands[0] = gen_rtx_REG (SImode, true_regnum (operands[0]));")
+
+;; Attempt to convert simple leas to adds. These can be created by
+;; move expanders.
+(define_peephole2
+ [(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))"
+ [(parallel [(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 1)))
+ (clobber (reg:CC 17))])]
+ "")
+
+(define_peephole2
+ [(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))"
+ [(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])));")
\f
;; Call-value patterns last so that the wildcard operand does not
;; disrupt insn-recog's switch tables.