Commit 2ef98fb9 by Nick Clifton

rl78.c (rl78_rtx_costs): Improve cost estimates for multiplication.

	* config/rl78/rl78.c (rl78_rtx_costs): Improve cost estimates for
	multiplication.

From-SVN: r228521
parent 9ce29eb0
2015-10-06 Nick Clifton <nickc@redhat.com>
* config/rl78/rl78.c (rl78_rtx_costs): Improve cost estimates for
multiplication.
2015-10-06 Venkataramanan Kumar <Venkataramanan.kumar@amd.com> 2015-10-06 Venkataramanan Kumar <Venkataramanan.kumar@amd.com>
* config.gcc (i[34567]86-*-linux* | ...): Add znver1. * config.gcc (i[34567]86-*-linux* | ...): Add znver1.
...@@ -4165,21 +4165,42 @@ rl78_rtx_costs (rtx x, ...@@ -4165,21 +4165,42 @@ rl78_rtx_costs (rtx x,
return true; return true;
} }
if (mode == HImode)
{
if (code == MULT && ! speed)
{
* total = COSTS_N_INSNS (8);
return true;
}
return false;
}
if (mode == SImode) if (mode == SImode)
{ {
switch (code) switch (code)
{ {
case MULT: case MULT:
if (RL78_MUL_G14) if (! speed)
/* If we are compiling for space then we do not want to use the
inline SImode multiplication patterns or shift sequences.
The cost is not set to 1 or 5 however as we have to allow for
the possibility that we might be converting a leaf function
into a non-leaf function. (There is no way to tell here).
A value of 13 seems to be a reasonable compromise for the
moment. */
* total = COSTS_N_INSNS (13);
else if (RL78_MUL_G14)
*total = COSTS_N_INSNS (14); *total = COSTS_N_INSNS (14);
else if (RL78_MUL_G13) else if (RL78_MUL_G13)
*total = COSTS_N_INSNS (29); *total = COSTS_N_INSNS (29);
else else
*total = COSTS_N_INSNS (500); *total = COSTS_N_INSNS (500);
return true; return true;
case PLUS: case PLUS:
*total = COSTS_N_INSNS (8); *total = COSTS_N_INSNS (8);
return true; return true;
case ASHIFT: case ASHIFT:
case ASHIFTRT: case ASHIFTRT:
case LSHIFTRT: case LSHIFTRT:
...@@ -4205,6 +4226,9 @@ rl78_rtx_costs (rtx x, ...@@ -4205,6 +4226,9 @@ rl78_rtx_costs (rtx x,
else else
*total = COSTS_N_INSNS (10+4*16); *total = COSTS_N_INSNS (10+4*16);
return true; return true;
default:
break;
} }
} }
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment