arm.md (minmax_arithsi_non_canon): Emit canonical RTL form when subtracting a constant.
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>
Thu, 1 Aug 2013 15:02:19 +0000 (15:02 +0000)
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>
Thu, 1 Aug 2013 15:02:19 +0000 (15:02 +0000)
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

gcc/ChangeLog
gcc/config/arm/arm.md

index 5480545..d60161e 100644 (file)
@@ -1,5 +1,10 @@
 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)):
        Generate canonical plus rtx with negated immediate instead of minus
        where appropriate.
index 322aa20..45e9ada 100644 (file)
                              (match_dup 2))))
    (cond_exec (match_op_dup 5 [(reg:CC CC_REGNUM) (const_int 0)])
               (set (match_dup 0)
-                   (minus:SI (match_dup 1)
-                             (match_dup 3))))]
+                   (match_dup 6)))]
   {
   enum machine_mode mode = SELECT_CC_MODE (GET_CODE (operands[1]),
                                            operands[2], operands[3]);
   else
     rc = reverse_condition (rc);
   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 "length")