From 6e0e221f1b401a6f915c57444e9a4b38b94b8491 Mon Sep 17 00:00:00 2001 From: Themaister Date: Sun, 6 Jan 2013 00:20:26 +0100 Subject: [PATCH] Verify that NEON code isn't run for non-NEON. --- performance.c | 6 +++--- retroarch.c | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/performance.c b/performance.c index 7eecd4e628..9f4e6b1863 100644 --- a/performance.c +++ b/performance.c @@ -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 @@ -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 diff --git a/retroarch.c b/retroarch.c index 59bc4045fa..67ce7e9dea 100644 --- a/retroarch.c +++ b/retroarch.c @@ -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[])