OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [g++.dg/] [ext/] [altivec_check.h] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
/* A runtime check for AltiVec capability.  */
2
/* Contributed by Ziemowit Laski  <zlaski@apple.com>  */
3
 
4
#include <signal.h>
5
extern
6
#ifdef __cplusplus
7
"C"
8
#endif
9
void exit(int);
10
 
11
void
12
sig_ill_handler (int sig)
13
{
14
    exit (0);
15
}
16
 
17
void altivec_check(void) {
18
 
19
  /* Exit on systems without AltiVec.  */
20
  signal (SIGILL, sig_ill_handler);
21
#ifdef __MACH__
22
  asm volatile ("vor v0,v0,v0");
23
#else
24
  asm volatile ("vor 0,0,0");
25
#endif
26
  signal (SIGILL, SIG_DFL);
27
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.