Commit ce852f9c by Kyrylo Tkachov Committed by Kyrylo Tkachov

arm.md (minmax_arithsi_non_canon): Emit canonical RTL form when subtracting a constant.

2013-08-01  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	* config/arm/arm.md (minmax_arithsi_non_canon): Emit canonical RTL form
	when subtracting a constant.

From-SVN: r201412
parent c743b246
2013-08-01 Kyrylo Tkachov <kyrylo.tkachov@arm.com> 2013-08-01 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/arm/arm.md (minmax_arithsi_non_canon): Emit canonical RTL form
when subtracting a constant.
2013-08-01 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/arm/arm.md (peepholes for eq (reg1) (reg2/imm)): * config/arm/arm.md (peepholes for eq (reg1) (reg2/imm)):
Generate canonical plus rtx with negated immediate instead of minus Generate canonical plus rtx with negated immediate instead of minus
where appropriate. where appropriate.
......
...@@ -3717,8 +3717,7 @@ ...@@ -3717,8 +3717,7 @@
(match_dup 2)))) (match_dup 2))))
(cond_exec (match_op_dup 5 [(reg:CC CC_REGNUM) (const_int 0)]) (cond_exec (match_op_dup 5 [(reg:CC CC_REGNUM) (const_int 0)])
(set (match_dup 0) (set (match_dup 0)
(minus:SI (match_dup 1) (match_dup 6)))]
(match_dup 3))))]
{ {
enum machine_mode mode = SELECT_CC_MODE (GET_CODE (operands[1]), enum machine_mode mode = SELECT_CC_MODE (GET_CODE (operands[1]),
operands[2], operands[3]); operands[2], operands[3]);
...@@ -3731,6 +3730,10 @@ ...@@ -3731,6 +3730,10 @@
else else
rc = reverse_condition (rc); rc = reverse_condition (rc);
operands[5] = gen_rtx_fmt_ee (rc, SImode, operands[2], operands[3]); operands[5] = gen_rtx_fmt_ee (rc, SImode, operands[2], operands[3]);
if (CONST_INT_P (operands[3]))
operands[6] = plus_constant (SImode, operands[1], -INTVAL (operands[3]));
else
operands[6] = gen_rtx_MINUS (SImode, operands[1], operands[3]);
} }
[(set_attr "conds" "clob") [(set_attr "conds" "clob")
(set (attr "length") (set (attr "length")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment