On Thu, Jul 3, 2025, 11:48 PM Richard Biener <richard.guent...@gmail.com> wrote:
> On Thu, Jul 3, 2025 at 9:34 PM Andrew Pinski <quic_apin...@quicinc.com> > wrote: > > > > These 2 testcases were originally designed for the default -march= of > > x86_64 so if you pass -march=native (on a target with AVX512 enabled), > > they will fail. It fix this, we add `-mno-sse3 -mprefer-vector-width=512` > > Did you mean to use -mprefer-vector-width=128 here? 512 doesn't deally > make > sense with -mno-sse3. > No i meant 512 as the testcase then enables avx512f via the #pragma . And we test the assembly for 512 version of the instructions and with some march, 256 becomes the prefer vector width while the default is 512. Sorry for the confusion . > > to the options to force a specific arch to the testcase. > > > > Tested on a skylake-avx512 machine with -march=native. > > > > PR testsuite/120643 > > gcc/testsuite/ChangeLog: > > > > * gcc.target/i386/vect-pragma-target-1.c: Add `-mno-sse3 > -mprefer-vector-width=512` > > to the options. > > * gcc.target/i386/vect-pragma-target-2.c: Likewise. > > > > Signed-off-by: Andrew Pinski <quic_apin...@quicinc.com> > > --- > > gcc/testsuite/gcc.target/i386/vect-pragma-target-1.c | 2 +- > > gcc/testsuite/gcc.target/i386/vect-pragma-target-2.c | 2 +- > > 2 files changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/gcc/testsuite/gcc.target/i386/vect-pragma-target-1.c > b/gcc/testsuite/gcc.target/i386/vect-pragma-target-1.c > > index f5e71e453ec..8f7d3d9b63d 100644 > > --- a/gcc/testsuite/gcc.target/i386/vect-pragma-target-1.c > > +++ b/gcc/testsuite/gcc.target/i386/vect-pragma-target-1.c > > @@ -1,5 +1,5 @@ > > /* { dg-do compile { target { i?86-*-* x86_64-*-* } } } > */ > > -/* { dg-options "-O0" } > */ > > +/* { dg-options "-O0 -mno-sse3 -mprefer-vector-width=512" } > */ > > /* { dg-final { scan-assembler-times "paddd.+xmm\[0-9]+" 1 } } > */ > > /* { dg-final { scan-assembler-times "vfmadd132ps.+ymm\[0-9]+" 1 } } > */ > > /* { dg-final { scan-assembler-times "vpaddw.+zmm\[0-9]+" 1 } } > */ > > diff --git a/gcc/testsuite/gcc.target/i386/vect-pragma-target-2.c > b/gcc/testsuite/gcc.target/i386/vect-pragma-target-2.c > > index 349680453a4..925d662b02b 100644 > > --- a/gcc/testsuite/gcc.target/i386/vect-pragma-target-2.c > > +++ b/gcc/testsuite/gcc.target/i386/vect-pragma-target-2.c > > @@ -1,5 +1,5 @@ > > /* { dg-do compile { target { i?86-*-* x86_64-*-* } } } > */ > > -/* { dg-options "-O0" } > */ > > +/* { dg-options "-O0 -mno-sse3 -mprefer-vector-width=512" } > */ > > /* { dg-final { scan-assembler-times "paddd.+xmm\[0-9]+" 1 } } > */ > > /* { dg-final { scan-assembler-times "vfmadd132ps.+ymm\[0-9]+" 1 } } > */ > > /* { dg-final { scan-assembler-times "vpaddw.+zmm\[0-9]+" 1 } } > */ > > -- > > 2.43.0 > > >