src/cpuinfo/SDL_cpuinfo.c
author Ben Avison <bavison@riscosopen.org>
Thu, 31 Oct 2019 14:00:28 +0300
branchSDL-1.2
changeset 13219 4f88e197acad
parent 13212 3d6dc20a0974
child 13396 f765d8961a16
permissions -rw-r--r--
ARM: Create configure option --enable-arm-neon to govern assembly optimizations
---
configure.in | 39 +++++++++++++++++++++++++++++++++++++++
include/SDL_config.h.in | 1 +
include/SDL_cpuinfo.h | 3 +++
src/cpuinfo/SDL_cpuinfo.c | 37 +++++++++++++++++++++++++++++++++++++
4 files changed, 80 insertions(+)
     1 /*
     2     SDL - Simple DirectMedia Layer
     3     Copyright (C) 1997-2012 Sam Lantinga
     4 
     5     This library is free software; you can redistribute it and/or
     6     modify it under the terms of the GNU Lesser General Public
     7     License as published by the Free Software Foundation; either
     8     version 2.1 of the License, or (at your option) any later version.
     9 
    10     This library is distributed in the hope that it will be useful,
    11     but WITHOUT ANY WARRANTY; without even the implied warranty of
    12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    13     Lesser General Public License for more details.
    14 
    15     You should have received a copy of the GNU Lesser General Public
    16     License along with this library; if not, write to the Free Software
    17     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    18 
    19     Sam Lantinga
    20     slouken@libsdl.org
    21 */
    22 #include "SDL_config.h"
    23 
    24 /* CPU feature detection for SDL */
    25 
    26 #include "SDL.h"
    27 #include "SDL_cpuinfo.h"
    28 
    29 #if defined(__MACOSX__) && (defined(__ppc__) || defined(__ppc64__))
    30 #include <sys/sysctl.h> /* For AltiVec check */
    31 #elif defined(__OpenBSD__) && defined(__powerpc__)
    32 #include <sys/param.h>
    33 #include <sys/sysctl.h> /* For AltiVec check */
    34 #include <machine/cpu.h>
    35 #elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP
    36 #include <signal.h>
    37 #include <setjmp.h>
    38 #endif
    39 
    40 #define CPU_HAS_RDTSC	0x00000001
    41 #define CPU_HAS_MMX	0x00000002
    42 #define CPU_HAS_MMXEXT	0x00000004
    43 #define CPU_HAS_3DNOW	0x00000010
    44 #define CPU_HAS_3DNOWEXT 0x00000020
    45 #define CPU_HAS_SSE	0x00000040
    46 #define CPU_HAS_SSE2	0x00000080
    47 #define CPU_HAS_ALTIVEC	0x00000100
    48 #define CPU_HAS_ARM_SIMD 0x00000200
    49 #define CPU_HAS_ARM_NEON 0x00000400
    50 
    51 #if SDL_ALTIVEC_BLITTERS && HAVE_SETJMP && !__MACOSX__ && !__OpenBSD__
    52 /* This is the brute force way of detecting instruction sets...
    53    the idea is borrowed from the libmpeg2 library - thanks!
    54  */
    55 static jmp_buf jmpbuf;
    56 static void illegal_instruction(int sig)
    57 {
    58 	longjmp(jmpbuf, 1);
    59 }
    60 #endif /* HAVE_SETJMP */
    61 
    62 static __inline__ int CPU_haveCPUID(void)
    63 {
    64 	int has_CPUID = 0;
    65 #if defined(__GNUC__) && defined(i386)
    66 	__asm__ (
    67 "        pushfl                      # Get original EFLAGS             \n"
    68 "        popl    %%eax                                                 \n"
    69 "        movl    %%eax,%%ecx                                           \n"
    70 "        xorl    $0x200000,%%eax     # Flip ID bit in EFLAGS           \n"
    71 "        pushl   %%eax               # Save new EFLAGS value on stack  \n"
    72 "        popfl                       # Replace current EFLAGS value    \n"
    73 "        pushfl                      # Get new EFLAGS                  \n"
    74 "        popl    %%eax               # Store new EFLAGS in EAX         \n"
    75 "        xorl    %%ecx,%%eax         # Can not toggle ID bit,          \n"
    76 "        jz      1f                  # Processor=80486                 \n"
    77 "        movl    $1,%0               # We have CPUID support           \n"
    78 "1:                                                                    \n"
    79 	: "=m" (has_CPUID)
    80 	:
    81 	: "%eax", "%ecx"
    82 	);
    83 #elif defined(__GNUC__) && defined(__x86_64__)
    84 /* Technically, if this is being compiled under __x86_64__ then it has 
    85 CPUid by definition.  But it's nice to be able to prove it.  :)      */
    86 	__asm__ (
    87 "        pushfq                      # Get original EFLAGS             \n"
    88 "        popq    %%rax                                                 \n"
    89 "        movq    %%rax,%%rcx                                           \n"
    90 "        xorl    $0x200000,%%eax     # Flip ID bit in EFLAGS           \n"
    91 "        pushq   %%rax               # Save new EFLAGS value on stack  \n"
    92 "        popfq                       # Replace current EFLAGS value    \n"
    93 "        pushfq                      # Get new EFLAGS                  \n"
    94 "        popq    %%rax               # Store new EFLAGS in EAX         \n"
    95 "        xorl    %%ecx,%%eax         # Can not toggle ID bit,          \n"
    96 "        jz      1f                  # Processor=80486                 \n"
    97 "        movl    $1,%0               # We have CPUID support           \n"
    98 "1:                                                                    \n"
    99 	: "=m" (has_CPUID)
   100 	:
   101 	: "%rax", "%rcx"
   102 	);
   103 #elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)
   104 	__asm {
   105         pushfd                      ; Get original EFLAGS
   106         pop     eax
   107         mov     ecx, eax
   108         xor     eax, 200000h        ; Flip ID bit in EFLAGS
   109         push    eax                 ; Save new EFLAGS value on stack
   110         popfd                       ; Replace current EFLAGS value
   111         pushfd                      ; Get new EFLAGS
   112         pop     eax                 ; Store new EFLAGS in EAX
   113         xor     eax, ecx            ; Can not toggle ID bit,
   114         jz      done                ; Processor=80486
   115         mov     has_CPUID,1         ; We have CPUID support
   116 done:
   117 	}
   118 #elif defined(__sun) && defined(__i386)
   119 	__asm (
   120 "       pushfl                 \n"
   121 "	popl    %eax           \n"
   122 "	movl    %eax,%ecx      \n"
   123 "	xorl    $0x200000,%eax \n"
   124 "	pushl   %eax           \n"
   125 "	popfl                  \n"
   126 "	pushfl                 \n"
   127 "	popl    %eax           \n"
   128 "	xorl    %ecx,%eax      \n"
   129 "	jz      1f             \n"
   130 "	movl    $1,-8(%ebp)    \n"
   131 "1:                            \n"
   132 	);
   133 #elif defined(__sun) && defined(__amd64)
   134 	__asm (
   135 "       pushfq                 \n"
   136 "       popq    %rax           \n"
   137 "       movq    %rax,%rcx      \n"
   138 "       xorl    $0x200000,%eax \n"
   139 "       pushq   %rax           \n"
   140 "       popfq                  \n"
   141 "       pushfq                 \n"
   142 "       popq    %rax           \n"
   143 "       xorl    %ecx,%eax      \n"
   144 "       jz      1f             \n"
   145 "       movl    $1,-8(%rbp)    \n"
   146 "1:                            \n"
   147 	);
   148 #endif
   149 	return has_CPUID;
   150 }
   151 
   152 static __inline__ int CPU_getCPUIDFeatures(void)
   153 {
   154 	int features = 0;
   155 #if defined(__GNUC__) && defined(i386)
   156 	__asm__ (
   157 "        xorl    %%eax,%%eax         # Set up for CPUID instruction    \n"
   158 "        pushl   %%ebx                                                 \n"
   159 "        cpuid                       # Get and save vendor ID          \n"
   160 "        popl    %%ebx                                                 \n"
   161 "        cmpl    $1,%%eax            # Make sure 1 is valid input for CPUID\n"
   162 "        jl      1f                  # We dont have the CPUID instruction\n"
   163 "        xorl    %%eax,%%eax                                           \n"
   164 "        incl    %%eax                                                 \n"
   165 "        pushl   %%ebx                                                 \n"
   166 "        cpuid                       # Get family/model/stepping/features\n"
   167 "        popl    %%ebx                                                 \n"
   168 "        movl    %%edx,%0                                              \n"
   169 "1:                                                                    \n"
   170 	: "=m" (features)
   171 	:
   172 	: "%eax", "%ecx", "%edx"
   173 	);
   174 #elif defined(__GNUC__) && defined(__x86_64__)
   175 	__asm__ (
   176 "        xorl    %%eax,%%eax         # Set up for CPUID instruction    \n"
   177 "        pushq   %%rbx                                                 \n"
   178 "        cpuid                       # Get and save vendor ID          \n"
   179 "        popq    %%rbx                                                 \n"
   180 "        cmpl    $1,%%eax            # Make sure 1 is valid input for CPUID\n"
   181 "        jl      1f                  # We dont have the CPUID instruction\n"
   182 "        xorl    %%eax,%%eax                                           \n"
   183 "        incl    %%eax                                                 \n"
   184 "        pushq   %%rbx                                                 \n"
   185 "        cpuid                       # Get family/model/stepping/features\n"
   186 "        popq    %%rbx                                                 \n"
   187 "        movl    %%edx,%0                                              \n"
   188 "1:                                                                    \n"
   189 	: "=m" (features)
   190 	:
   191 	: "%rax", "%rcx", "%rdx"
   192 	);
   193 #elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)
   194 	__asm {
   195         xor     eax, eax            ; Set up for CPUID instruction
   196         push    ebx
   197         cpuid                       ; Get and save vendor ID
   198         pop     ebx
   199         cmp     eax, 1              ; Make sure 1 is valid input for CPUID
   200         jl      done                ; We dont have the CPUID instruction
   201         xor     eax, eax
   202         inc     eax
   203         push    ebx
   204         cpuid                       ; Get family/model/stepping/features
   205         pop     ebx
   206         mov     features, edx
   207 done:
   208 	}
   209 #elif defined(__sun) && (defined(__i386) || defined(__amd64))
   210 	    __asm(
   211 "        xorl    %eax,%eax         \n"
   212 "        pushl   %ebx              \n"
   213 "        cpuid                     \n"
   214 "        popl    %ebx              \n"
   215 "        cmpl    $1,%eax           \n"
   216 "        jl      1f                \n"
   217 "        xorl    %eax,%eax         \n"
   218 "        incl    %eax              \n"
   219 "        pushl   %ebx              \n"
   220 "        cpuid                     \n"
   221 "        popl    %ebx              \n"
   222 #ifdef __i386
   223 "        movl    %edx,-8(%ebp)     \n"
   224 #else
   225 "        movl    %edx,-8(%rbp)     \n"
   226 #endif
   227 "1:                                \n"
   228 	    );
   229 #endif
   230 	return features;
   231 }
   232 
   233 static __inline__ int CPU_getCPUIDFeaturesExt(void)
   234 {
   235 	int features = 0;
   236 #if defined(__GNUC__) && defined(i386)
   237 	__asm__ (
   238 "        movl    $0x80000000,%%eax   # Query for extended functions    \n"
   239 "        pushl   %%ebx                                                 \n"
   240 "        cpuid                       # Get extended function limit     \n"
   241 "        popl    %%ebx                                                 \n"
   242 "        cmpl    $0x80000001,%%eax                                     \n"
   243 "        jl      1f                  # Nope, we dont have function 800000001h\n"
   244 "        movl    $0x80000001,%%eax   # Setup extended function 800000001h\n"
   245 "        pushl   %%ebx                                                 \n"
   246 "        cpuid                       # and get the information         \n"
   247 "        popl    %%ebx                                                 \n"
   248 "        movl    %%edx,%0                                              \n"
   249 "1:                                                                    \n"
   250 	: "=m" (features)
   251 	:
   252 	: "%eax", "%ecx", "%edx"
   253 	);
   254 #elif defined(__GNUC__) && defined (__x86_64__)
   255 	__asm__ (
   256 "        movl    $0x80000000,%%eax   # Query for extended functions    \n"
   257 "        pushq   %%rbx                                                 \n"
   258 "        cpuid                       # Get extended function limit     \n"
   259 "        popq    %%rbx                                                 \n"
   260 "        cmpl    $0x80000001,%%eax                                     \n"
   261 "        jl      1f                  # Nope, we dont have function 800000001h\n"
   262 "        movl    $0x80000001,%%eax   # Setup extended function 800000001h\n"
   263 "        pushq   %%rbx                                                 \n"
   264 "        cpuid                       # and get the information         \n"
   265 "        popq    %%rbx                                                 \n"
   266 "        movl    %%edx,%0                                              \n"
   267 "1:                                                                    \n"
   268 	: "=m" (features)
   269 	:
   270 	: "%rax", "%rcx", "%rdx"
   271 	);
   272 #elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)
   273 	__asm {
   274         mov     eax,80000000h       ; Query for extended functions
   275         push    ebx
   276         cpuid                       ; Get extended function limit
   277         pop     ebx
   278         cmp     eax,80000001h
   279         jl      done                ; Nope, we dont have function 800000001h
   280         mov     eax,80000001h       ; Setup extended function 800000001h
   281         push    ebx
   282         cpuid                       ; and get the information
   283         pop     ebx
   284         mov     features,edx
   285 done:
   286 	}
   287 #elif defined(__sun) && ( defined(__i386) || defined(__amd64) )
   288 	    __asm (
   289 "        movl    $0x80000000,%eax \n"
   290 "        pushl   %ebx             \n"
   291 "        cpuid                    \n"
   292 "        popl    %ebx             \n"
   293 "        cmpl    $0x80000001,%eax \n"
   294 "        jl      1f               \n"
   295 "        movl    $0x80000001,%eax \n"
   296 "        pushl   %ebx             \n"
   297 "        cpuid                    \n"
   298 "        popl    %ebx             \n"
   299 #ifdef __i386
   300 "        movl    %edx,-8(%ebp)   \n"
   301 #else
   302 "        movl    %edx,-8(%rbp)   \n"
   303 #endif
   304 "1:                               \n"
   305 	    );
   306 #endif
   307 	return features;
   308 }
   309 
   310 static __inline__ int CPU_haveRDTSC(void)
   311 {
   312 	if ( CPU_haveCPUID() ) {
   313 		return (CPU_getCPUIDFeatures() & 0x00000010);
   314 	}
   315 	return 0;
   316 }
   317 
   318 static __inline__ int CPU_haveMMX(void)
   319 {
   320 	if ( CPU_haveCPUID() ) {
   321 		return (CPU_getCPUIDFeatures() & 0x00800000);
   322 	}
   323 	return 0;
   324 }
   325 
   326 static __inline__ int CPU_haveMMXExt(void)
   327 {
   328 	if ( CPU_haveCPUID() ) {
   329 		return (CPU_getCPUIDFeaturesExt() & 0x00400000);
   330 	}
   331 	return 0;
   332 }
   333 
   334 static __inline__ int CPU_have3DNow(void)
   335 {
   336 	if ( CPU_haveCPUID() ) {
   337 		return (CPU_getCPUIDFeaturesExt() & 0x80000000);
   338 	}
   339 	return 0;
   340 }
   341 
   342 static __inline__ int CPU_have3DNowExt(void)
   343 {
   344 	if ( CPU_haveCPUID() ) {
   345 		return (CPU_getCPUIDFeaturesExt() & 0x40000000);
   346 	}
   347 	return 0;
   348 }
   349 
   350 static __inline__ int CPU_haveSSE(void)
   351 {
   352 	if ( CPU_haveCPUID() ) {
   353 		return (CPU_getCPUIDFeatures() & 0x02000000);
   354 	}
   355 	return 0;
   356 }
   357 
   358 static __inline__ int CPU_haveSSE2(void)
   359 {
   360 	if ( CPU_haveCPUID() ) {
   361 		return (CPU_getCPUIDFeatures() & 0x04000000);
   362 	}
   363 	return 0;
   364 }
   365 
   366 static __inline__ int CPU_haveAltiVec(void)
   367 {
   368 	volatile int altivec = 0;
   369 #if (defined(__MACOSX__) && (defined(__ppc__) || defined(__ppc64__))) || (defined(__OpenBSD__) && defined(__powerpc__))
   370 # ifdef __OpenBSD__
   371 	int selectors[2] = { CTL_MACHDEP, CPU_ALTIVEC };
   372 # else
   373 	int selectors[2] = { CTL_HW, HW_VECTORUNIT };
   374 # endif
   375 	int hasVectorUnit = 0; 
   376 	size_t length = sizeof(hasVectorUnit); 
   377 	int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0); 
   378 	if( 0 == error )
   379 		altivec = (hasVectorUnit != 0); 
   380 #elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP
   381 	void (*handler)(int sig);
   382 	handler = signal(SIGILL, illegal_instruction);
   383 	if ( setjmp(jmpbuf) == 0 ) {
   384 		asm volatile ("mtspr 256, %0\n\t"
   385 			      "vand %%v0, %%v0, %%v0"
   386 			      :
   387 			      : "r" (-1));
   388 		altivec = 1;
   389 	}
   390 	signal(SIGILL, handler);
   391 #endif
   392 	return altivec; 
   393 }
   394 
   395 #ifdef __linux__
   396 
   397 #include <unistd.h>
   398 #include <sys/types.h>
   399 #include <sys/stat.h>
   400 #include <fcntl.h>
   401 #include <elf.h>
   402 
   403 static __inline__ int CPU_haveARMSIMD(void)
   404 {
   405 	int arm_simd = 0;
   406 	int fd;
   407 
   408 	fd = open("/proc/self/auxv", O_RDONLY);
   409 	if (fd >= 0)
   410 	{
   411 		Elf32_auxv_t aux;
   412 		while (read(fd, &aux, sizeof aux) == sizeof aux)
   413 		{
   414 			if (aux.a_type == AT_PLATFORM)
   415 			{
   416 				const char *plat = (const char *) aux.a_un.a_val;
   417 				arm_simd = strncmp(plat, "v6l", 3) == 0 ||
   418 				           strncmp(plat, "v7l", 3) == 0;
   419 			}
   420 		}
   421 		close(fd);
   422 	}
   423 	return arm_simd;
   424 }
   425 
   426 static __inline__ int CPU_haveARMNEON(void)
   427 {
   428 	int arm_neon = 0;
   429 	int fd;
   430 
   431 	fd = open("/proc/self/auxv", O_RDONLY);
   432 	if (fd >= 0)
   433 	{
   434 		Elf32_auxv_t aux;
   435 		while (read(fd, &aux, sizeof aux) == sizeof aux)
   436 		{
   437 			if (aux.a_type == AT_HWCAP)
   438 				arm_neon = (aux.a_un.a_val & 4096) != 0;
   439 		}
   440 		close(fd);
   441 	}
   442 	return arm_neon;
   443 }
   444 
   445 #else
   446 
   447 static __inline__ int CPU_haveARMSIMD(void)
   448 {
   449 	return 0;
   450 }
   451 
   452 static __inline__ int CPU_haveARMNEON(void)
   453 {
   454 	return 0;
   455 }
   456 
   457 #endif
   458 
   459 static Uint32 SDL_CPUFeatures = 0xFFFFFFFF;
   460 
   461 static Uint32 SDL_GetCPUFeatures(void)
   462 {
   463 	if ( SDL_CPUFeatures == 0xFFFFFFFF ) {
   464 		SDL_CPUFeatures = 0;
   465 		if ( CPU_haveRDTSC() ) {
   466 			SDL_CPUFeatures |= CPU_HAS_RDTSC;
   467 		}
   468 		if ( CPU_haveMMX() ) {
   469 			SDL_CPUFeatures |= CPU_HAS_MMX;
   470 		}
   471 		if ( CPU_haveMMXExt() ) {
   472 			SDL_CPUFeatures |= CPU_HAS_MMXEXT;
   473 		}
   474 		if ( CPU_have3DNow() ) {
   475 			SDL_CPUFeatures |= CPU_HAS_3DNOW;
   476 		}
   477 		if ( CPU_have3DNowExt() ) {
   478 			SDL_CPUFeatures |= CPU_HAS_3DNOWEXT;
   479 		}
   480 		if ( CPU_haveSSE() ) {
   481 			SDL_CPUFeatures |= CPU_HAS_SSE;
   482 		}
   483 		if ( CPU_haveSSE2() ) {
   484 			SDL_CPUFeatures |= CPU_HAS_SSE2;
   485 		}
   486 		if ( CPU_haveAltiVec() ) {
   487 			SDL_CPUFeatures |= CPU_HAS_ALTIVEC;
   488 		}
   489 		if ( CPU_haveARMSIMD() ) {
   490 			SDL_CPUFeatures |= CPU_HAS_ARM_SIMD;
   491 		}
   492 		if ( CPU_haveARMNEON() ) {
   493 			SDL_CPUFeatures |= CPU_HAS_ARM_NEON;
   494 		}
   495 	}
   496 	return SDL_CPUFeatures;
   497 }
   498 
   499 SDL_bool SDL_HasRDTSC(void)
   500 {
   501 	if ( SDL_GetCPUFeatures() & CPU_HAS_RDTSC ) {
   502 		return SDL_TRUE;
   503 	}
   504 	return SDL_FALSE;
   505 }
   506 
   507 SDL_bool SDL_HasMMX(void)
   508 {
   509 	if ( SDL_GetCPUFeatures() & CPU_HAS_MMX ) {
   510 		return SDL_TRUE;
   511 	}
   512 	return SDL_FALSE;
   513 }
   514 
   515 SDL_bool SDL_HasMMXExt(void)
   516 {
   517 	if ( SDL_GetCPUFeatures() & CPU_HAS_MMXEXT ) {
   518 		return SDL_TRUE;
   519 	}
   520 	return SDL_FALSE;
   521 }
   522 
   523 SDL_bool SDL_Has3DNow(void)
   524 {
   525 	if ( SDL_GetCPUFeatures() & CPU_HAS_3DNOW ) {
   526 		return SDL_TRUE;
   527 	}
   528 	return SDL_FALSE;
   529 }
   530 
   531 SDL_bool SDL_Has3DNowExt(void)
   532 {
   533 	if ( SDL_GetCPUFeatures() & CPU_HAS_3DNOWEXT ) {
   534 		return SDL_TRUE;
   535 	}
   536 	return SDL_FALSE;
   537 }
   538 
   539 SDL_bool SDL_HasSSE(void)
   540 {
   541 	if ( SDL_GetCPUFeatures() & CPU_HAS_SSE ) {
   542 		return SDL_TRUE;
   543 	}
   544 	return SDL_FALSE;
   545 }
   546 
   547 SDL_bool SDL_HasSSE2(void)
   548 {
   549 	if ( SDL_GetCPUFeatures() & CPU_HAS_SSE2 ) {
   550 		return SDL_TRUE;
   551 	}
   552 	return SDL_FALSE;
   553 }
   554 
   555 SDL_bool SDL_HasAltiVec(void)
   556 {
   557 	if ( SDL_GetCPUFeatures() & CPU_HAS_ALTIVEC ) {
   558 		return SDL_TRUE;
   559 	}
   560 	return SDL_FALSE;
   561 }
   562 
   563 SDL_bool SDL_HasARMSIMD(void)
   564 {
   565 	if ( SDL_GetCPUFeatures() & CPU_HAS_ARM_SIMD ) {
   566 		return SDL_TRUE;
   567 	}
   568 	return SDL_FALSE;
   569 }
   570 
   571 SDL_bool SDL_HasARMNEON(void)
   572 {
   573 	if ( SDL_GetCPUFeatures() & CPU_HAS_ARM_NEON ) {
   574 		return SDL_TRUE;
   575 	}
   576 	return SDL_FALSE;
   577 }
   578 
   579 #ifdef TEST_MAIN
   580 
   581 #include <stdio.h>
   582 
   583 int main()
   584 {
   585 	printf("RDTSC: %d\n", SDL_HasRDTSC());
   586 	printf("MMX: %d\n", SDL_HasMMX());
   587 	printf("MMXExt: %d\n", SDL_HasMMXExt());
   588 	printf("3DNow: %d\n", SDL_Has3DNow());
   589 	printf("3DNowExt: %d\n", SDL_Has3DNowExt());
   590 	printf("SSE: %d\n", SDL_HasSSE());
   591 	printf("SSE2: %d\n", SDL_HasSSE2());
   592 	printf("AltiVec: %d\n", SDL_HasAltiVec());
   593 	printf("ARM SIMD: %d\n", SDL_HasARMSIMD());
   594 	printf("ARM NEON: %d\n", SDL_HasARMNEON());
   595 	return 0;
   596 }
   597 
   598 #endif /* TEST_MAIN */