From 52c0c777f59fd6a56a9e3c3f40175caef723c4ef Mon Sep 17 00:00:00 2001 From: LoRd_MuldeR Date: Sat, 20 Feb 2016 17:41:15 +0100 Subject: [PATCH] More accurate way to check whether AVX OS-support is enabled. --- MUtilities_VS2010.vcxproj | 2 +- src/CPUFeatures_Win32.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MUtilities_VS2010.vcxproj b/MUtilities_VS2010.vcxproj index f940c57..cbb59a7 100644 --- a/MUtilities_VS2010.vcxproj +++ b/MUtilities_VS2010.vcxproj @@ -1,5 +1,5 @@  - + Debug diff --git a/src/CPUFeatures_Win32.cpp b/src/CPUFeatures_Win32.cpp index 32b58a8..1220744 100644 --- a/src/CPUFeatures_Win32.cpp +++ b/src/CPUFeatures_Win32.cpp @@ -63,7 +63,7 @@ MUtils::CPUFetaures::cpu_info_t MUtils::CPUFetaures::detect(void) if(CPUInfo[2] & 0x00100000) features.features |= FLAG_SSE42; if ((CPUInfo[2] & 0x18000000) == 0x18000000) { - if (IsProcessorFeaturePresent(PF_XSAVE_ENABLED)) /*AVX requires OS support!*/ + if((_xgetbv(0) & 0x6ui64) == 0x6ui64) /*AVX requires OS support!*/ { features.features |= FLAG_AVX; }