]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[arm] Add missing predicated-short-it variants to cmp_and and cmp_ior patterns
authorRichard Earnshaw <rearnsha@arm.com>
Fri, 6 Sep 2019 09:58:14 +0000 (09:58 +0000)
committerRichard Earnshaw <rearnsha@gcc.gnu.org>
Fri, 6 Sep 2019 09:58:14 +0000 (09:58 +0000)
The cmp_and and cmp_ior patterns were missing a couple of short-it
variants for thumb2, where the comparisons are all using registers
some of which were HI_REGS.

* config/arm/arm.md (cmp_and): Add short-it variant for thumb2 with
high regs.
(cmp_ior): Likewise.

From-SVN: r275453

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

index f4766bd7ac8b4cba790dfb6d56dd3968206f119c..65d9f43db7fe003f0eae401398b2a0b58e9f7fff 100644 (file)
@@ -1,3 +1,9 @@
+2019-09-06  Richard Earnshaw  <rearnsha@arm.com>
+
+       * config/arm/arm.md (cmp_and): Add short-it variant for thumb2 with
+       high regs.
+       (cmp_ior): Likewise.
+
 2019-09-06  Martin Liska  <mliska@suse.cz>
 
        * doc/match-and-simplify.texi: Separate tuples with ;.
index e49e0d579c92e0b9452ac1cb8a41035fcd7fff4c..e23683114087f6cc9ee78376529da97cfe31d3a6 100644 (file)
        (compare
         (and:SI
          (match_operator 4 "arm_comparison_operator"
-          [(match_operand:SI 0 "s_register_operand" 
-               "l,l,l,r,r,r,r,r,r")
-           (match_operand:SI 1 "arm_add_operand" 
-               "lPy,lPy,lPy,rI,L,rI,L,rI,L")])
+          [(match_operand:SI 0 "s_register_operand"
+               "l,l,l,r,r,r,r,r,r,r")
+           (match_operand:SI 1 "arm_add_operand"
+               "lPy,lPy,lPy,rI,L,r,rI,L,rI,L")])
          (match_operator:SI 5 "arm_comparison_operator"
-          [(match_operand:SI 2 "s_register_operand" 
-               "l,r,r,l,l,r,r,r,r")
-           (match_operand:SI 3 "arm_add_operand" 
-               "lPy,rI,L,lPy,lPy,rI,rI,L,L")]))
+          [(match_operand:SI 2 "s_register_operand"
+               "l,r,r,l,l,r,r,r,r,r")
+           (match_operand:SI 3 "arm_add_operand"
+               "lPy,rI,L,lPy,lPy,r,rI,rI,L,L")]))
         (const_int 0)))]
   "TARGET_32BIT"
   "*
       \"it\\t%d5\",
       \"it\\t%d4\"
     };
-    static const int cmp_idx[9] = {CMP_CMP, CMP_CMP, CMP_CMN,
-                                   CMP_CMP, CMN_CMP, CMP_CMP,
-                                   CMN_CMP, CMP_CMN, CMN_CMN};
+    static const int cmp_idx[] = {CMP_CMP, CMP_CMP, CMP_CMN,
+                                  CMP_CMP, CMN_CMP, CMP_CMP,
+                                  CMP_CMP, CMN_CMP, CMP_CMN,
+                                 CMN_CMN};
     int swap =
       comparison_dominates_p (GET_CODE (operands[5]), GET_CODE (operands[4]));
 
   }"
   [(set_attr "conds" "set")
    (set_attr "predicable" "no")
-   (set_attr "arch" "t2,t2,t2,t2,t2,any,any,any,any")
-   (set_attr "enabled_for_short_it" "yes,no,no,no,no,no,no,no,no")
+   (set_attr "arch" "t2,t2,t2,t2,t2,t2,any,any,any,any")
+   (set_attr "enabled_for_short_it" "yes,no,no,no,no,yes,no,no,no,no")
    (set_attr_alternative "length"
       [(const_int 6)
        (const_int 8)
        (const_int 8)
        (const_int 8)
        (const_int 8)
+       (const_int 6)
        (if_then_else (eq_attr "is_thumb" "no")
            (const_int 8)
            (const_int 10))
         (ior:SI
          (match_operator 4 "arm_comparison_operator"
           [(match_operand:SI 0 "s_register_operand"
-               "l,l,l,r,r,r,r,r,r")
+               "l,l,l,r,r,r,r,r,r,r")
            (match_operand:SI 1 "arm_add_operand"
-               "lPy,lPy,lPy,rI,L,rI,L,rI,L")])
+               "lPy,lPy,lPy,rI,L,r,rI,L,rI,L")])
          (match_operator:SI 5 "arm_comparison_operator"
           [(match_operand:SI 2 "s_register_operand"
-               "l,r,r,l,l,r,r,r,r")
+               "l,r,r,l,l,r,r,r,r,r")
            (match_operand:SI 3 "arm_add_operand"
-               "lPy,rI,L,lPy,lPy,rI,rI,L,L")]))
+               "lPy,rI,L,lPy,lPy,r,rI,rI,L,L")]))
         (const_int 0)))]
   "TARGET_32BIT"
   "*
       \"it\\t%D4\",
       \"it\\t%D5\"
     };
-    static const int cmp_idx[9] = {CMP_CMP, CMP_CMP, CMP_CMN,
-                                   CMP_CMP, CMN_CMP, CMP_CMP,
-                                   CMN_CMP, CMP_CMN, CMN_CMN};
+    static const int cmp_idx[] = {CMP_CMP, CMP_CMP, CMP_CMN,
+                                  CMP_CMP, CMN_CMP, CMP_CMP,
+                                 CMP_CMP, CMN_CMP, CMP_CMN,
+                                 CMN_CMN};
     int swap =
       comparison_dominates_p (GET_CODE (operands[5]), GET_CODE (operands[4]));
 
   }
   "
   [(set_attr "conds" "set")
-   (set_attr "arch" "t2,t2,t2,t2,t2,any,any,any,any")
-   (set_attr "enabled_for_short_it" "yes,no,no,no,no,no,no,no,no")
+   (set_attr "arch" "t2,t2,t2,t2,t2,t2,any,any,any,any")
+   (set_attr "enabled_for_short_it" "yes,no,no,no,no,yes,no,no,no,no")
    (set_attr_alternative "length"
       [(const_int 6)
        (const_int 8)
        (const_int 8)
        (const_int 8)
        (const_int 8)
+       (const_int 6)
        (if_then_else (eq_attr "is_thumb" "no")
            (const_int 8)
            (const_int 10))