diff options
Diffstat (limited to 'internal/cpu/cpu_amd64.go')
| -rw-r--r-- | internal/cpu/cpu_amd64.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/cpu/cpu_amd64.go b/internal/cpu/cpu_amd64.go index f20c810a..7fe59633 100644 --- a/internal/cpu/cpu_amd64.go +++ b/internal/cpu/cpu_amd64.go @@ -14,7 +14,7 @@ func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) // xgetbv with ecx = 0 is implemented in cpu_amd64.s. func xgetbv() (eax, edx uint32) -func init() { +func init() { //nolint:gochecknoinits maxID, _, _, _ := cpuid(0, 0) if maxID < 7 { return @@ -23,6 +23,7 @@ func init() { _, _, ecx1, _ := cpuid(1, 0) osSupportsAVX := false + if ecx1&cpuidOSXSAVE != 0 { eax, _ := xgetbv() osSupportsAVX = eax&(1<<1) != 0 && eax&(1<<2) != 0 |
