gcc/testsuite/gcc.target/i386/fma-check.h
raw| 1 | #include <stdlib.h> |
| 2 | |
| 3 | #include "cpuid.h" |
| 4 | |
| 5 | static void fma_test (void); |
| 6 | |
| 7 | static void __attribute__ ((noinline)) do_test (void) |
| 8 | { |
| 9 | fma_test (); |
| 10 | } |
| 11 | |
| 12 | int |
| 13 | main () |
| 14 | { |
| 15 | unsigned int eax, ebx, ecx, edx; |
| 16 | |
| 17 | if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) |
| 18 | return 0; |
| 19 | |
| 20 | /* Run FMA test only if host has FMA support. */ |
| 21 | if (ecx & bit_FMA) |
| 22 | do_test (); |
| 23 | |
| 24 | return 0; |
| 25 | } |