]> Cypherpunks repositories - gostls13.git/commitdiff
internal/cpu: add support for x86 FMA cpu feature detection
authorMartin Möhrmann <moehrmann@google.com>
Sat, 9 Sep 2017 20:41:30 +0000 (22:41 +0200)
committerMartin Möhrmann <moehrmann@google.com>
Mon, 11 Sep 2017 05:20:01 +0000 (05:20 +0000)
Change-Id: I88ea39de01b07e6afa1c187c0df6a258da4aa8e4
Reviewed-on: https://go-review.googlesource.com/62650
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/internal/cpu/cpu.go
src/internal/cpu/cpu_x86.go

index 3090adbbe4e41af4db5da7193f12329ba454de7d..d84a92ce56f177c3ffefe05936398fd3dbdba3a4 100644 (file)
@@ -20,6 +20,7 @@ type x86 struct {
        HasBMI1      bool
        HasBMI2      bool
        HasERMS      bool
+       HasFMA       bool
        HasOSXSAVE   bool
        HasPCLMULQDQ bool
        HasPOPCNT    bool
index 5bbe9996752782c7bdf2b091fce9da394e142329..6a7b5c2271e8ffdbca8efb38d3157b1ff0b7dd15 100644 (file)
@@ -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)