Add SSE3 detection to performance.c (check if this is correct)

This commit is contained in:
twinaphex 2013-12-12 05:50:22 +01:00
parent ed2724e5ee
commit 669959600a
2 changed files with 5 additions and 0 deletions

View File

@ -219,12 +219,16 @@ void rarch_get_cpu_features(struct rarch_cpu_features *cpu)
if (flags[3] & (1 << 26))
cpu->simd |= RARCH_SIMD_SSE2;
if (flags[2] & (1 << 0))
cpu->simd |= RARCH_SIMD_SSE3;
const int avx_flags = (1 << 27) | (1 << 28);
if ((flags[2] & avx_flags) == avx_flags)
cpu->simd |= RARCH_SIMD_AVX;
RARCH_LOG("[CPUID]: SSE: %u\n", !!(cpu->simd & RARCH_SIMD_SSE));
RARCH_LOG("[CPUID]: SSE2: %u\n", !!(cpu->simd & RARCH_SIMD_SSE2));
RARCH_LOG("[CPUID]: SSE3: %u\n", !!(cpu->simd & RARCH_SIMD_SSE3));
RARCH_LOG("[CPUID]: AVX: %u\n", !!(cpu->simd & RARCH_SIMD_AVX));
#elif defined(ANDROID) && defined(ANDROID_ARM)
uint64_t cpu_flags = android_getCpuFeatures();

View File

@ -57,6 +57,7 @@ struct rarch_cpu_features
#define RARCH_SIMD_VMX128 (1 << 3)
#define RARCH_SIMD_AVX (1 << 4)
#define RARCH_SIMD_NEON (1 << 5)
#define RARCH_SIMD_SSE3 (1 << 6)
void rarch_get_cpu_features(struct rarch_cpu_features *cpu);