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 Mon, Jun 04, 2018 at 08:57:24PM -0500, Peter Bergner wrote:
> PR63177 shows a bug in how we determine which gas options we decide to pass to the
> assembler.  Normally, we pass the -m<CPU> option to the assembler if we used the
> -mcpu=<CPU> option.  However, if we don't compile with -mcpu=<CPU>, then we will
> check some of the -m<vector option> options and pass an appropriate -m<CPU> option
> to the assembler.  This is all fine and good except for when we compile with
> -mpower9-vector -mcpu=power8.  The problem here is that POWER9 added new lxvx/stxvx
> instructions which already existed in POWER8 as extended mnemonics of lxvd2x/stxvd2x
> which are different instructions and behave differently in LE mode.  The "bug" is
> that -mpower9-vector enables the generation of the POWER9 lxvx instruction, but the
> -mcpu=power8 option causes us to use the -mpower8 assembler option so we get the
> wrong instruction. :-(
> 
> 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.

> --- gcc/config/rs6000/rs6000.h	(revision 260913)
> +++ gcc/config/rs6000/rs6000.h	(working copy)
> @@ -120,7 +120,7 @@
>  %{mcpu=power6: %(asm_cpu_power6) -maltivec} \
>  %{mcpu=power6x: %(asm_cpu_power6) -maltivec} \
>  %{mcpu=power7: %(asm_cpu_power7)} \
> -%{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?


Segher


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