src/cpuinfo/SDL_cpuinfo.c
changeset 795 275708f2e838
parent 793 c20f08c4f437
child 796 dec19b813b04
equal deleted inserted replaced
794:a5defa3b93e1 795:275708f2e838
   234 	int hasVectorUnit = 0; 
   234 	int hasVectorUnit = 0; 
   235 	size_t length = sizeof(hasVectorUnit); 
   235 	size_t length = sizeof(hasVectorUnit); 
   236 	int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0); 
   236 	int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0); 
   237 	if( 0 == error )
   237 	if( 0 == error )
   238 		altivec = (hasVectorUnit != 0); 
   238 		altivec = (hasVectorUnit != 0); 
   239 #elseif defined(USE_SETJMP) && defined(__GNUC__) && defined(__powerpc__)
   239 #elif defined(USE_SETJMP) && defined(GCC_ALTIVEC)
   240 	void (*handler)(int sig);
   240 	void (*handler)(int sig);
   241 	handler = signal(SIGILL, illegal_instruction);
   241 	handler = signal(SIGILL, illegal_instruction);
   242 	if ( setjmp(jmpbuf) == 0 ) {
   242 	if ( setjmp(jmpbuf) == 0 ) {
   243 		asm volatile ("mtspr 256, %0\n\t"
   243 		asm volatile ("mtspr 256, %0\n\t"
   244 			      "vand %%v0, %%v0, %%v0"
   244 			      "vand %%v0, %%v0, %%v0"