From 1a3230f281e2ad7a35f7f81a5e6bae291b8e6245 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=B6hrmann?= Date: Sat, 9 Sep 2017 22:41:30 +0200 Subject: [PATCH] internal/cpu: add support for x86 FMA cpu feature detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I88ea39de01b07e6afa1c187c0df6a258da4aa8e4 Reviewed-on: https://go-review.googlesource.com/62650 Run-TryBot: Martin Möhrmann TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall --- src/internal/cpu/cpu.go | 1 + src/internal/cpu/cpu_x86.go | 1 + 2 files changed, 2 insertions(+) diff --git a/src/internal/cpu/cpu.go b/src/internal/cpu/cpu.go index 3090adbbe4e..d84a92ce56f 100644 --- a/src/internal/cpu/cpu.go +++ b/src/internal/cpu/cpu.go @@ -20,6 +20,7 @@ type x86 struct { HasBMI1 bool HasBMI2 bool HasERMS bool + HasFMA bool HasOSXSAVE bool HasPCLMULQDQ bool HasPOPCNT bool diff --git a/src/internal/cpu/cpu_x86.go b/src/internal/cpu/cpu_x86.go index 5bbe9996752..6a7b5c2271e 100644 --- a/src/internal/cpu/cpu_x86.go +++ b/src/internal/cpu/cpu_x86.go @@ -27,6 +27,7 @@ func init() { X86.HasSSE3 = isSet(0, ecx1) X86.HasPCLMULQDQ = isSet(1, ecx1) X86.HasSSSE3 = isSet(9, ecx1) + X86.HasFMA = isSet(12, ecx1) X86.HasSSE41 = isSet(19, ecx1) X86.HasSSE42 = isSet(20, ecx1) X86.HasPOPCNT = isSet(23, ecx1)