Fix the fix to AVX support detection

Should be xgetbv(0) & 6 == 6, not just & 6. Thanks to tueidj for pointing this
out.
This commit is contained in:
Pierre Bourdon 2013-08-22 01:08:14 +02:00
parent 5f0c892ed0
commit 20e82ec08c

View File

@ -165,7 +165,7 @@ void CPUInfo::Detect()
// - XGETBV result has the XCR bit set. // - 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))
{ {
if (_xgetbv(_XCR_XFEATURE_ENABLED_MASK) & 0x6) if ((_xgetbv(_XCR_XFEATURE_ENABLED_MASK) & 0x6) == 0x6)
bAVX = true; bAVX = true;
} }
} }