Skip to content

Commit 68eb314

Browse files
authored
Add xcr0 (os support) check
1 parent 0afaae4 commit 68eb314

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cpuid_x86.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ int support_avx512(){
239239
ret=0; //OS does not even support AVX2
240240
}
241241
if((ebx & (1<<31)) != 0){
242+
xgetbv(0, &eax, &edx);
243+
if((eax & 0xe0) == 0xe0)
242244
ret=1; //OS supports AVX512VL
243245
}
244246
return ret;

0 commit comments

Comments
 (0)