Refs #124. Check XSAVE flag on x86 CPU.

This commit is contained in:
Zhang Xianyi 2013-06-06 22:50:43 +08:00
parent f2fb8c7035
commit 65ffead0cf
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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