diff options
| author | Achille Roussel <achille.roussel@gmail.com> | 2023-10-18 19:21:55 +0000 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2023-11-15 18:30:03 +0000 |
| commit | 8f262a2843a6f3ef32e938ce39c0ffeb84f04a42 (patch) | |
| tree | ca40845996cae5efdd651a33d1bb60fe7a620e9f /src/internal/cpu/cpu.go | |
| parent | 6ef98ac87c8a4185c0bace496d84cb3b68f069e3 (diff) | |
| download | go-8f262a2843a6f3ef32e938ce39c0ffeb84f04a42.tar.xz | |
internal/cpu: detect support of AVX512
Extracts changes from that were submitted in other CLs to enable AVX512
detection, notably:
- https://go-review.googlesource.com/c/go/+/271521
- https://go-review.googlesource.com/c/go/+/379394
- https://go-review.googlesource.com/c/go/+/502476
This change adds properties to the cpu.X86 fields to enable runtime
detection of AVX512, and the hasAVX512F, hasAVX512BW, and hasAVX512VL
macros to support bypassing runtime checks in assembly code when
GOAMD64=v4 is set.
Change-Id: Ia7c3f22f1e66bf1de575aba522cb0d0a55ce791f
Reviewed-on: https://go-review.googlesource.com/c/go/+/536257
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Martin Möhrmann <martin@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Martin Möhrmann <martin@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
Commit-Queue: Martin Möhrmann <martin@golang.org>
Reviewed-by: Martin Möhrmann <moehrmann@google.com>
Diffstat (limited to 'src/internal/cpu/cpu.go')
| -rw-r--r-- | src/internal/cpu/cpu.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/internal/cpu/cpu.go b/src/internal/cpu/cpu.go index 91b5b9b91f..d794e53cee 100644 --- a/src/internal/cpu/cpu.go +++ b/src/internal/cpu/cpu.go @@ -29,6 +29,9 @@ var X86 struct { HasADX bool HasAVX bool HasAVX2 bool + HasAVX512F bool + HasAVX512BW bool + HasAVX512VL bool HasBMI1 bool HasBMI2 bool HasERMS bool |
