This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, rs6000] Fix PR target/63177: Powerpc no-vfa-vect-depend-2.c and no-vfa-vect-depend-3.c failures


On 6/5/18 11:23 AM, Segher Boessenkool wrote:
> On Mon, Jun 04, 2018 at 08:57:24PM -0500, Peter Bergner wrote:
>> The fix used here is to catch the special case when we use -mpower9-vector and
>> -mcpu=power8 together and then force ourselves to use the -mpower9 gas option.
> 
> Ideally -mpowerN-vector will just go away.

No argument from me.



>> -%{mcpu=power8: %(asm_cpu_power8)} \
>> +%{mcpu=power8: %{!mpower9-vector: %(asm_cpu_power8)}} \
>>  %{mcpu=power9: %(asm_cpu_power9)} \
>>  %{mcpu=a2: -ma2} \
>>  %{mcpu=powerpc: -mppc} \
>> @@ -169,6 +169,7 @@
>>  %{maltivec: -maltivec} \
>>  %{mvsx: -mvsx %{!maltivec: -maltivec} %{!mcpu*: %(asm_cpu_power7)}} \
>>  %{mpower8-vector|mcrypto|mdirect-move|mhtm: %{!mcpu*: %(asm_cpu_power8)}} \
>> +%{mpower9-vector: %{!mcpu*|mcpu=power8: %(asm_cpu_power9)}} \
>>  -many"
> 
> Why do you need the !mpower9-vector in the mcpu=power8 clause?  Is how
> mpower8-vector is handled not correct, or is something fundamentally
> different there?

It's fundamentally different because of the overlapping lxvx/stxvx mnemonics
between P8 and P9, which doesn't occur between any other ISA levels.
Similar to gcc handling of options, gas uses the last -m<CPU> option to
assemble with, so if one were to pass -mpower9 -mpower8 to the assembler
(which you would get if you compile with -mpower9-vector -mcpu=power8),
then we'd assemble for power8 and get the P8's lxvx extended mnemonic.
So I've done that to "fix" any ordering issues.

Initially, I was thinking that we should determine what -m<CPU> gas option
to use by looking at the rs6000_isa_flags value to compute given all of the
gcc -m* and -mcpu=* options, but unfortunately, the gas option is computed
in the gcc driver and we don't have access to rs6000_isa_flags.  I thought
the fix above was the least of the bad solutions. :-)

Peter



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]