rs6000: Disable MMA if no VSX support [PR103627]
authorKewen Lin <linkw@linux.ibm.com>
Mon, 7 Feb 2022 03:29:32 +0000 (21:29 -0600)
committerKewen Lin <linkw@linux.ibm.com>
Mon, 7 Feb 2022 03:29:32 +0000 (21:29 -0600)
commit8103623923ac4ea19b97a369979d4bd5731aab57
tree3584269aa672ec7161d770c99853d2b7eb6e0449
parent353f8fcc2e6ce8997ddfdc55451f0f0e9450f981
rs6000: Disable MMA if no VSX support [PR103627]

As PR103627 shows, there is an unexpected case where !TARGET_VSX
and TARGET_MMA co-exist.  As ISA3.1 claims, SIMD is a requirement
for MMA.  By looking into the ICE, I noticed that the current
MMA implementation depends on vector pairs load/store which use
VSX register, but we don't have a separated option to control
Power10 vector support and Segher pointed out "-mpower9-vector is
a workaround that should go away" and more explanations in [1].
So this patch makes MMA require VSX instead.

[1] https://gcc.gnu.org/pipermail/gcc-patches/2022-January/589303.html

gcc/ChangeLog:

PR target/103627
* config/rs6000/rs6000.cc (rs6000_option_override_internal): Disable
MMA if !TARGET_VSX.

gcc/testsuite/ChangeLog:

PR target/103627
* gcc.target/powerpc/pr103627-1.c: New test.
* gcc.target/powerpc/pr103627-2.c: New test.
gcc/config/rs6000/rs6000.cc
gcc/testsuite/gcc.target/powerpc/pr103627-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/pr103627-2.c [new file with mode: 0644]