mirror of
https://github.com/rwinkhart/sys.git
synced 2026-08-27 20:36:31 -04:00
cpu: add support for AVX-VNNI and IFMA detection
Added detection for x86 AVX-VNNI (VEX-coded Vector Neural Network Instructions) and AVX-IFMA (VEX-coded Integer Fused Multiply Add), including both the base VNNI set and the Int8 extention. Fixes golang/go#71142 Change-Id: I9e8d18b2e8bf81d5d4313a4a47fdf731fb3d44dd GitHub-Last-Rev: 32ea443fc247f1b6e957d2b27a44909c620d2fb2 GitHub-Pull-Request: golang/sys#242 Reviewed-on: https://go-review.googlesource.com/c/sys/+/641155 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Pratt <mpratt@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
This commit is contained in:
committed by
Gopher Robot
parent
1c14dcadc3
commit
c75621413d
@@ -41,6 +41,40 @@ func TestAVX512HasAVX2AndAVX(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestAVX512BF16HasAVX512(t *testing.T) {
|
||||
if runtime.GOARCH == "amd64" {
|
||||
if cpu.X86.HasAVX512BF16 && !cpu.X86.HasAVX512 {
|
||||
t.Fatal("HasAVX512 expected true, got false")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestAVXVNNIHasAVX(t *testing.T) {
|
||||
if cpu.X86.HasAVXVNNI && !cpu.X86.HasAVX {
|
||||
t.Fatal("HasAVX expected true, got false")
|
||||
}
|
||||
}
|
||||
|
||||
func TestAVXIFMAHasAVXVNNIAndAVX(t *testing.T) {
|
||||
if cpu.X86.HasAVXIFMA && !cpu.X86.HasAVX {
|
||||
t.Fatal("HasAVX expected true, got false")
|
||||
}
|
||||
|
||||
if cpu.X86.HasAVXIFMA && !cpu.X86.HasAVXVNNI {
|
||||
t.Fatal("HasAVXVNNI expected true, got false")
|
||||
}
|
||||
}
|
||||
|
||||
func TestAVXVNNIInt8HasAVXVNNIAndAVX(t *testing.T) {
|
||||
if cpu.X86.HasAVXVNNIInt8 && !cpu.X86.HasAVXVNNI {
|
||||
t.Fatal("HasAVXVNNI expected true, got false")
|
||||
}
|
||||
|
||||
if cpu.X86.HasAVXVNNIInt8 && !cpu.X86.HasAVX {
|
||||
t.Fatal("HasAVX expected true, got false")
|
||||
}
|
||||
}
|
||||
|
||||
func TestARM64minimalFeatures(t *testing.T) {
|
||||
if runtime.GOARCH != "arm64" || runtime.GOOS == "ios" {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user