Initial support for AVX-512{VL,BW,DQ}
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / avx512vl-check.h
blobc017ee28e47d7b2c7f3b92f49aafae4c869b09ce
1 #include <stdlib.h>
2 #include "cpuid.h"
3 #include "m512-check.h"
4 #include "avx512f-os-support.h"
6 static void avx512vl_test (void);
8 static void __attribute__ ((noinline)) do_test (void)
10 avx512vl_test ();
13 int
14 main ()
16 unsigned int eax, ebx, ecx, edx;
18 if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
19 return 0;
21 /* Run avx512vl test only if host has avx512vl support. */
22 if ((ecx & bit_OSXSAVE) == (bit_OSXSAVE))
24 if (__get_cpuid_max (0, NULL) < 7)
25 return 0;
27 __cpuid_count (7, 0, eax, ebx, ecx, edx);
29 if ((avx512f_os_support ())
30 && ((ebx & bit_AVX512F) == bit_AVX512F)
31 && ((ebx & bit_AVX512VL) == bit_AVX512VL))
33 do_test ();
34 #ifdef DEBUG
35 printf ("PASSED\n");
36 #endif
37 return 0;
39 #ifdef DEBUG
40 printf ("SKIPPED\n");
41 #endif
43 #ifdef DEBUG
44 else
45 printf ("SKIPPED\n");
46 #endif
48 return 0;