OSDN Git Service

PR tree-optimization/40542
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / vect / tree-vect.h
1 /* Check if system supports SIMD */
2 #include <signal.h>
3
4 extern void abort (void);
5 extern 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(__PAIRED__)
17   /* 750CL paired-single instruction, 'ps_mul %v0,%v0,%v0'.  */
18  asm volatile (".long 0x10000032");
19 #elif defined(__ppc__) || defined(__ppc64__) || defined(__powerpc__) || defined(powerpc)
20   /* Altivec instruction, 'vor %v0,%v0,%v0'.  */
21   asm volatile (".long 0x10000484");
22 #elif defined(__i386__) || defined(__x86_64__)
23   /* SSE2 instruction: movsd %xmm0,%xmm0 */
24   asm volatile (".byte 0xf2,0x0f,0x10,0xc0");
25 #elif defined(__sparc__)
26   asm volatile (".word\t0x81b007c0");
27 #elif defined(__arm__)
28   {
29     /* On some processors without NEON support, this instruction may
30        be a no-op, on others it may trap, so check that it executes
31        correctly.  */
32     long long a = 0, b = 1;
33     asm ("vorr %P0, %P1, %P2"
34          : "=w" (a)
35          : "0" (a), "w" (b));
36     if (a != 1)
37       exit (0);
38   }
39 #endif
40   signal (SIGILL, SIG_DFL);
41 }