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.
(case ${target}): Add znver1. (case ${target}): Add znver1.
* config/i386/cpuid.h(bit_CLZERO): Define. * config/i386/cpuid.h(bit_CLZERO): Define.
* config/i386/driver-i386.c: (host_detect_local_cpu): Let * config/i386/driver-i386.c: (host_detect_local_cpu): Let
-march=native recognize znver1 processors. -march=native recognize znver1 processors.
* config/i386/i386-c.c (ix86_target_macros_internal): Add * config/i386/i386-c.c (ix86_target_macros_internal): Add
znver1, clzero def_and_undef. znver1, clzero def_and_undef.
* config/i386/i386.c (struct processor_costs znver1_cost): New. * config/i386/i386.c (struct processor_costs znver1_cost): New.
(m_znver1): New definition. (m_znver1): New definition.
(m_AMD_MULTIPLE): Includes m_znver1. (m_AMD_MULTIPLE): Includes m_znver1.
...@@ -17,10 +22,10 @@ ...@@ -17,10 +22,10 @@
(PTA_CLZERO) : New definition. (PTA_CLZERO) : New definition.
(ix86_option_override_internal): Handle new clzerooption. (ix86_option_override_internal): Handle new clzerooption.
(ix86_issue_rate): Add znver1. (ix86_issue_rate): Add znver1.
(ix86_adjust_cost): Add znver1. (ix86_adjust_cost): Add znver1.
(ia32_multipass_dfa_lookahead): Add znver1. (ia32_multipass_dfa_lookahead): Add znver1.
(has_dispatch): Add znver1. (has_dispatch): Add znver1.
* config/i386/i386.h (TARGET_znver1): New definition. * config/i386/i386.h (TARGET_znver1): New definition.
(TARGET_CLZERO): Define. (TARGET_CLZERO): Define.
(TARGET_CLZERO_P): Define. (TARGET_CLZERO_P): Define.
(struct ix86_size_cost): Add TARGET_ZNVER1. (struct ix86_size_cost): Add TARGET_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