]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* config/arm/arm.c (arm_rtx_costs_1): Use power_of_two_operand
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 22 Apr 2009 16:52:17 +0000 (16:52 +0000)
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 22 Apr 2009 16:52:17 +0000 (16:52 +0000)
where appropriate.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146602 138bc75d-0d04-0410-961f-82ee72b054a4

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

index ec64ac249204fc10042e60995829691bb6d73591..14d6774a0e1ff21e88719bff0efb37e8f5eb521f 100644 (file)
@@ -1,3 +1,8 @@
+2009-04-22  Kazu Hirata  <kazu@codesourcery.com>
+
+       * config/arm/arm.c (arm_rtx_costs_1): Use power_of_two_operand
+       where appropriate.
+
 2009-04-22  Kazu Hirata  <kazu@codesourcery.com>
 
        * config/arm/arm.c (arm_size_rtx_costs): Treat a PLUS with a shift
index 547e7602f368eaa3aee4790517ed7efa337a0b47..38ab142caccfe18013646411234e7cbd3a895489 100644 (file)
@@ -5141,9 +5141,7 @@ arm_rtx_costs_1 (rtx x, enum rtx_code outer, int* total, bool speed)
 
       /* A shift as a part of RSB costs no more than RSB itself.  */
       if (GET_CODE (XEXP (x, 0)) == MULT
-         && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT
-         && ((INTVAL (XEXP (XEXP (x, 0), 1))
-              & (INTVAL (XEXP (XEXP (x, 0), 1)) - 1)) == 0))
+         && power_of_two_operand (XEXP (XEXP (x, 0), 1), SImode))
        {
          *total += rtx_cost (XEXP (XEXP (x, 0), 0), code, speed);
          *total += rtx_cost (XEXP (x, 1), code, speed);
@@ -5151,9 +5149,7 @@ arm_rtx_costs_1 (rtx x, enum rtx_code outer, int* total, bool speed)
        }
 
       if (subcode == MULT
-         && GET_CODE (XEXP (XEXP (x, 1), 1)) == CONST_INT
-         && ((INTVAL (XEXP (XEXP (x, 1), 1)) &
-              (INTVAL (XEXP (XEXP (x, 1), 1)) - 1)) == 0))
+         && power_of_two_operand (XEXP (XEXP (x, 1), 1), SImode))
        {
          *total += rtx_cost (XEXP (x, 0), code, speed);
          *total += rtx_cost (XEXP (XEXP (x, 1), 0), subcode, speed);
@@ -5189,9 +5185,7 @@ arm_rtx_costs_1 (rtx x, enum rtx_code outer, int* total, bool speed)
         multiplication by a power of two, so that we fall down into
         the code below.  */
       if (GET_CODE (XEXP (x, 0)) == MULT
-         && ! (GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT
-               && ((INTVAL (XEXP (XEXP (x, 0), 1)) &
-                    (INTVAL (XEXP (XEXP (x, 0), 1)) - 1)) == 0)))
+         && !power_of_two_operand (XEXP (XEXP (x, 0), 1), SImode))
        {
          /* The cost comes from the cost of the multiply.  */
          return false;
@@ -5274,9 +5268,7 @@ arm_rtx_costs_1 (rtx x, enum rtx_code outer, int* total, bool speed)
        }
 
       if (subcode == MULT
-         && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT
-         && ((INTVAL (XEXP (XEXP (x, 0), 1)) &
-              (INTVAL (XEXP (XEXP (x, 0), 1)) - 1)) == 0))
+         && power_of_two_operand (XEXP (XEXP (x, 0), 1), SImode))
        {
          *total += rtx_cost (XEXP (x, 1), code, speed);
          *total += rtx_cost (XEXP (XEXP (x, 0), 0), subcode, speed);
@@ -5333,9 +5325,7 @@ arm_rtx_costs_1 (rtx x, enum rtx_code outer, int* total, bool speed)
              || subcode == LSHIFTRT
              || subcode == ROTATE || subcode == ROTATERT
              || (subcode == MULT
-                 && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT
-                 && ((INTVAL (XEXP (XEXP (x, 0), 1)) & 
-                      (INTVAL (XEXP (XEXP (x, 0), 1)) - 1)) == 0)))
+                 && power_of_two_operand (XEXP (XEXP (x, 0), 1), SImode)))
            {
              *total += rtx_cost (XEXP (XEXP (x, 0), 0), subcode, speed);
              /* Register shifts cost an extra cycle.  */
@@ -5443,9 +5433,7 @@ arm_rtx_costs_1 (rtx x, enum rtx_code outer, int* total, bool speed)
        }
 
       if (subcode == MULT
-         && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT
-         && ((INTVAL (XEXP (XEXP (x, 0), 1)) &
-              (INTVAL (XEXP (XEXP (x, 0), 1)) - 1)) == 0))
+         && power_of_two_operand (XEXP (XEXP (x, 0), 1), SImode))
        {
          *total += rtx_cost (XEXP (x, 1), code, speed);
          *total += rtx_cost (XEXP (XEXP (x, 0), 0), subcode, speed);