aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8/gcc/testsuite/gcc.target/i386/fma4-check.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.8/gcc/testsuite/gcc.target/i386/fma4-check.h')
-rw-r--r--gcc-4.8/gcc/testsuite/gcc.target/i386/fma4-check.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc-4.8/gcc/testsuite/gcc.target/i386/fma4-check.h b/gcc-4.8/gcc/testsuite/gcc.target/i386/fma4-check.h
new file mode 100644
index 000000000..33cd9628c
--- /dev/null
+++ b/gcc-4.8/gcc/testsuite/gcc.target/i386/fma4-check.h
@@ -0,0 +1,27 @@
+#include <stdlib.h>
+
+#include "cpuid.h"
+
+static void fma4_test (void);
+
+static void
+__attribute__ ((noinline))
+do_test (void)
+{
+ fma4_test ();
+}
+
+int
+main ()
+{
+ unsigned int eax, ebx, ecx, edx;
+
+ if (!__get_cpuid (0x80000001, &eax, &ebx, &ecx, &edx))
+ return 0;
+
+ /* Run FMA4 test only if host has FMA4 support. */
+ if (ecx & bit_FMA4)
+ do_test ();
+
+ return 0;
+}