mirror of https://github.com/encounter/SDL.git
Fixed bug 5402 - ARM support little update proposal
David Carlier No fix but mostly an update for ARM architecture.
This commit is contained in:
parent
10625f9d89
commit
6bd4c717a1
|
@ -834,6 +834,7 @@ if(LIBC)
|
||||||
check_symbol_exists(sysconf "unistd.h" HAVE_SYSCONF)
|
check_symbol_exists(sysconf "unistd.h" HAVE_SYSCONF)
|
||||||
check_symbol_exists(sysctlbyname "sys/types.h;sys/sysctl.h" HAVE_SYSCTLBYNAME)
|
check_symbol_exists(sysctlbyname "sys/types.h;sys/sysctl.h" HAVE_SYSCTLBYNAME)
|
||||||
check_symbol_exists(getauxval "sys/auxv.h" HAVE_GETAUXVAL)
|
check_symbol_exists(getauxval "sys/auxv.h" HAVE_GETAUXVAL)
|
||||||
|
check_symbol_exists(elf_aux_info "sys/auxv.h" HAVE_ELF_AUX_INFO)
|
||||||
check_symbol_exists(poll "poll.h" HAVE_POLL)
|
check_symbol_exists(poll "poll.h" HAVE_POLL)
|
||||||
|
|
||||||
check_library_exists(m pow "" HAVE_LIBM)
|
check_library_exists(m pow "" HAVE_LIBM)
|
||||||
|
|
|
@ -17071,7 +17071,7 @@ fi
|
||||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for ac_func in malloc calloc realloc free getenv setenv putenv unsetenv qsort abs bcopy memset memcpy memmove wcslen wcslcpy wcslcat wcsdup wcsstr wcscmp wcsncmp wcscasecmp _wcsicmp wcsncasecmp _wcsnicmp strlen strlcpy strlcat _strrev _strupr _strlwr strchr strrchr strstr strtok_r itoa _ltoa _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp vsscanf vsnprintf fopen64 fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname getauxval poll _Exit
|
for ac_func in malloc calloc realloc free getenv setenv putenv unsetenv qsort abs bcopy memset memcpy memmove wcslen wcslcpy wcslcat wcsdup wcsstr wcscmp wcsncmp wcscasecmp _wcsicmp wcsncasecmp _wcsnicmp strlen strlcpy strlcat _strrev _strupr _strlwr strchr strrchr strstr strtok_r itoa _ltoa _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp vsscanf vsnprintf fopen64 fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname getauxval elf_aux_info poll _Exit
|
||||||
do :
|
do :
|
||||||
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
||||||
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
|
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
|
||||||
|
|
|
@ -345,7 +345,7 @@ if test x$enable_libc = xyes; then
|
||||||
AC_DEFINE(HAVE_MPROTECT, 1, [ ])
|
AC_DEFINE(HAVE_MPROTECT, 1, [ ])
|
||||||
]),
|
]),
|
||||||
)
|
)
|
||||||
AC_CHECK_FUNCS(malloc calloc realloc free getenv setenv putenv unsetenv qsort abs bcopy memset memcpy memmove wcslen wcslcpy wcslcat wcsdup wcsstr wcscmp wcsncmp wcscasecmp _wcsicmp wcsncasecmp _wcsnicmp strlen strlcpy strlcat _strrev _strupr _strlwr strchr strrchr strstr strtok_r itoa _ltoa _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp vsscanf vsnprintf fopen64 fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname getauxval poll _Exit)
|
AC_CHECK_FUNCS(malloc calloc realloc free getenv setenv putenv unsetenv qsort abs bcopy memset memcpy memmove wcslen wcslcpy wcslcat wcsdup wcsstr wcscmp wcsncmp wcscasecmp _wcsicmp wcsncasecmp _wcsnicmp strlen strlcpy strlcat _strrev _strupr _strlwr strchr strrchr strstr strtok_r itoa _ltoa _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp vsscanf vsnprintf fopen64 fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname getauxval elf_aux_info poll _Exit)
|
||||||
|
|
||||||
AC_CHECK_LIB(m, pow, [LIBS="$LIBS -lm"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"])
|
AC_CHECK_LIB(m, pow, [LIBS="$LIBS -lm"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"])
|
||||||
AC_CHECK_FUNCS(acos acosf asin asinf atan atanf atan2 atan2f ceil ceilf copysign copysignf cos cosf exp expf fabs fabsf floor floorf trunc truncf fmod fmodf log logf log10 log10f pow powf scalbn scalbnf sin sinf sqrt sqrtf tan tanf)
|
AC_CHECK_FUNCS(acos acosf asin asinf atan atanf atan2 atan2f ceil ceilf copysign copysignf cos cosf exp expf fabs fabsf floor floorf trunc truncf fmod fmodf log logf log10 log10f pow powf scalbn scalbnf sin sinf sqrt sqrtf tan tanf)
|
||||||
|
|
|
@ -195,6 +195,7 @@
|
||||||
#cmakedefine HAVE_PTHREAD_SET_NAME_NP 1
|
#cmakedefine HAVE_PTHREAD_SET_NAME_NP 1
|
||||||
#cmakedefine HAVE_SEM_TIMEDWAIT 1
|
#cmakedefine HAVE_SEM_TIMEDWAIT 1
|
||||||
#cmakedefine HAVE_GETAUXVAL 1
|
#cmakedefine HAVE_GETAUXVAL 1
|
||||||
|
#cmakedefine HAVE_ELF_AUX_INFO 1
|
||||||
#cmakedefine HAVE_POLL 1
|
#cmakedefine HAVE_POLL 1
|
||||||
#cmakedefine HAVE__EXIT 1
|
#cmakedefine HAVE__EXIT 1
|
||||||
|
|
||||||
|
|
|
@ -199,6 +199,7 @@
|
||||||
#undef HAVE_PTHREAD_SET_NAME_NP
|
#undef HAVE_PTHREAD_SET_NAME_NP
|
||||||
#undef HAVE_SEM_TIMEDWAIT
|
#undef HAVE_SEM_TIMEDWAIT
|
||||||
#undef HAVE_GETAUXVAL
|
#undef HAVE_GETAUXVAL
|
||||||
|
#undef HAVE_ELF_AUX_INFO
|
||||||
#undef HAVE_POLL
|
#undef HAVE_POLL
|
||||||
#undef HAVE__EXIT
|
#undef HAVE__EXIT
|
||||||
|
|
||||||
|
|
|
@ -138,6 +138,8 @@ SDL_AtomicTryLock(SDL_SpinLock *lock)
|
||||||
/* "REP NOP" is PAUSE, coded for tools that don't know it by that name. */
|
/* "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__))
|
#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. */
|
#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))
|
#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! */
|
#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__)
|
#elif defined(__WATCOMC__) && defined(__386__)
|
||||||
|
|
|
@ -54,6 +54,9 @@
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/sysctl.h> /* For AltiVec check */
|
#include <sys/sysctl.h> /* For AltiVec check */
|
||||||
#include <machine/cpu.h>
|
#include <machine/cpu.h>
|
||||||
|
#if defined(HAVE_ELF_AUX_INFO)
|
||||||
|
#include <sys/auxv.h>
|
||||||
|
#endif
|
||||||
#elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP
|
#elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
|
@ -462,6 +465,11 @@ CPU_haveNEON(void)
|
||||||
return 0; /* assume anything else from Apple doesn't have NEON. */
|
return 0; /* assume anything else from Apple doesn't have NEON. */
|
||||||
#elif defined(__OpenBSD__)
|
#elif defined(__OpenBSD__)
|
||||||
return 1; /* OpenBSD only supports ARMv7 CPUs that have NEON. */
|
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__)
|
#elif !defined(__arm__)
|
||||||
return 0; /* not an ARM CPU at all. */
|
return 0; /* not an ARM CPU at all. */
|
||||||
#elif defined(__QNXNTO__)
|
#elif defined(__QNXNTO__)
|
||||||
|
|
Loading…
Reference in New Issue