-
Notifications
You must be signed in to change notification settings - Fork 4.6k
/
GC.asm
36 lines (32 loc) · 1.13 KB
/
GC.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
;; Licensed to the .NET Foundation under one or more agreements.
;; The .NET Foundation licenses this file to you under the MIT license.
include AsmMacros.inc
;; extern "C" DWORD __stdcall xmmYmmStateSupport();
LEAF_ENTRY xmmYmmStateSupport, _TEXT
mov ecx, 0 ; Specify xcr0
xgetbv ; result in EDX:EAX
and eax, 06H
cmp eax, 06H ; check OS has enabled both XMM and YMM state support
jne not_supported
mov eax, 1
jmp done
not_supported:
mov eax, 0
done:
ret
LEAF_END xmmYmmStateSupport, _TEXT
;; extern "C" DWORD __stdcall avx512StateSupport();
LEAF_ENTRY avx512StateSupport, _TEXT
mov ecx, 0 ; Specify xcr0
xgetbv ; result in EDX:EAX
and eax, 0E6H
cmp eax, 0E6H ; check OS has enabled XMM, YMM and ZMM state support
jne not_supported
mov eax, 1
jmp done
not_supported:
mov eax, 0
done:
ret
LEAF_END avx512StateSupport, _TEXT
end