Skip to content

Commit

Permalink
Fix AVX support, apparently it's more complicated than just 1 bit
Browse files Browse the repository at this point in the history
  • Loading branch information
maximegmd committed Dec 15, 2020
1 parent 64fe487 commit 9078341
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/avx_patch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ bool IsAVXSupported()
__cpuidex(cpui.data(), 1, 0);
std::bitset<32> ecx = cpui[2];

return ecx[28];
if(ecx[27] && ecx[28])
{
return (_xgetbv(_XCR_XFEATURE_ENABLED_MASK) & 6) == 6;
}
}

return false;
Expand Down

0 comments on commit 9078341

Please sign in to comment.