mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 06:34:35 +00:00
Android: remove old cpu-feature code, and fix build (add HAVE_GETAUXV… (#14460)
This commit is contained in:
parent
e2e8f86076
commit
4cc9153df2
1 changed files with 2 additions and 14 deletions
|
|
@ -76,7 +76,7 @@
|
|||
#include <sys/param.h>
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_GETAUXVAL) || defined(HAVE_ELF_AUX_INFO)
|
||||
#if defined(HAVE_GETAUXVAL) || defined(HAVE_ELF_AUX_INFO) || defined(SDL_PLATFORM_ANDROID)
|
||||
#include <sys/auxv.h>
|
||||
#endif
|
||||
|
||||
|
|
@ -488,22 +488,10 @@ static int CPU_haveNEON(void)
|
|||
return 0;
|
||||
}
|
||||
return (hasneon & HWCAP_NEON) == HWCAP_NEON;
|
||||
#elif (defined(SDL_PLATFORM_LINUX) || defined(SDL_PLATFORM_ANDROID)) && defined(HAVE_GETAUXVAL)
|
||||
#elif (defined(SDL_PLATFORM_LINUX) && defined(HAVE_GETAUXVAL)) || defined(SDL_PLATFORM_ANDROID)
|
||||
return (getauxval(AT_HWCAP) & HWCAP_NEON) == HWCAP_NEON;
|
||||
#elif defined(SDL_PLATFORM_LINUX)
|
||||
return readProcAuxvForNeon();
|
||||
#elif defined(SDL_PLATFORM_ANDROID)
|
||||
// Use NDK cpufeatures to read either /proc/self/auxv or /proc/cpuinfo
|
||||
{
|
||||
AndroidCpuFamily cpu_family = android_getCpuFamily();
|
||||
if (cpu_family == ANDROID_CPU_FAMILY_ARM) {
|
||||
uint64_t cpu_features = android_getCpuFeatures();
|
||||
if (cpu_features & ANDROID_CPU_ARM_FEATURE_NEON) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#elif defined(SDL_PLATFORM_RISCOS)
|
||||
// Use the VFPSupport_Features SWI to access the MVFR registers
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue