diff --git a/cpuid_x86.c b/cpuid_x86.c index 317774691..d66ec5aa6 100644 --- a/cpuid_x86.c +++ b/cpuid_x86.c @@ -130,7 +130,7 @@ int support_avx(){ int ret=0; cpuid(1, &eax, &ebx, &ecx, &edx); - if ((ecx & (1 << 28)) != 0 && (ecx & (1 << 27)) != 0){ + if ((ecx & (1 << 28)) != 0 && (ecx & (1 << 27)) != 0 && (ecx & (1 << 26)) != 0){ xgetbv(0, &eax, &edx); if((eax & 6) == 6){ ret=1; //OS support AVX diff --git a/driver/others/dynamic.c b/driver/others/dynamic.c index 893dd0738..425733add 100644 --- a/driver/others/dynamic.c +++ b/driver/others/dynamic.c @@ -92,7 +92,7 @@ int support_avx(){ int ret=0; cpuid(1, &eax, &ebx, &ecx, &edx); - if ((ecx & (1 << 28)) != 0 && (ecx & (1 << 27)) != 0){ + if ((ecx & (1 << 28)) != 0 && (ecx & (1 << 27)) != 0 && (ecx & (1 << 26)) != 0){ xgetbv(0, &eax, &edx); if((eax & 6) == 6){ ret=1; //OS support AVX