OSDN Git Service

More accurate way to check whether AVX OS-support is enabled.
authorLoRd_MuldeR <mulder2@gmx.de>
Sat, 20 Feb 2016 16:41:15 +0000 (17:41 +0100)
committerLoRd_MuldeR <mulder2@gmx.de>
Sat, 20 Feb 2016 16:41:15 +0000 (17:41 +0100)
MUtilities_VS2010.vcxproj
src/CPUFeatures_Win32.cpp

index f940c57..cbb59a7 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
       <Configuration>Debug</Configuration>
index 32b58a8..1220744 100644 (file)
@@ -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;
                        }