diff --git a/Common/CPUDetect.cpp b/Common/CPUDetect.cpp index 4972d20496..8618340f3f 100644 --- a/Common/CPUDetect.cpp +++ b/Common/CPUDetect.cpp @@ -196,10 +196,11 @@ void CPUInfo::Detect() { // So let's just not bother with AVX on Android for now. #ifndef ANDROID // AVX support requires 3 separate checks: - // - Is the AVX bit set in CPUID? - // - Is the XSAVE bit set in CPUID? + // - Is the AVX bit set in CPUID? (>>28) + // - Is the XSAVE bit set in CPUID? ( >>26) + // - Is the OSXSAVE bit set in CPUID? ( >>27) // - XGETBV result has the XCR bit set. - if (((cpu_id[2] >> 28) & 1) && ((cpu_id[2] >> 27) & 1)) + if (((cpu_id[2] >> 28) & 1) && ((cpu_id[2] >> 27) & 1) && ((cpu_id[2] >> 26) & 1)) { if ((_xgetbv(_XCR_XFEATURE_ENABLED_MASK) & 0x6) == 0x6) { diff --git a/Common/x64Emitter.h b/Common/x64Emitter.h index 8b60cc34b4..5e831f7f71 100644 --- a/Common/x64Emitter.h +++ b/Common/x64Emitter.h @@ -22,11 +22,11 @@ #include "Common.h" -#ifdef _M_X64 +#if defined(_M_X64) && !defined(_ARCH_64) #define _ARCH_64 #endif -#ifdef _M_X64 +#ifdef _ARCH_64 #define PTRBITS 64 #else #define PTRBITS 32