aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-os-support.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-os-support.h')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-os-support.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-os-support.h b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-os-support.h
new file mode 100644
index 000000000..deefa5e11
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-os-support.h
@@ -0,0 +1,10 @@
+/* Check if the OS supports executing AVX512F instructions. */
+
+static int
+avx512f_os_support (void)
+{
+ unsigned int eax, edx;
+
+ __asm__ ("xgetbv" : "=a" (eax), "=d" (edx) : "c" (0));
+ return (eax & 230) == 230;
+}