cpuinfo: Add SDL_HasNEON() support for ARM-based QNX.
authorRyan C. Gordon <icculus@icculus.org>
Wed, 16 Aug 2017 21:31:03 -0400
changeset 1130843e03b947942
parent 11307 003462e40c4f
child 11309 e421d01ce5bf
cpuinfo: Add SDL_HasNEON() support for ARM-based QNX.
src/cpuinfo/SDL_cpuinfo.c
     1.1 --- a/src/cpuinfo/SDL_cpuinfo.c	Tue Aug 15 23:00:54 2017 -0300
     1.2 +++ b/src/cpuinfo/SDL_cpuinfo.c	Wed Aug 16 21:31:03 2017 -0400
     1.3 @@ -50,6 +50,10 @@
     1.4  #include <setjmp.h>
     1.5  #endif
     1.6  
     1.7 +#if defined(__QNXNTO__)
     1.8 +#include <sys/syspage.h>
     1.9 +#endif
    1.10 +
    1.11  #if (defined(__LINUX__) || defined(__ANDROID__)) && defined(__ARM_ARCH)
    1.12  /*#include <asm/hwcap.h>*/
    1.13  #ifndef AT_HWCAP
    1.14 @@ -339,6 +343,8 @@
    1.15      return 1;  /* all Apple ARMv7 chips and later have NEON. */
    1.16  #elif defined(__APPLE__)
    1.17      return 0;  /* assune anything else from Apple doesn't have NEON. */
    1.18 +#elif defined(__QNXNTO__)
    1.19 +    return SYSPAGE_ENTRY(cpuinfo)->flags & ARM_CPU_FLAG_NEON;
    1.20  #elif (defined(__LINUX__) || defined(__ANDROID__)) && defined(HAVE_GETAUXVAL)
    1.21      return ((getauxval(AT_HWCAP) & HWCAP_NEON) == HWCAP_NEON);
    1.22  #elif (defined(__LINUX__) || defined(__ANDROID__))