On Fri, Aug 4, 2017 at 12:19 PM, Peryt, Sebastian <sebastian.pe...@intel.com> wrote: >> -----Original Message----- >> From: Uros Bizjak [mailto:ubiz...@gmail.com] >> Sent: Sunday, July 30, 2017 11:02 AM >> To: H.J. Lu <hjl.to...@gmail.com> >> Cc: gcc-patches@gcc.gnu.org; Koval, Julia <julia.ko...@intel.com>; Peryt, >> Sebastian <sebastian.pe...@intel.com> >> Subject: Re: [PATCH] i386: Rewrite check for AVX512 features >> >> On Sat, Jul 29, 2017 at 3:06 PM, H.J. Lu <hjl.to...@gmail.com> wrote: >> > Add a new file, avx512-check.h, to check all AVX512 features. The >> > test is skipped if any requested AVX512 features are unavailable. >> > >> > Tested on Skylake server and Haswell. OK for trunk? >> >> No, I'd rather leave it in in the way they are now, so test can include >> individual >> checks. >> >> Uros. >> > Uros, > > Can you please suggests any alternative approach? The main problem with > current > one used in avx512f-helper.h is that it doesn't take into account situations > where > two features are required, but only one is supported by CPU. > > That's exactly the case with AVX512VL and AVX512VBMI on SKX. Once > avx512vl-check.h > verifies existence of AVX512VL on SKX it starts to execute test, which fails > because > AVX512VBMI is not supported but it has never been checked, before test > execution. > > Honestly I cannot think of any solution that would allow for both individual > include > files (beside what HJ already did in those few remaining tests) and multiple > features > verification. Also I think it's worth taking into account that not many tests > actually > use individual include files instead of avx512f-helper.h.
In the past, required ISA combinations were handled by introducing "combined" header files (i.e. pclmul-avx-check.h). However, with AVX512F, we already have different approach (I didn't notice, TBH) with avx512f-helper.h and lots of #ifdeffery inside. I didn' t like this ifdeffery, but comparing existing and new one, the new one is definitely an improvement. So, let's move forward with the patch. OK for mainline. Thanks, Uros. > > Thanks, > Sebastian >> > >> > H.J. >> > --- >> > PR target/81590 >> > * gcc.target/i386/avx512-check.h: New file. >> > * gcc.target/i386/avx5124fmaps-check.h: Removed. >> > * gcc.target/i386/avx5124vnniw-check.h: Likewise. >> > * gcc.target/i386/avx512cd-check.h: Likewise. >> > * gcc.target/i386/avx512ifma-check.h: Likewise. >> > * gcc.target/i386/avx512vbmi-check.h: Likewise. >> > * gcc.target/i386/avx512vpopcntdq-check.h: Likewise. >> > * gcc.target/i386/avx512bw-check.h: Rewrite. >> > * gcc.target/i386/avx512dq-check.h: Likewise. >> > * gcc.target/i386/avx512er-check.h: Likewise. >> > * gcc.target/i386/avx512f-check.h: Likewise. >> > * gcc.target/i386/avx512vl-check.h: Likewise. >> > * gcc.target/i386/avx512f-helper.h: Include "avx512-check.h" >> > only. >> > (test_512): Removed. >> > (avx512*_test): Likewise. >> > * gcc.target/i386/avx512f-pr71559.c (TEST): Undef. >> > --- >> > gcc/testsuite/gcc.target/i386/avx512-check.h | 113 >> +++++++++++++++++++++ >> > gcc/testsuite/gcc.target/i386/avx5124fmaps-check.h | 47 --------- >> > gcc/testsuite/gcc.target/i386/avx5124vnniw-check.h | 47 --------- >> > gcc/testsuite/gcc.target/i386/avx512bw-check.h | 50 +-------- >> > gcc/testsuite/gcc.target/i386/avx512cd-check.h | 46 --------- >> > gcc/testsuite/gcc.target/i386/avx512dq-check.h | 50 +-------- >> > gcc/testsuite/gcc.target/i386/avx512er-check.h | 49 +-------- >> > gcc/testsuite/gcc.target/i386/avx512f-check.h | 49 +-------- >> > gcc/testsuite/gcc.target/i386/avx512f-helper.h | 64 +----------- >> > gcc/testsuite/gcc.target/i386/avx512f-pr71559.c | 1 + >> > gcc/testsuite/gcc.target/i386/avx512ifma-check.h | 46 --------- >> > gcc/testsuite/gcc.target/i386/avx512vbmi-check.h | 46 --------- >> > gcc/testsuite/gcc.target/i386/avx512vl-check.h | 51 +--------- >> > .../gcc.target/i386/avx512vpopcntdq-check.h | 47 --------- >> > 14 files changed, 130 insertions(+), 576 deletions(-) create mode >> > 100644 gcc/testsuite/gcc.target/i386/avx512-check.h >> > delete mode 100644 gcc/testsuite/gcc.target/i386/avx5124fmaps-check.h >> > delete mode 100644 gcc/testsuite/gcc.target/i386/avx5124vnniw-check.h >> > delete mode 100644 gcc/testsuite/gcc.target/i386/avx512cd-check.h >> > delete mode 100644 gcc/testsuite/gcc.target/i386/avx512ifma-check.h >> > delete mode 100644 gcc/testsuite/gcc.target/i386/avx512vbmi-check.h >> > delete mode 100644 >> > gcc/testsuite/gcc.target/i386/avx512vpopcntdq-check.h >> > >> > diff --git a/gcc/testsuite/gcc.target/i386/avx512-check.h >> > b/gcc/testsuite/gcc.target/i386/avx512-check.h >> > new file mode 100644 >> > index 00000000000..bfe14960100 >> > --- /dev/null >> > +++ b/gcc/testsuite/gcc.target/i386/avx512-check.h >> > @@ -0,0 +1,113 @@ >> > +#include <stdlib.h> >> > +#include "cpuid.h" >> > +#include "m512-check.h" >> > +#include "avx512f-os-support.h" >> > + >> > +#ifndef DO_TEST >> > +#define DO_TEST do_test >> > +#ifdef AVX512VL >> > +static void test_256 (void); >> > +static void test_128 (void); >> > +#else >> > +static void test_512 (void); >> > +#endif >> > + >> > +__attribute__ ((noinline)) >> > +static void >> > +do_test (void) >> > +{ >> > +#ifdef AVX512VL >> > + test_256 (); >> > + test_128 (); >> > +#else >> > + test_512 (); >> > +#endif >> > +} >> > +#endif >> > + >> > +int >> > +main () >> > +{ >> > + unsigned int eax, ebx, ecx, edx; >> > + >> > + if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) >> > + goto skipped; >> > + >> > + /* Run AVX512F test only if host has AVX512F support. */ if >> > + (!(ecx & bit_OSXSAVE)) >> > + goto skipped; >> > + >> > + if (__get_cpuid_max (0, NULL) < 7) >> > + goto skipped; >> > + >> > + __cpuid_count (7, 0, eax, ebx, ecx, edx); >> > + >> > + if (!(ebx & bit_AVX512F)) >> > + goto skipped; >> > + >> > +#ifdef AVX512VL >> > + if (!(ebx & bit_AVX512VL)) >> > + goto skipped; >> > +#endif >> > + >> > +#ifdef AVX512ER >> > + if (!(ebx & bit_AVX512ER)) >> > + goto skipped; >> > +#endif >> > + >> > +#ifdef AVX512CD >> > + if (!(ebx & bit_AVX512CD)) >> > + goto skipped; >> > +#endif >> > + >> > +#ifdef AVX512DQ >> > + if (!(ebx & bit_AVX512DQ)) >> > + goto skipped; >> > +#endif >> > + >> > +#ifdef AVX512BW >> > + if (!(ebx & bit_AVX512BW)) >> > + goto skipped; >> > +#endif >> > + >> > +#ifdef AVX512IFMA >> > + if (!(ebx & bit_AVX512IFMA)) >> > + goto skipped; >> > +#endif >> > + >> > +#ifdef AVX512VBMI >> > + if (!(ecx & bit_AVX512VBMI)) >> > + goto skipped; >> > +#endif >> > + >> > +#ifdef AVX5124FMAPS >> > + if (!(edx & bit_AVX5124FMAPS)) >> > + goto skipped; >> > +#endif >> > + >> > +#ifdef AVX5124VNNIW >> > + if (!(edx & bit_AVX5124VNNIW)) >> > + goto skipped; >> > +#endif >> > + >> > +#ifdef AVX512VPOPCNTDQ >> > + if (!(ecx & bit_AVX512VPOPCNTDQ)) >> > + goto skipped; >> > +#endif >> > + >> > + if (!avx512f_os_support ()) >> > + goto skipped; >> > + >> > + DO_TEST (); >> > + >> > +#ifdef DEBUG >> > + printf ("PASSED\n"); >> > +#endif >> > + return 0; >> > + >> > +skipped: >> > +#ifdef DEBUG >> > + printf ("SKIPPED\n"); >> > +#endif >> > + return 0; >> > +} >> > diff --git a/gcc/testsuite/gcc.target/i386/avx5124fmaps-check.h >> > b/gcc/testsuite/gcc.target/i386/avx5124fmaps-check.h >> > deleted file mode 100644 >> > index 13ea70b0a8d..00000000000 >> > --- a/gcc/testsuite/gcc.target/i386/avx5124fmaps-check.h >> > +++ /dev/null >> > @@ -1,47 +0,0 @@ >> > -#include <stdlib.h> >> > -#include "cpuid.h" >> > -#include "m512-check.h" >> > -#include "avx512f-os-support.h" >> > - >> > -static void avx5124fmaps_test (void); >> > - >> > -static void __attribute__ ((noinline)) do_test (void) -{ >> > - avx5124fmaps_test (); >> > -} >> > - >> > -int >> > -main () >> > -{ >> > - unsigned int eax, ebx, ecx, edx; >> > - >> > - if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) >> > - return 0; >> > - >> > - /* Run AVX512_4FMAPS test only if host has the support. */ >> > - if ((ecx & bit_OSXSAVE) == (bit_OSXSAVE)) >> > - { >> > - if (__get_cpuid_max (0, NULL) < 7) >> > - return 0; >> > - >> > - __cpuid_count (7, 0, eax, ebx, ecx, edx); >> > - >> > - if ((avx512f_os_support ()) && ((edx & bit_AVX5124FMAPS) == >> bit_AVX5124FMAPS)) >> > - { >> > - do_test (); >> > -#ifdef DEBUG >> > - printf ("PASSED\n"); >> > -#endif >> > - return 0; >> > - } >> > -#ifdef DEBUG >> > - printf ("SKIPPED\n"); >> > -#endif >> > - } >> > -#ifdef DEBUG >> > - else >> > - printf ("SKIPPED\n"); >> > -#endif >> > - >> > - return 0; >> > -} >> > diff --git a/gcc/testsuite/gcc.target/i386/avx5124vnniw-check.h >> > b/gcc/testsuite/gcc.target/i386/avx5124vnniw-check.h >> > deleted file mode 100644 >> > index 27d35a57490..00000000000 >> > --- a/gcc/testsuite/gcc.target/i386/avx5124vnniw-check.h >> > +++ /dev/null >> > @@ -1,47 +0,0 @@ >> > -#include <stdlib.h> >> > -#include "cpuid.h" >> > -#include "m512-check.h" >> > -#include "avx512f-os-support.h" >> > - >> > -static void avx5124vnniw_test (void); >> > - >> > -static void __attribute__ ((noinline)) do_test (void) -{ >> > - avx5124vnniw_test (); >> > -} >> > - >> > -int >> > -main () >> > -{ >> > - unsigned int eax, ebx, ecx, edx; >> > - >> > - if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) >> > - return 0; >> > - >> > - /* Run AVX512_4VNNIW test only if host has the support. */ >> > - if ((ecx & bit_OSXSAVE) == (bit_OSXSAVE)) >> > - { >> > - if (__get_cpuid_max (0, NULL) < 7) >> > - return 0; >> > - >> > - __cpuid_count (7, 0, eax, ebx, ecx, edx); >> > - >> > - if ((avx512f_os_support ()) && ((edx & bit_AVX5124VNNIW) == >> bit_AVX5124VNNIW)) >> > - { >> > - do_test (); >> > -#ifdef DEBUG >> > - printf ("PASSED\n"); >> > -#endif >> > - return 0; >> > - } >> > -#ifdef DEBUG >> > - printf ("SKIPPED\n"); >> > -#endif >> > - } >> > -#ifdef DEBUG >> > - else >> > - printf ("SKIPPED\n"); >> > -#endif >> > - >> > - return 0; >> > -} >> > diff --git a/gcc/testsuite/gcc.target/i386/avx512bw-check.h >> > b/gcc/testsuite/gcc.target/i386/avx512bw-check.h >> > index d5288aaabd4..899a006363e 100644 >> > --- a/gcc/testsuite/gcc.target/i386/avx512bw-check.h >> > +++ b/gcc/testsuite/gcc.target/i386/avx512bw-check.h >> > @@ -1,47 +1,3 @@ >> > -#include <stdlib.h> >> > -#include "cpuid.h" >> > -#include "m512-check.h" >> > -#include "avx512f-os-support.h" >> > - >> > -static void avx512bw_test (void); >> > - >> > -static void __attribute__ ((noinline)) do_test (void) -{ >> > - avx512bw_test (); >> > -} >> > - >> > -int >> > -main () >> > -{ >> > - unsigned int eax, ebx, ecx, edx; >> > - >> > - if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) >> > - return 0; >> > - >> > - /* Run AVX512BW test only if host has AVX512BW support. */ >> > - if (ecx & bit_OSXSAVE) >> > - { >> > - if (__get_cpuid_max (0, NULL) < 7) >> > - return 0; >> > - >> > - __cpuid_count (7, 0, eax, ebx, ecx, edx); >> > - >> > - if ((ebx & bit_AVX512BW) && avx512f_os_support ()) >> > - { >> > - do_test (); >> > -#ifdef DEBUG >> > - printf ("PASSED\n"); >> > -#endif >> > - return 0; >> > - } >> > -#ifdef DEBUG >> > - printf ("SKIPPED\n"); >> > -#endif >> > - } >> > -#ifdef DEBUG >> > - else >> > - printf ("SKIPPED\n"); >> > -#endif >> > - >> > - return 0; >> > -} >> > +#define AVX512BW >> > +#define avx512bw_test test_512 >> > +#include "avx512-check.h" >> > diff --git a/gcc/testsuite/gcc.target/i386/avx512cd-check.h >> > b/gcc/testsuite/gcc.target/i386/avx512cd-check.h >> > deleted file mode 100644 >> > index fd0b9eb05d6..00000000000 >> > --- a/gcc/testsuite/gcc.target/i386/avx512cd-check.h >> > +++ /dev/null >> > @@ -1,46 +0,0 @@ >> > -#include <stdlib.h> >> > -#include "cpuid.h" >> > -#include "m512-check.h" >> > -#include "avx512f-os-support.h" >> > - >> > -static void avx512cd_test (void); >> > - >> > -static void __attribute__ ((noinline)) do_test (void) -{ >> > - avx512cd_test (); >> > -} >> > - >> > -int >> > -main () >> > -{ >> > - unsigned int eax, ebx, ecx, edx; >> > - >> > - if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) >> > - return 0; >> > - >> > - if (ecx & bit_OSXSAVE) >> > - { >> > - if (__get_cpuid_max (0, NULL) < 7) >> > - return 0; >> > - >> > - __cpuid_count (7, 0, eax, ebx, ecx, edx); >> > - >> > - if ((ebx & bit_AVX512CD) && avx512f_os_support ()) >> > - { >> > - do_test (); >> > -#ifdef DEBUG >> > - printf ("PASSED\n"); >> > -#endif >> > - return 0; >> > - } >> > -#ifdef DEBUG >> > - printf ("SKIPPED\n"); >> > -#endif >> > - } >> > -#ifdef DEBUG >> > - else >> > - printf ("SKIPPED\n"); >> > -#endif >> > - >> > - return 0; >> > -} >> > diff --git a/gcc/testsuite/gcc.target/i386/avx512dq-check.h >> > b/gcc/testsuite/gcc.target/i386/avx512dq-check.h >> > index 7955f48e912..1b728836731 100644 >> > --- a/gcc/testsuite/gcc.target/i386/avx512dq-check.h >> > +++ b/gcc/testsuite/gcc.target/i386/avx512dq-check.h >> > @@ -1,47 +1,3 @@ >> > -#include <stdlib.h> >> > -#include "cpuid.h" >> > -#include "m512-check.h" >> > -#include "avx512f-os-support.h" >> > - >> > -static void avx512dq_test (void); >> > - >> > -static void __attribute__ ((noinline)) do_test (void) -{ >> > - avx512dq_test (); >> > -} >> > - >> > -int >> > -main () >> > -{ >> > - unsigned int eax, ebx, ecx, edx; >> > - >> > - if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) >> > - return 0; >> > - >> > - /* Run AVX512DQ test only if host has AVX512DQ support. */ >> > - if (ecx & bit_OSXSAVE) >> > - { >> > - if (__get_cpuid_max (0, NULL) < 7) >> > - return 0; >> > - >> > - __cpuid_count (7, 0, eax, ebx, ecx, edx); >> > - >> > - if ((ebx & bit_AVX512DQ) && avx512f_os_support ()) >> > - { >> > - do_test (); >> > -#ifdef DEBUG >> > - printf ("PASSED\n"); >> > -#endif >> > - return 0; >> > - } >> > -#ifdef DEBUG >> > - printf ("SKIPPED\n"); >> > -#endif >> > - } >> > -#ifdef DEBUG >> > - else >> > - printf ("SKIPPED\n"); >> > -#endif >> > - >> > - return 0; >> > -} >> > +#define AVX512DQ >> > +#define avx512dq_test test_512 >> > +#include "avx512-check.h" >> > diff --git a/gcc/testsuite/gcc.target/i386/avx512er-check.h >> > b/gcc/testsuite/gcc.target/i386/avx512er-check.h >> > index 06fc18a098b..eb44c2f7ade 100644 >> > --- a/gcc/testsuite/gcc.target/i386/avx512er-check.h >> > +++ b/gcc/testsuite/gcc.target/i386/avx512er-check.h >> > @@ -1,46 +1,3 @@ >> > -#include <stdlib.h> >> > -#include "cpuid.h" >> > -#include "m512-check.h" >> > -#include "avx512f-os-support.h" >> > - >> > -static void avx512er_test (void); >> > - >> > -static void __attribute__ ((noinline)) do_test (void) -{ >> > - avx512er_test (); >> > -} >> > - >> > -int >> > -main () >> > -{ >> > - unsigned int eax, ebx, ecx, edx; >> > - >> > - if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) >> > - return 0; >> > - >> > - if (ecx & bit_OSXSAVE) >> > - { >> > - if (__get_cpuid_max (0, NULL) < 7) >> > - return 0; >> > - >> > - __cpuid_count (7, 0, eax, ebx, ecx, edx); >> > - >> > - if ((ebx & bit_AVX512ER) && avx512f_os_support ()) >> > - { >> > - do_test (); >> > -#ifdef DEBUG >> > - printf ("PASSED\n"); >> > -#endif >> > - return 0; >> > - } >> > -#ifdef DEBUG >> > - printf ("SKIPPED\n"); >> > -#endif >> > - } >> > -#ifdef DEBUG >> > - else >> > - printf ("SKIPPED\n"); >> > -#endif >> > - >> > - return 0; >> > -} >> > +#define AVX512ER >> > +#define avx512er_test test_512 >> > +#include "avx512f-helper.h" >> > diff --git a/gcc/testsuite/gcc.target/i386/avx512f-check.h >> > b/gcc/testsuite/gcc.target/i386/avx512f-check.h >> > index 811184b2fd7..b3bdd9a05c4 100644 >> > --- a/gcc/testsuite/gcc.target/i386/avx512f-check.h >> > +++ b/gcc/testsuite/gcc.target/i386/avx512f-check.h >> > @@ -1,47 +1,2 @@ >> > -#include <stdlib.h> >> > -#include "cpuid.h" >> > -#include "m512-check.h" >> > -#include "avx512f-os-support.h" >> > - >> > -static void avx512f_test (void); >> > - >> > -static void __attribute__ ((noinline)) do_test (void) -{ >> > - avx512f_test (); >> > -} >> > - >> > -int >> > -main () >> > -{ >> > - unsigned int eax, ebx, ecx, edx; >> > - >> > - if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) >> > - return 0; >> > - >> > - /* Run AVX512F test only if host has AVX512F support. */ >> > - if (ecx & bit_OSXSAVE) >> > - { >> > - if (__get_cpuid_max (0, NULL) < 7) >> > - return 0; >> > - >> > - __cpuid_count (7, 0, eax, ebx, ecx, edx); >> > - >> > - if ((ebx & bit_AVX512F) && avx512f_os_support ()) >> > - { >> > - do_test (); >> > -#ifdef DEBUG >> > - printf ("PASSED\n"); >> > -#endif >> > - return 0; >> > - } >> > -#ifdef DEBUG >> > - printf ("SKIPPED\n"); >> > -#endif >> > - } >> > -#ifdef DEBUG >> > - else >> > - printf ("SKIPPED\n"); >> > -#endif >> > - >> > - return 0; >> > -} >> > +#define avx512f_test test_512 >> > +#include "avx512f-helper.h" >> > diff --git a/gcc/testsuite/gcc.target/i386/avx512f-helper.h >> > b/gcc/testsuite/gcc.target/i386/avx512f-helper.h >> > index ef4661a3453..72982f95aed 100644 >> > --- a/gcc/testsuite/gcc.target/i386/avx512f-helper.h >> > +++ b/gcc/testsuite/gcc.target/i386/avx512f-helper.h >> > @@ -8,29 +8,7 @@ >> > #ifndef AVX512F_HELPER_INCLUDED >> > #define AVX512F_HELPER_INCLUDED >> > >> > -#if defined (AVX512F) && !defined (AVX512VL) -#include >> > "avx512f-check.h" >> > -#elif defined (AVX512ER) && !defined (AVX512VL) -#include >> > "avx512er-check.h" >> > -#elif defined (AVX512CD) && !defined (AVX512VL) -#include >> > "avx512cd-check.h" >> > -#elif defined (AVX512DQ) && !defined (AVX512VL) -#include >> > "avx512dq-check.h" >> > -#elif defined (AVX512BW) && !defined (AVX512VL) -#include >> > "avx512bw-check.h" >> > -#elif defined (AVX512IFMA) && !defined (AVX512VL) -#include >> > "avx512ifma-check.h" >> > -#elif defined (AVX512VBMI) && !defined (AVX512VL) -#include >> > "avx512vbmi-check.h" >> > -#elif defined (AVX5124FMAPS) && !defined (AVX512VL) -#include >> > "avx5124fmaps-check.h" >> > -#elif defined (AVX5124VNNIW) && !defined (AVX512VL) -#include >> > "avx5124vnniw-check.h" >> > -#elif defined (AVX512VPOPCNTDQ) && !defined (AVX512VL) -#include >> > "avx512vpopcntdq-check.h" >> > -#elif defined (AVX512VL) >> > -#include "avx512vl-check.h" >> > -#endif >> > +#include "avx512-check.h" >> > >> > /* Macros expansion. */ >> > #define CONCAT(a,b,c) a ## b ## c >> > @@ -112,46 +90,6 @@ MAKE_MASK_ZERO(i_uq, unsigned long long) #ifndef >> > AVX512VL #define AVX512F_LEN 512 #define AVX512F_LEN_HALF 256 -void >> > test_512 (); -#endif >> > - >> > -void test_512 (); >> > -void test_256 (); >> > -void test_128 (); >> > - >> > -#if defined (AVX512F) && !defined (AVX512VL) -void -avx512f_test >> > (void) { test_512 (); } -#elif defined (AVX512CD) && !defined >> > (AVX512VL) -void -avx512cd_test (void) { test_512 (); } -#elif defined >> > (AVX512ER) && !defined (AVX512VL) -void -avx512er_test (void) { >> > test_512 (); } -#elif defined (AVX512DQ) && !defined (AVX512VL) -void >> > -avx512dq_test (void) { test_512 (); } -#elif defined (AVX512BW) && >> > !defined (AVX512VL) -void -avx512bw_test (void) { test_512 (); } >> > -#elif defined (AVX512IFMA) && !defined (AVX512VL) -void >> > -avx512ifma_test (void) { test_512 (); } -#elif defined (AVX512VBMI) >> > && !defined (AVX512VL) -void -avx512vbmi_test (void) { test_512 (); } >> > -#elif defined (AVX5124FMAPS) && !defined (AVX512VL) -void >> > -avx5124fmaps_test (void) { test_512 (); } -#elif defined >> > (AVX5124VNNIW) && !defined (AVX512VL) -void -avx5124vnniw_test (void) >> > { test_512 (); } -#elif defined (AVX512VPOPCNTDQ) && !defined >> > (AVX512VL) -void -avx512vpopcntdq_test (void) { test_512 (); } -#elif >> > defined (AVX512VL) -void -avx512vl_test (void) { test_256 (); test_128 >> > (); } #endif >> > >> > #endif /* AVX512F_HELPER_INCLUDED */ >> > diff --git a/gcc/testsuite/gcc.target/i386/avx512f-pr71559.c >> > b/gcc/testsuite/gcc.target/i386/avx512f-pr71559.c >> > index d78d86ac2f8..43dc236c410 100644 >> > --- a/gcc/testsuite/gcc.target/i386/avx512f-pr71559.c >> > +++ b/gcc/testsuite/gcc.target/i386/avx512f-pr71559.c >> > @@ -3,6 +3,7 @@ >> > /* { dg-options "-O2 -ftree-vectorize -mavx512f" } */ >> > >> > #include "avx512f-check.h" >> > +#undef TEST >> > #define PR71559_TEST avx512f_test >> > >> > #include "sse2-pr71559.c" >> > diff --git a/gcc/testsuite/gcc.target/i386/avx512ifma-check.h >> > b/gcc/testsuite/gcc.target/i386/avx512ifma-check.h >> > deleted file mode 100644 >> > index b90a4d55103..00000000000 >> > --- a/gcc/testsuite/gcc.target/i386/avx512ifma-check.h >> > +++ /dev/null >> > @@ -1,46 +0,0 @@ >> > -#include <stdlib.h> >> > -#include "cpuid.h" >> > -#include "m512-check.h" >> > -#include "avx512f-os-support.h" >> > - >> > -static void avx512ifma_test (void); >> > - >> > -static void __attribute__ ((noinline)) do_test (void) -{ >> > - avx512ifma_test (); >> > -} >> > - >> > -int >> > -main () >> > -{ >> > - unsigned int eax, ebx, ecx, edx; >> > - >> > - if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) >> > - return 0; >> > - >> > - if (ecx & bit_OSXSAVE) >> > - { >> > - if (__get_cpuid_max (0, NULL) < 7) >> > - return 0; >> > - >> > - __cpuid_count (7, 0, eax, ebx, ecx, edx); >> > - >> > - if ((ebx & bit_AVX512IFMA) && avx512f_os_support ()) >> > - { >> > - do_test (); >> > -#ifdef DEBUG >> > - printf ("PASSED\n"); >> > -#endif >> > - return 0; >> > - } >> > -#ifdef DEBUG >> > - printf ("SKIPPED\n"); >> > -#endif >> > - } >> > -#ifdef DEBUG >> > - else >> > - printf ("SKIPPED\n"); >> > -#endif >> > - >> > - return 0; >> > -} >> > diff --git a/gcc/testsuite/gcc.target/i386/avx512vbmi-check.h >> > b/gcc/testsuite/gcc.target/i386/avx512vbmi-check.h >> > deleted file mode 100644 >> > index 2c1f6259401..00000000000 >> > --- a/gcc/testsuite/gcc.target/i386/avx512vbmi-check.h >> > +++ /dev/null >> > @@ -1,46 +0,0 @@ >> > -#include <stdlib.h> >> > -#include "cpuid.h" >> > -#include "m512-check.h" >> > -#include "avx512f-os-support.h" >> > - >> > -static void avx512vbmi_test (void); >> > - >> > -static void __attribute__ ((noinline)) do_test (void) -{ >> > - avx512vbmi_test (); >> > -} >> > - >> > -int >> > -main () >> > -{ >> > - unsigned int eax, ebx, ecx, edx; >> > - >> > - if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) >> > - return 0; >> > - >> > - if (ecx & bit_OSXSAVE) >> > - { >> > - if (__get_cpuid_max (0, NULL) < 7) >> > - return 0; >> > - >> > - __cpuid_count (7, 0, eax, ebx, ecx, edx); >> > - >> > - if ((ecx & bit_AVX512VBMI) && avx512f_os_support ()) >> > - { >> > - do_test (); >> > -#ifdef DEBUG >> > - printf ("PASSED\n"); >> > -#endif >> > - return 0; >> > - } >> > -#ifdef DEBUG >> > - printf ("SKIPPED\n"); >> > -#endif >> > - } >> > -#ifdef DEBUG >> > - else >> > - printf ("SKIPPED\n"); >> > -#endif >> > - >> > - return 0; >> > -} >> > diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-check.h >> > b/gcc/testsuite/gcc.target/i386/avx512vl-check.h >> > index 29d984d03dd..9d02cc82c46 100644 >> > --- a/gcc/testsuite/gcc.target/i386/avx512vl-check.h >> > +++ b/gcc/testsuite/gcc.target/i386/avx512vl-check.h >> > @@ -1,47 +1,4 @@ >> > -#include <stdlib.h> >> > -#include "cpuid.h" >> > -#include "m512-check.h" >> > -#include "avx512f-os-support.h" >> > - >> > -static void avx512vl_test (void); >> > - >> > -static void __attribute__ ((noinline)) do_test (void) -{ >> > - avx512vl_test (); >> > -} >> > - >> > -int >> > -main () >> > -{ >> > - unsigned int eax, ebx, ecx, edx; >> > - >> > - if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) >> > - return 0; >> > - >> > - /* Run avx512vl test only if host has avx512vl support. */ >> > - if (ecx & bit_OSXSAVE) >> > - { >> > - if (__get_cpuid_max (0, NULL) < 7) >> > - return 0; >> > - >> > - __cpuid_count (7, 0, eax, ebx, ecx, edx); >> > - >> > - if ((ebx & bit_AVX512VL) && avx512f_os_support ()) >> > - { >> > - do_test (); >> > -#ifdef DEBUG >> > - printf ("PASSED\n"); >> > -#endif >> > - return 0; >> > - } >> > -#ifdef DEBUG >> > - printf ("SKIPPED\n"); >> > -#endif >> > - } >> > -#ifdef DEBUG >> > - else >> > - printf ("SKIPPED\n"); >> > -#endif >> > - >> > - return 0; >> > -} >> > +#define AVX512VL >> > +#define DO_TEST avx512vl_test >> > +static void DO_TEST (void); >> > +#include "avx512-check.h" >> > diff --git a/gcc/testsuite/gcc.target/i386/avx512vpopcntdq-check.h >> > b/gcc/testsuite/gcc.target/i386/avx512vpopcntdq-check.h >> > deleted file mode 100644 >> > index 179548bf8cb..00000000000 >> > --- a/gcc/testsuite/gcc.target/i386/avx512vpopcntdq-check.h >> > +++ /dev/null >> > @@ -1,47 +0,0 @@ >> > -#include <stdlib.h> >> > -#include "cpuid.h" >> > -#include "m512-check.h" >> > -#include "avx512f-os-support.h" >> > - >> > -static void avx512vpopcntdq_test (void); >> > - >> > -static void __attribute__ ((noinline)) do_test (void) -{ >> > - avx512vpopcntdq_test (); >> > -} >> > - >> > -int >> > -main () >> > -{ >> > - unsigned int eax, ebx, ecx, edx; >> > - >> > - if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) >> > - return 0; >> > - >> > - /* Run AVX512_VPOPCNTDQ test only if host has the support. */ >> > - if ((ecx & bit_OSXSAVE) == (bit_OSXSAVE)) >> > - { >> > - if (__get_cpuid_max (0, NULL) < 7) >> > - return 0; >> > - >> > - __cpuid_count (7, 0, eax, ebx, ecx, edx); >> > - >> > - if ((avx512f_os_support ()) && ((ecx & bit_AVX512VPOPCNTDQ) == >> bit_AVX512VPOPCNTDQ)) >> > - { >> > - do_test (); >> > -#ifdef DEBUG >> > - printf ("PASSED\n"); >> > -#endif >> > - return 0; >> > - } >> > -#ifdef DEBUG >> > - printf ("SKIPPED\n"); >> > -#endif >> > - } >> > -#ifdef DEBUG >> > - else >> > - printf ("SKIPPED\n"); >> > -#endif >> > - >> > - return 0; >> > -} >> > -- >> > 2.13.3 >> >