[sys] cpu: add support for detecting cmpxchg16b

12 views
Skip to first unread message

Martin Möhrmann (Gerrit)

unread,
Aug 23, 2021, 3:07:00 AM8/23/21
to yunhao zhang, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Go Bot, Tobias Klauser, golang-co...@googlegroups.com

Martin Möhrmann submitted this change.

View Change

Approvals: Martin Möhrmann: Looks good to me, approved; Trusted; Run TryBots Tobias Klauser: Trusted Go Bot: TryBots succeeded
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.

Gerrit-Project: sys
Gerrit-Branch: master
Gerrit-Change-Id: I892de938e85205c0506aa82e31297b7a99e48e44
Gerrit-Change-Number: 329450
Gerrit-PatchSet: 3
Gerrit-Owner: yunhao zhang <zhangyu...@gmail.com>
Gerrit-Reviewer: Go Bot <go...@golang.org>
Gerrit-Reviewer: Martin Möhrmann <mar...@golang.org>
Gerrit-Reviewer: Tobias Klauser <tobias....@gmail.com>
Gerrit-MessageType: merged
Reply all
Reply to author
Forward
0 new messages