Skip to content

Commit

Permalink
Supported Android and Apple hardware has ARM SIMD capability
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Nov 13, 2019
1 parent 9a76beb commit a63e93a
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/cpuinfo/SDL_cpuinfo.c
Expand Up @@ -334,16 +334,20 @@ CPU_haveAltiVec(void)
}

#if !defined(__ARM_ARCH)
static SDL_bool CPU_haveARMSIMD(void) { return 0; }
static int
CPU_haveARMSIMD(void)
{
return 0;
}

#elif defined(__linux__)
#elif defined(__LINUX__)
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <elf.h>

static SDL_bool
static int
CPU_haveARMSIMD(void)
{
int arm_simd = 0;
Expand All @@ -368,11 +372,13 @@ CPU_haveARMSIMD(void)
}

#else
static SDL_bool
static int
CPU_haveARMSIMD(void)
{
#warning SDL_HasARMSIMD is not implemented for this ARM platform. Write me.
return 0;
#if !defined(__ANDROID__) && !defined(__IPHONEOS__) && !defined(__TVOS__)
#warning SDL_HasARMSIMD is not implemented for this ARM platform, defaulting to TRUE
#endif
return 1;
}
#endif

Expand Down

0 comments on commit a63e93a

Please sign in to comment.