]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: Fix a couple of x86 issues in gcc.dg/vect testsuite
authorUros Bizjak <ubizjak@gmail.com>
Wed, 14 Feb 2024 20:09:35 +0000 (21:09 +0100)
committerUros Bizjak <ubizjak@gmail.com>
Wed, 14 Feb 2024 20:10:31 +0000 (21:10 +0100)
A compile-time test can use -march=skylake-avx512 for all x86 targets,
but a runtime test needs to check avx512f effective target if the
instructions can be assembled.

The runtime test also needs to check if the target machine supports
instruction set we have been compiled for.  The testsuite uses check_vect
infrastructure, but handling of AVX512F+ ISAs was missing there.

Add detection of __AVX512F__ and __AVX512VL__, which is enough to handle
all currently mentioned target processors in the gcc.dg/vect testsuite.

gcc/testsuite/ChangeLog:

* gcc.dg/vect/pr113576.c (dg-additional-options):
Use -march=skylake-avx512 for avx512f effective target.
* gcc.dg/vect/pr98308.c (dg-additional-options):
Use -march=skylake-avx512 for all x86 targets.
* gcc.dg/vect/tree-vect.h (check_vect): Handle __AVX512F__
and __AVX512VL__.

gcc/testsuite/gcc.dg/vect/pr113576.c
gcc/testsuite/gcc.dg/vect/pr98308.c
gcc/testsuite/gcc.dg/vect/tree-vect.h

index decb7abe2f751cc6116567d21dcbc771be2983f5..b6edde6f8e2ce139354388c66c1f94ac34f657c2 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do run } */
 /* { dg-options "-O3" } */
-/* { dg-additional-options "-march=skylake-avx512" { target { x86_64-*-* i?86-*-* } } } */
+/* { dg-additional-options "-march=skylake-avx512" { target avx512f } } */
 
 #include "tree-vect.h"
 
index aeec9771c55334b4abfa23192c0a7904563869b8..d74431200c74ff7c622bebe893c4d22ff9e468b1 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-additional-options "-O3" } */
-/* { dg-additional-options "-march=skylake-avx512" { target avx512f } } */
+/* { dg-additional-options "-march=skylake-avx512" { target x86_64-*-* i?86-*-* } } */
 /* { dg-additional-options "-fdump-tree-optimized-details-blocks" } */
 
 extern unsigned long long int arr_86[];
index c4b8144121666cd125176613fd9381a860b4159f..1e4b56ee0e15f822573823e27aa97642c19c6816 100644 (file)
@@ -38,7 +38,11 @@ check_vect (void)
     /* Determine what instruction set we've been compiled for, and detect
        that we're running with it.  This allows us to at least do a compile
        check for, e.g. SSE4.1 when the machine only supports SSE2.  */
-# if defined(__AVX2__)
+# if defined(__AVX512VL__)
+    want_level = 7, want_b = bit_AVX512VL;
+# elif defined(__AVX512F__)
+    want_level = 7, want_b = bit_AVX512F;
+# elif defined(__AVX2__)
     want_level = 7, want_b = bit_AVX2;
 # elif defined(__AVX__)
     want_level = 1, want_c = bit_AVX;