Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / altivec_check.h
blob736054821f183213f54afa8e9f2ec5a9172a951d
1 /* A runtime check for AltiVec capability. */
2 /* Contributed by Ziemowit Laski <zlaski@apple.com> */
4 #include <signal.h>
5 extern void exit (int);
6 extern void abort (void);
8 void
9 sig_ill_handler (int sig)
11 exit (0);
14 void altivec_check(void) {
16 /* Exit on systems without AltiVec. */
17 signal (SIGILL, sig_ill_handler);
18 #ifdef __MACH__
19 asm volatile ("vor v0,v0,v0");
20 #else
21 asm volatile ("vor 0,0,0");
22 #endif
23 signal (SIGILL, SIG_DFL);