Verify that NEON code isn't run for non-NEON.

This commit is contained in:
Themaister 2013-01-06 00:20:26 +01:00
parent a3a0fbca36
commit 6e0e221f1b
2 changed files with 7 additions and 3 deletions

View File

@ -93,10 +93,8 @@ rarch_perf_tick_t rarch_get_perf_counter(void)
#endif
#if defined(__x86_64__) || defined(__i386__) || defined(__i486__) || defined(__i686__)
#if !defined(ANDROID_ARM) || !defined(ANDROID_MIPS)
#define CPU_X86
#endif
#endif
#if defined(_MSC_VER) && !defined(_XBOX)
#include <intrin.h>
@ -122,9 +120,11 @@ static void x86_cpuid(int func, int flags[4])
"xchg %%" REG_b ", %%" REG_S "\n"
: "=a"(flags[0]), "=S"(flags[1]), "=c"(flags[2]), "=d"(flags[3])
: "a"(func));
#elif defined(_MSC_VER)
__cpuid(flags, func);
#else
RARCH_WARN("Unknown compiler. Cannot check CPUID with inline assembly.\n");
memset(flags, 0, 4 * sizeof(int));
#endif
}
#endif

View File

@ -2637,6 +2637,10 @@ static void validate_cpu_features(void)
if (!(cpu.simd & RARCH_SIMD_AVX))
FAIL_CPU("AVX");
#endif
#ifdef HAVE_NEON
if (!(cpu.simd & RARCH_SIMD_NEON))
FAIL_CPU("NEON");
#endif
}
int rarch_main_init(int argc, char *argv[])