More accurate way to check whether AVX OS-support is enabled.

This commit is contained in:
LoRd_MuldeR 2016-02-20 17:41:15 +01:00
parent e11b531d86
commit 52c0c777f5
2 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?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"> <ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32"> <ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>

View 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] & 0x00100000) features.features |= FLAG_SSE42;
if ((CPUInfo[2] & 0x18000000) == 0x18000000) 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; features.features |= FLAG_AVX;
} }