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