Created
November 20, 2024 01:12
-
-
Save cartersusi/e2b25b6bd54605f50806761085ea5059 to your computer and use it in GitHub Desktop.
Supported_amd64.s
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// +build amd64 | |
// func Supported() bool | |
TEXT ·Supported(SB), 4, $0 | |
MOVQ $1, AX | |
CPUID | |
TESTQ $(1<<26), CX | |
JZ avxFalse | |
TESTQ $(1<<28), CX | |
JZ avxFalse | |
MOVQ $0, CX | |
XGETBV | |
TESTQ $(1<<1), AX | |
JZ avxFalse | |
TESTQ $(1<<2), AX | |
JZ avxFalse | |
MOVB $1, bool+0(FP) | |
RET | |
avxFalse: | |
MOVB $0, bool+0(FP) | |
RET |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment