Add SSSE3 detection as well.

This commit is contained in:
Themaister 2013-12-12 10:56:21 +01:00
parent 669959600a
commit 1a8d009b20
2 changed files with 9 additions and 4 deletions

View File

@ -222,14 +222,18 @@ void rarch_get_cpu_features(struct rarch_cpu_features *cpu)
if (flags[2] & (1 << 0))
cpu->simd |= RARCH_SIMD_SSE3;
if (flags[2] & (1 << 9))
cpu->simd |= RARCH_SIMD_SSSE3;
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));
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]: SSSE3: %u\n", !!(cpu->simd & RARCH_SIMD_SSSE3));
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

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