Martin Möhrmann submitted this change.
cpu: add support for detecting cmpxchg16b
Change-Id: I892de938e85205c0506aa82e31297b7a99e48e44
Reviewed-on: https://go-review.googlesource.com/c/sys/+/329450
Trust: Martin Möhrmann <mar...@golang.org>
Trust: Tobias Klauser <tobias....@gmail.com>
Run-TryBot: Martin Möhrmann <mar...@golang.org>
TryBot-Result: Go Bot <go...@golang.org>
Reviewed-by: Martin Möhrmann <mar...@golang.org>
---
M cpu/cpu.go
M cpu/cpu_x86.go
2 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/cpu/cpu.go b/cpu/cpu.go
index abbec2d..b56886f 100644
--- a/cpu/cpu.go
+++ b/cpu/cpu.go
@@ -56,6 +56,7 @@
HasAVX512BF16 bool // Advanced vector extension 512 BFloat16 Instructions
HasBMI1 bool // Bit manipulation instruction set 1
HasBMI2 bool // Bit manipulation instruction set 2
+ HasCX16 bool // Compare and exchange 16 Bytes
HasERMS bool // Enhanced REP for MOVSB and STOSB
HasFMA bool // Fused-multiply-add instructions
HasOSXSAVE bool // OS supports XSAVE/XRESTOR for saving/restoring XMM registers.
diff --git a/cpu/cpu_x86.go b/cpu/cpu_x86.go
index 54ca466..5ea287b 100644
--- a/cpu/cpu_x86.go
+++ b/cpu/cpu_x86.go
@@ -39,6 +39,7 @@
{Name: "avx512bf16", Feature: &X86.HasAVX512BF16},
{Name: "bmi1", Feature: &X86.HasBMI1},
{Name: "bmi2", Feature: &X86.HasBMI2},
+ {Name: "cx16", Feature: &X86.HasCX16},
{Name: "erms", Feature: &X86.HasERMS},
{Name: "fma", Feature: &X86.HasFMA},
{Name: "osxsave", Feature: &X86.HasOSXSAVE},
@@ -73,6 +74,7 @@
X86.HasPCLMULQDQ = isSet(1, ecx1)
X86.HasSSSE3 = isSet(9, ecx1)
X86.HasFMA = isSet(12, ecx1)
+ X86.HasCX16 = isSet(13, ecx1)
X86.HasSSE41 = isSet(19, ecx1)
X86.HasSSE42 = isSet(20, ecx1)
X86.HasPOPCNT = isSet(23, ecx1)
To view, visit change 329450. To unsubscribe, or for help writing mail filters, visit settings.