[RFC] POWER8 default for PPC64LE
David Edelsohn
dje.gcc@gmail.com
Wed Jan 21 20:13:00 GMT 2015
On Wed, Jan 21, 2015 at 6:22 AM, Andreas Schwab <schwab@suse.de> wrote:
> David Edelsohn <dje.gcc@gmail.com> writes:
>
>> Index: gcc/config/rs6000/rs6000.c
>> ===================================================================
>> --- gcc/config/rs6000/rs6000.c (revision 219747)
>> +++ gcc/config/rs6000/rs6000.c (working copy)
>> @@ -5072,6 +5072,28 @@ rs6000_file_start (void)
>> putc ('\n', file);
>> }
>>
>> +#ifdef USING_ELFOS_H
>> + if (rs6000_default_cpu == 0 || rs6000_default_cpu[0] == '\0'
>> + || !global_options_set.x_rs6000_cpu_index)
>> + {
>> + fputs ("\t.machine ", asm_out_file);
>> + if ((TARGET_DEFAULT & OPTION_MASK_DIRECT_MOVE) != 0)
>> + fputs ("power8\n", asm_out_file);
>> + else if ((TARGET_DEFAULT & OPTION_MASK_POPCNTD) != 0)
>> + fputs ("power7\n", asm_out_file);
>> + else if ((TARGET_DEFAULT & OPTION_MASK_CMPB) != 0)
>> + fputs ("power6\n", asm_out_file);
>> + else if ((TARGET_DEFAULT & OPTION_MASK_POPCNTB) != 0)
>> + fputs ("power5\n", asm_out_file);
>> + else if ((TARGET_DEFAULT & OPTION_MASK_MFCRF) != 0)
>> + fputs ("power4\n", asm_out_file);
>> + else if ((TARGET_DEFAULT & OPTION_MASK_POWERPC64) != 0)
>> + fputs ("ppc64\n", asm_out_file);
>> + else
>> + fputs ("ppc\n", asm_out_file);
>> + }
>> +#endif
>> +
>
> This is wrong, it doesn't account for -m64 on a --with-cpu=default32
> compiler.
--with-cpu=default32 does not define TARGET_CPU_DEFAULT and
rs6000_default_cpu, so rs6000_file_start does not skip the new block
of code.
-m64 implicitly sets -mpowerpc64.
Error: junk at end of line: `1'
often is a problem with MRCRF (POWER4), which should not be enabled by
-m64 and -mpower64.
I tried configuring and building with --with-cpu=default32 on gcc110
running Fedora 18. I did not encounter the failure in stage 1. I
encountered a failure later in stage 2 because some 32 bit libraries
are not installed (which confirms that it's building PPC32).
Looking at the OpenSUSE Factor log in more detail, I see that the
configuration uses
--with-cpu=default32 --with-cpu-64=power4
The second option is the problem. rs6000_start_file() probably should
use rs6000_isa_flags and not TARGET_DEFAULT.
Testing.
- David
More information about the Gcc-patches
mailing list