On Tue, Jun 05, 2018 at 12:26:04PM -0500, Peter Bergner wrote: > >> -%{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.
Ah, that's the crux. Thanks. Add a comment to the code please? > 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. :-) It isn't nice, but it looks like it will work. Okay for trunk. Thanks, Segher