1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-08 12:15:49 +00:00

Style nits.

This commit is contained in:
Themaister 2012-11-05 11:57:40 +01:00
parent af648b6598
commit aa6d291707
3 changed files with 15 additions and 18 deletions

View File

@ -147,34 +147,31 @@ void rarch_get_cpu_features(struct rarch_cpu_features *cpu)
x86_cpuid(1, flags);
if(flags[3] & (1 << 25))
if (flags[3] & (1 << 25))
cpu->simd |= RARCH_SIMD_SSE;
if(flags[3] & (1 << 26))
if (flags[3] & (1 << 26))
cpu->simd |= RARCH_SIMD_SSE2;
int avx_flags = (1 << 27) | (1 << 28);
if((flags[2] & avx_flags) == avx_flags)
const int avx_flags = (1 << 27) | (1 << 28);
if ((flags[2] & avx_flags) == avx_flags)
cpu->simd |= RARCH_SIMD_AVX;
RARCH_LOG("[CPUID]: SSE: %d\n", (cpu->simd & RARCH_SIMD_SSE) == RARCH_SIMD_SSE);
RARCH_LOG("[CPUID]: SSE2: %d\n", (cpu->simd & RARCH_SIMD_SSE2) == RARCH_SIMD_SSE2);
RARCH_LOG("[CPUID]: AVX: %d\n", (cpu->simd & RARCH_SIMD_AVX) == 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]: AVX: %u\n", cpu->simd & RARCH_SIMD_AVX);
#elif defined(ANDROID) && defined(ANDROID_ARM)
uint64_t cpu_flags = android_getCpuFeatures();
if(cpu_flags & ANDROID_CPU_ARM_FEATURE_NEON)
if (cpu_flags & ANDROID_CPU_ARM_FEATURE_NEON)
cpu->simd |= RARCH_SIMD_NEON;
RARCH_LOG("[CPUID]: NEON: %d\n", (cpu->simd & RARCH_SIMD_NEON) == RARCH_SIMD_NEON);
RARCH_LOG("[CPUID]: NEON: %u\n", cpu->simd & RARCH_SIMD_NEON);
#elif defined(__CELLOS_LV2__)
cpu->simd |= RARCH_SIMD_VMX;
RARCH_LOG("[CPUID]: VMX: %d\n", (cpu->simd & RARCH_SIMD_VMX) == RARCH_SIMD_VMX);
RARCH_LOG("[CPUID]: VMX: %u\n", cpu->simd & RARCH_SIMD_VMX);
#elif defined(XBOX360)
cpu->simd |= RARCH_SIMD_VMX128;
RARCH_LOG("[CPUID]: VMX128: %d\n", (cpu->simd & RARCH_SIMD_VMX128) == RARCH_SIMD_VMX128);
RARCH_LOG("[CPUID]: VMX128: %u\n", cpu->simd & RARCH_SIMD_VMX128);
#endif
}

View File

@ -42,7 +42,7 @@ void rarch_perf_log(void);
struct rarch_cpu_features
{
uint32_t simd;
unsigned simd;
};
// Id values for SIMD CPU features

View File

@ -2594,15 +2594,15 @@ static void validate_cpu_features(void)
} while(0)
#ifdef __SSE__
if ((cpu.simd & RARCH_SIMD_SSE) != RARCH_SIMD_SSE)
if (!(cpu.simd & RARCH_SIMD_SSE))
FAIL_CPU("SSE");
#endif
#ifdef __SSE2__
if ((cpu.simd & RARCH_SIMD_SSE2) != RARCH_SIMD_SSE2)
if (!(cpu.simd & RARCH_SIMD_SSE2))
FAIL_CPU("SSE2");
#endif
#ifdef __AVX__
if ((cpu.simd & RARCH_SIMD_AVX) != RARCH_SIMD_AVX)
if (!(cpu.simd & RARCH_SIMD_AVX))
FAIL_CPU("AVX");
#endif
}