diff options
| author | 2026-03-23 05:17:52 +0000 | |
|---|---|---|
| committer | 2026-03-23 05:17:52 +0000 | |
| commit | c8dd7d3b44c93a664dddc0c4619d336c6e13d2a8 (patch) | |
| tree | 335e4d701cf122a77cf5b4c94f9f528242a7d566 /internal/cpu/cpu_amd64.go | |
| parent | Vendor a minimal internal/cpu for AMD64 only (diff) | |
| signature | No signature | |
*: Lints
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 |
