mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-04 17:06:25 +00:00
Fixed bug 5402 - ARM support little update proposal
David Carlier No fix but mostly an update for ARM architecture.
This commit is contained in:
@@ -138,6 +138,8 @@ SDL_AtomicTryLock(SDL_SpinLock *lock)
|
||||
/* "REP NOP" is PAUSE, coded for tools that don't know it by that name. */
|
||||
#if (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))
|
||||
#define PAUSE_INSTRUCTION() __asm__ __volatile__("pause\n") /* Some assemblers can't do REP NOP, so go with PAUSE. */
|
||||
#elif (defined(__arm__) && __ARM_ARCH__ >= 7) || defined(__aarch64__)
|
||||
#define PAUSE_INSTRUCTION() __asm__ __volatile__("yield" ::: "memory")
|
||||
#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
|
||||
#define PAUSE_INSTRUCTION() _mm_pause() /* this is actually "rep nop" and not a SIMD instruction. No inline asm in MSVC x86-64! */
|
||||
#elif defined(__WATCOMC__) && defined(__386__)
|
||||
|
@@ -54,6 +54,9 @@
|
||||
#include <sys/param.h>
|
||||
#include <sys/sysctl.h> /* For AltiVec check */
|
||||
#include <machine/cpu.h>
|
||||
#if defined(HAVE_ELF_AUX_INFO)
|
||||
#include <sys/auxv.h>
|
||||
#endif
|
||||
#elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP
|
||||
#include <signal.h>
|
||||
#include <setjmp.h>
|
||||
@@ -462,6 +465,11 @@ CPU_haveNEON(void)
|
||||
return 0; /* assume anything else from Apple doesn't have NEON. */
|
||||
#elif defined(__OpenBSD__)
|
||||
return 1; /* OpenBSD only supports ARMv7 CPUs that have NEON. */
|
||||
#elif defined(HAVE_ELF_AUX_INFO)
|
||||
unsigned long hasneon = 0;
|
||||
if (elf_aux_info(AT_HWCAP, (void *)&hasneon, (int)sizeof(hasneon)) != 0)
|
||||
return 0;
|
||||
return ((hasneon & HWCAP_NEON) == HWCAP_NEON);
|
||||
#elif !defined(__arm__)
|
||||
return 0; /* not an ARM CPU at all. */
|
||||
#elif defined(__QNXNTO__)
|
||||
|
Reference in New Issue
Block a user