]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
i386: Fix vect-pragma-target-[12].c testcase for -march=XYZ [PR120643]
authorAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Fri, 29 Aug 2025 05:38:19 +0000 (22:38 -0700)
committerAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Fri, 29 Aug 2025 07:38:30 +0000 (00:38 -0700)
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 -mtune=generic`
to the options to force a specific arch to the testcase.

Changes since v1:
* v2: Use -mtune=generic instead of -mprefer-vector-width=512.

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 -mtune=generic`
to the options.
* gcc.target/i386/vect-pragma-target-2.c: Likewise.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
gcc/testsuite/gcc.target/i386/vect-pragma-target-1.c
gcc/testsuite/gcc.target/i386/vect-pragma-target-2.c

index f5e71e453ec148ab6c41b837a1d4d52089b4085e..58ff7f07a09206167a20e9d3b8719ea8e4f31a40 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile { target { i?86-*-* x86_64-*-* } } }                 */
-/* { dg-options "-O0" }                                                 */
+/* { dg-options "-O0 -mno-sse3 -mtune=generic" }                        */
 /* { 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 } }   */
index 349680453a49eb7bbc6eac097a8f4e31e18cd3b8..f6dbd54e80027a6a8e2f725902f00062cfb9c793 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile { target { i?86-*-* x86_64-*-* } } }                 */
-/* { dg-options "-O0" }                                                 */
+/* { dg-options "-O0 -mno-sse3 -mtune=generic" }                        */
 /* { 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 } }   */