arm: Use arm_cmpdi_unsigned for thumb2 as well
authorRichard Henderson <rth@redhat.com>
Wed, 21 Dec 2011 00:34:09 +0000 (16:34 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Wed, 21 Dec 2011 00:34:09 +0000 (16:34 -0800)
This changes code generation from "eors; eors; orrs" (which ranges
from 6 to 12 bytes and requires three scratch registers), to
"cmp; it; cmp" (which is always 6 bytes for register inputs and
requires no scratch registers).

        * config/arm/arm.md (*arm_cmpdi_unsigned): Enable for thumb2.
        * config/arm/arm.c (arm_select_cc_mode): Use it.

From-SVN: r182561

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

index 4b4d10fc5389875a18e45d902953e745500d4d66..f5ec754649bc1e72754f37dad0c2fd00c0b998fc 100644 (file)
@@ -1,3 +1,8 @@
+2011-12-20  Richard Henderson  <rth@redhat.com>
+
+       * config/arm/arm.md (*arm_cmpdi_unsigned): Enable for thumb2.
+       * config/arm/arm.c (arm_select_cc_mode): Use it.
+
 2011-12-20  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * tree-ssa-math-opts.c (convert_plusminus_to_widen): Restrict
index b6d619ee7386a7155ae7bce7d239e1ea9bd7baf6..b682a9f0d9df80eddc39aec1a8346ac1643d3aed 100644 (file)
@@ -11672,7 +11672,7 @@ arm_select_cc_mode (enum rtx_code op, rtx x, rtx y)
            return CC_Zmode;
 
          /* We can do an equality test in three Thumb instructions.  */
-         if (!TARGET_ARM)
+         if (!TARGET_32BIT)
            return CC_Zmode;
 
          /* FALLTHROUGH */
@@ -11684,7 +11684,7 @@ arm_select_cc_mode (enum rtx_code op, rtx x, rtx y)
          /* DImode unsigned comparisons can be implemented by cmp +
             cmpeq without a scratch register.  Not worth doing in
             Thumb-2.  */
-         if (TARGET_ARM)
+         if (TARGET_32BIT)
            return CC_CZmode;
 
          /* FALLTHROUGH */
index 1b2d9d9b4b4be0186a78047bbb375cf79f79c280..a5b1df6dada7884d6b856c24ea5f5a796a52799f 100644 (file)
   [(set (reg:CC_CZ CC_REGNUM)
        (compare:CC_CZ (match_operand:DI 0 "s_register_operand" "r")
                       (match_operand:DI 1 "arm_di_operand"     "rDi")))]
-  "TARGET_ARM"
-  "cmp%?\\t%R0, %R1\;cmpeq\\t%Q0, %Q1"
+  "TARGET_32BIT"
+  "cmp\\t%R0, %R1\;it eq\;cmpeq\\t%Q0, %Q1"
   [(set_attr "conds" "set")
    (set_attr "length" "8")]
 )