aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1995-01-20 17:11:01 -0800
committerJim Wilson <wilson@gcc.gnu.org>1995-01-20 17:11:01 -0800
commita7771f7854f45f306657fd0d72833ee6a78c4afc (patch)
tree164b67b8edf829cb8c82c74b4064e357cad2bfcf /gcc
parent50d1b7a1166c5208498a8884229c8c3a08e3eb05 (diff)
downloadgcc-a7771f7854f45f306657fd0d72833ee6a78c4afc.zip
gcc-a7771f7854f45f306657fd0d72833ee6a78c4afc.tar.gz
gcc-a7771f7854f45f306657fd0d72833ee6a78c4afc.tar.bz2
(multcosts): Do not compute cost of constant power-of-two multiplies as if they were shifts.
(multcosts): Do not compute cost of constant power-of-two multiplies as if they were shifts. Reduce multiply cost from 5 to 3. Delete variable insn_cost. From-SVN: r8777
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/sh/sh.c28
1 files changed, 5 insertions, 23 deletions
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 4b76a60..ce64a4e 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -1537,38 +1537,20 @@ int
multcosts (RTX)
rtx RTX;
{
- /* If mult by a power of 2 then work out how we'd shift to make it */
- int insn_cost = 0;
-
- if (GET_CODE (XEXP (RTX, 1)) == CONST_INT)
- {
- int i = exact_log2 (INTVAL (XEXP (RTX, 1)));
- if (i >= 0)
- insn_cost = howshift (i);
- else
- insn_cost = 100000;
- }
if (TARGET_SH2)
{
/* We have a mul insn, so we can never take more than the mul and the
- read of the mac reg, but count more because of the latency and extra reg
- usage */
+ read of the mac reg, but count more because of the latency and extra
+ reg usage */
if (TARGET_SMALLCODE)
return 2;
- if (insn_cost > 5)
- return 5;
- return insn_cost;
+ return 3;
}
- /* If we we're aiming at small code, then just count the number of
+ /* If we're aiming at small code, then just count the number of
insns in a multiply call sequence */
-
if (TARGET_SMALLCODE)
- {
- if (insn_cost > 6)
- return 6;
- return insn_cost;
- }
+ return 6;
/* Otherwise count all the insns in the routine we'd be calling too */
return 20;