]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[AArch64] Handle compare of zero_extract form of TST-immediate in rtx costs
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>
Fri, 15 Jan 2016 17:29:16 +0000 (17:29 +0000)
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>
Fri, 15 Jan 2016 17:29:16 +0000 (17:29 +0000)
* config/aarch64/aarch64.c (aarch64_rtx_costs, COMPARE case):
Handle COMPARE of ZERO_EXTRACT against zero form of TST-immediate.

From-SVN: r232441

gcc/ChangeLog
gcc/config/aarch64/aarch64.c

index 371ec82a541008de435fbec75f262cba7efcb84a..edfc0b4a46e4e6c57a27f74bfdd8d3d6de30bc29 100644 (file)
@@ -1,3 +1,8 @@
+2016-01-15  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
+
+       * config/aarch64/aarch64.c (aarch64_rtx_costs, COMPARE case):
+       Handle COMPARE of ZERO_EXTRACT against zero form of TST-immediate.
+
 2016-01-15  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        * config/aarch64/aarch64.c (aarch64_process_one_target_attr): Return
index cb57fe2bb8c507571e08810f8708ebb42a744204..fee917f135b7e379f203c5cd8583c7f6b5c4ec27 100644 (file)
@@ -6490,6 +6490,23 @@ aarch64_rtx_costs (rtx x, machine_mode mode, int outer ATTRIBUTE_UNUSED,
               goto cost_minus;
             }
 
+         if (GET_CODE (op0) == ZERO_EXTRACT && op1 == const0_rtx
+             && GET_MODE (x) == CC_NZmode && CONST_INT_P (XEXP (op0, 1))
+             && CONST_INT_P (XEXP (op0, 2)))
+           {
+             /* COMPARE of ZERO_EXTRACT form of TST-immediate.
+                Handle it here directly rather than going to cost_logic
+                since we know the immediate generated for the TST is valid
+                so we can avoid creating an intermediate rtx for it only
+                for costing purposes.  */
+             if (speed)
+               *cost += extra_cost->alu.logical;
+
+             *cost += rtx_cost (XEXP (op0, 0), GET_MODE (op0),
+                                ZERO_EXTRACT, 0, speed);
+             return true;
+           }
+
           if (GET_CODE (op1) == NEG)
             {
              /* CMN.  */