Commit 45cfa18d by Michael Meissner Committed by Michael Meissner

linux64.h (OPTION_TARGET_CPU_DEFAULT): Do not redefine to be NULL if the current…

linux64.h (OPTION_TARGET_CPU_DEFAULT): Do not redefine to be NULL if the current bit-size is different from the...

2012-03-08  Michael Meissner  <meissner@the-meissners.org>

	* config/rs6000/linux64.h (OPTION_TARGET_CPU_DEFAULT): Do not
	redefine to be NULL if the current bit-size is different from the
	configured bit-size.

	* config/rs6000/rs6000.c (rs6000_option_override_internal): If the
	cpu is defaulted, use PROCESSOR_DEFAULT and PROCESSOR_DEFAULT64 to
	set the default tuning.  Add asserts to make sure the cpu and tune
	indexes are defined.  Fix tests for cpu/tune index to use >= 0 to
	test whether the index is set, instead of > 0.
	(rs6000_file_start): Do not reset the default cpu if the current
	bit-size is different from the configured bit-size.

From-SVN: r185146
parent d3a26d5d
2012-03-09 Michael Meissner <meissner@linux.vnet.ibm.com>
* config/rs6000/linux64.h (OPTION_TARGET_CPU_DEFAULT): Do not
redefine to be NULL if the current bit-size is different from the
configured bit-size.
* config/rs6000/rs6000.c (rs6000_option_override_internal): If the
cpu is defaulted, use PROCESSOR_DEFAULT and PROCESSOR_DEFAULT64 to
set the default tuning. Add asserts to make sure the cpu and tune
indexes are defined. Fix tests for cpu/tune index to use >= 0 to
test whether the index is set, instead of > 0.
(rs6000_file_start): Do not reset the default cpu if the current
bit-size is different from the configured bit-size.
2012-03-09 Tristan Gingold <gingold@adacore.com> 2012-03-09 Tristan Gingold <gingold@adacore.com>
* config/vms/vms-crtlmap.map: Add comments. * config/vms/vms-crtlmap.map: Add comments.
......
...@@ -159,15 +159,6 @@ extern int dot_symbols; ...@@ -159,15 +159,6 @@ extern int dot_symbols;
} \ } \
while (0) while (0)
#ifdef RS6000_BI_ARCH
#undef OPTION_TARGET_CPU_DEFAULT
#define OPTION_TARGET_CPU_DEFAULT \
(((TARGET_DEFAULT ^ target_flags) & MASK_64BIT) \
? (char *) 0 : TARGET_CPU_DEFAULT)
#endif
#undef ASM_DEFAULT_SPEC #undef ASM_DEFAULT_SPEC
#undef ASM_SPEC #undef ASM_SPEC
#undef LINK_OS_LINUX_SPEC #undef LINK_OS_LINUX_SPEC
......
...@@ -2596,6 +2596,7 @@ static bool ...@@ -2596,6 +2596,7 @@ static bool
rs6000_option_override_internal (bool global_init_p) rs6000_option_override_internal (bool global_init_p)
{ {
bool ret = true; bool ret = true;
bool have_cpu = false;
const char *default_cpu = OPTION_TARGET_CPU_DEFAULT; const char *default_cpu = OPTION_TARGET_CPU_DEFAULT;
int set_masks; int set_masks;
int cpu_index; int cpu_index;
...@@ -2652,43 +2653,55 @@ rs6000_option_override_internal (bool global_init_p) ...@@ -2652,43 +2653,55 @@ rs6000_option_override_internal (bool global_init_p)
/* Don't override by the processor default if given explicitly. */ /* Don't override by the processor default if given explicitly. */
set_masks &= ~target_flags_explicit; set_masks &= ~target_flags_explicit;
/* Identify the processor type. */
if (!default_cpu)
{
if (TARGET_POWERPC64)
default_cpu = "powerpc64";
else if (TARGET_POWERPC)
default_cpu = "powerpc";
}
/* Process the -mcpu=<xxx> and -mtune=<xxx> argument. If the user changed /* Process the -mcpu=<xxx> and -mtune=<xxx> argument. If the user changed
the cpu in a target attribute or pragma, but did not specify a tuning the cpu in a target attribute or pragma, but did not specify a tuning
option, use the cpu for the tuning option rather than the option specified option, use the cpu for the tuning option rather than the option specified
with -mtune on the command line. */ with -mtune on the command line. */
if (rs6000_cpu_index > 0) if (rs6000_cpu_index >= 0)
cpu_index = rs6000_cpu_index; {
else if (main_target_opt != NULL && main_target_opt->x_rs6000_cpu_index > 0) cpu_index = rs6000_cpu_index;
rs6000_cpu_index = cpu_index = main_target_opt->x_rs6000_cpu_index; have_cpu = true;
}
else if (main_target_opt != NULL && main_target_opt->x_rs6000_cpu_index >= 0)
{
rs6000_cpu_index = cpu_index = main_target_opt->x_rs6000_cpu_index;
have_cpu = true;
}
else else
rs6000_cpu_index = cpu_index = rs6000_cpu_name_lookup (default_cpu); {
if (!default_cpu)
default_cpu = (TARGET_POWERPC64 ? "powerpc64" : "powerpc");
rs6000_cpu_index = cpu_index = rs6000_cpu_name_lookup (default_cpu);
}
gcc_assert (cpu_index >= 0);
if (rs6000_tune_index > 0) target_flags &= ~set_masks;
target_flags |= (processor_target_table[cpu_index].target_enable
& set_masks);
if (rs6000_tune_index >= 0)
tune_index = rs6000_tune_index; tune_index = rs6000_tune_index;
else else if (have_cpu)
rs6000_tune_index = tune_index = cpu_index; rs6000_tune_index = tune_index = cpu_index;
else
if (cpu_index >= 0)
{ {
target_flags &= ~set_masks; size_t i;
target_flags |= (processor_target_table[cpu_index].target_enable enum processor_type tune_proc
& set_masks); = (TARGET_POWERPC64 ? PROCESSOR_DEFAULT64 : PROCESSOR_DEFAULT);
tune_index = -1;
for (i = 0; i < ARRAY_SIZE (processor_target_table); i++)
if (processor_target_table[i].processor == tune_proc)
{
rs6000_tune_index = tune_index = i;
break;
}
} }
rs6000_cpu = ((tune_index >= 0) gcc_assert (tune_index >= 0);
? processor_target_table[tune_index].processor rs6000_cpu = processor_target_table[tune_index].processor;
: (TARGET_POWERPC64
? PROCESSOR_DEFAULT64
: PROCESSOR_DEFAULT));
if (rs6000_cpu == PROCESSOR_PPCE300C2 || rs6000_cpu == PROCESSOR_PPCE300C3 if (rs6000_cpu == PROCESSOR_PPCE300C2 || rs6000_cpu == PROCESSOR_PPCE300C3
|| rs6000_cpu == PROCESSOR_PPCE500MC || rs6000_cpu == PROCESSOR_PPCE500MC64) || rs6000_cpu == PROCESSOR_PPCE500MC || rs6000_cpu == PROCESSOR_PPCE500MC64)
...@@ -4023,11 +4036,6 @@ rs6000_file_start (void) ...@@ -4023,11 +4036,6 @@ rs6000_file_start (void)
default_file_start (); default_file_start ();
#ifdef TARGET_BI_ARCH
if ((TARGET_DEFAULT ^ target_flags) & MASK_64BIT)
rs6000_default_cpu = 0;
#endif
if (flag_verbose_asm) if (flag_verbose_asm)
{ {
sprintf (buffer, "\n%s rs6000/powerpc options:", ASM_COMMENT_START); sprintf (buffer, "\n%s rs6000/powerpc options:", ASM_COMMENT_START);
......
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