aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Hirata <kazu@codesourcery.com>2009-04-14 17:30:37 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2009-04-14 17:30:37 +0000
commitb32f6fffc949f0173fc14ed5c854e1820835150d (patch)
tree0400cc51e330553be97605529ac85da638f55ed7
parentf9b20c620aac52350d4de6956878f791df10ba38 (diff)
downloadgcc-b32f6fffc949f0173fc14ed5c854e1820835150d.zip
gcc-b32f6fffc949f0173fc14ed5c854e1820835150d.tar.gz
gcc-b32f6fffc949f0173fc14ed5c854e1820835150d.tar.bz2
arm.c (arm_rtx_costs_1): Treat a minus with a shift the same as a minus without a shift.
* config/arm/arm.c (arm_rtx_costs_1): Treat a minus with a shift the same as a minus without a shift. From-SVN: r146055
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/arm/arm.c11
2 files changed, 16 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d637606..7712ee7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2009-04-14 Kazu Hirata <kazu@codesourcery.com>
+
+ * config/arm/arm.c (arm_rtx_costs_1): Treat a minus with a shift
+ the same as a minus without a shift.
+
2009-04-14 Nick Clifton <nickc@redhat.com>
* config/stormy16/stormy16.md (ineqbranch_1): Do not assume that
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index e24f3c7..9bd9624 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -5139,6 +5139,17 @@ arm_rtx_costs_1 (rtx x, enum rtx_code outer, int* total, bool speed)
return true;
}
+ /* 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))
+ {
+ *total += rtx_cost (XEXP (XEXP (x, 0), 0), code, speed);
+ *total += rtx_cost (XEXP (x, 1), code, speed);
+ return true;
+ }
+
if (subcode == MULT
&& GET_CODE (XEXP (XEXP (x, 1), 1)) == CONST_INT
&& ((INTVAL (XEXP (XEXP (x, 1), 1)) &