From 9078341a06b05e41236e9cd5d6d0314da7eb8eec Mon Sep 17 00:00:00 2001 From: yamashi Date: Tue, 15 Dec 2020 23:00:33 +0100 Subject: [PATCH] Fix AVX support, apparently it's more complicated than just 1 bit https://insufficientlycomplicated.wordpress.com/2011/11/07/detecting-intel-advanced-vector-extensions-avx-in-visual-studio/ --- src/avx_patch.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/avx_patch.cpp b/src/avx_patch.cpp index 17806d69..ea10773e 100644 --- a/src/avx_patch.cpp +++ b/src/avx_patch.cpp @@ -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;