| 1 |
/* Check if system supports SIMD. Copied from gcc.dg/vect/tree-vect.h. */ |
| 2 |
#include <signal.h> |
| 3 |
|
| 4 |
extern "C" void abort (void); |
| 5 |
extern "C" void exit (int); |
| 6 |
|
| 7 |
void |
| 8 |
sig_ill_handler (int sig) |
| 9 |
{ |
| 10 |
exit(0); |
| 11 |
} |
| 12 |
|
| 13 |
void check_vect (void) |
| 14 |
{ |
| 15 |
signal(SIGILL, sig_ill_handler); |
| 16 |
#if defined(__i386__) || defined(__x86_64__) |
| 17 |
/* SSE2 instruction: movsd %xmm0,%xmm0 */ |
| 18 |
asm volatile (".byte 0xf2,0x0f,0x10,0xc0"); |
| 19 |
#elif defined(__sparc__) |
| 20 |
asm volatile (".word\t0x81b007c0"); |
| 21 |
#endif |
| 22 |
signal (SIGILL, SIG_DFL); |
| 23 |
} |