diff options
author | Ryan C. Gordon <icculus@icculus.org> | 2016-11-21 20:35:59 -0500 |
---|---|---|
committer | Ryan C. Gordon <icculus@icculus.org> | 2016-11-21 20:35:59 -0500 |
commit | 484ed1dc3060c590b34ab90a49c6451fd91e198c (patch) | |
tree | 5d5cbe5faea5c9d25a2a974f02004a06533f4773 /src/cpuinfo/SDL_cpuinfo.c | |
parent | 9cc7ce9008dc9d1d9bdae1102af7881f3e9dba52 (diff) |
cpuinfo: fix SDL_HasNEON() on older iOS devices, fixed C++ comment.
Diffstat (limited to 'src/cpuinfo/SDL_cpuinfo.c')
-rw-r--r-- | src/cpuinfo/SDL_cpuinfo.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/cpuinfo/SDL_cpuinfo.c b/src/cpuinfo/SDL_cpuinfo.c index 69de2bec8d..c8b0ba7291 100644 --- a/src/cpuinfo/SDL_cpuinfo.c +++ b/src/cpuinfo/SDL_cpuinfo.c @@ -333,13 +333,12 @@ CPU_haveNEON(void) #if defined(SDL_CPUINFO_DISABLED) || !defined(__ARM_ARCH) return 0; /* disabled or not an ARM CPU at all. */ #elif __ARM_ARCH >= 8 - return 1; // ARMv8 always has non-optional NEON support. + return 1; /* ARMv8 always has non-optional NEON support. */ +#elif defined(__APPLE__) && (__ARM_ARCH >= 7) + /* (note that sysctlbyname("hw.optional.neon") doesn't work!) */ + return 1; /* all Apple ARMv7 chips and later have NEON. */ #elif defined(__APPLE__) - /* all hardware that runs iOS 5 and later support NEON, but check anyhow */ - int neon = 0; - size_t length = sizeof (neon); - const int error = sysctlbyname("hw.optional.neon", &neon, &length, NULL, 0); - return (!error) && (neon != 0); + return 0; /* assune anything else from Apple doesn't have NEON. */ #elif (defined(__LINUX__) || defined(__ANDROID__)) && defined(HAVE_GETAUXVAL) return ((getauxval(AT_HWCAP) & HWCAP_NEON) == HWCAP_NEON); #elif (defined(__LINUX__) || defined(__ANDROID__)) |