Merged with mainline at revision 128810.
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / tree-vect.h
blob76e7ff4557ddaa1b21bab8515afa24e741ff4ede
1 /* Check if system supports SIMD */
2 #include <signal.h>
4 extern void abort (void);
5 extern void exit (int);
7 void
8 sig_ill_handler (int sig)
10 exit(0);
13 void check_vect (void)
15 signal(SIGILL, sig_ill_handler);
16 #if defined(__ppc__) || defined(__ppc64__) || defined(__powerpc__) || defined(powerpc)
17 /* Altivec instruction, 'vor %v0,%v0,%v0'. */
18 asm volatile (".long 0x10000484");
19 #elif defined(__i386__) || defined(__x86_64__)
20 /* SSE2 instruction: movsd %xmm0,%xmm0 */
21 asm volatile (".byte 0xf2,0x0f,0x10,0xc0");
22 #elif defined(__sparc__)
23 asm volatile (".word\t0x81b007c0");
24 #elif defined(__arm__)
26 /* On some processors without NEON support, this instruction may
27 be a no-op, on others it may trap, so check that it executes
28 correctly. */
29 long long a = 0, b = 1;
30 asm ("vorr %P0, %P1, %P2"
31 : "=w" (a)
32 : "0" (a), "w" (b));
33 if (a != 1)
34 exit (0);
36 #endif
37 signal (SIGILL, SIG_DFL);