diff --git a/cpu/cpu.go b/cpu/cpu.go index a4f9ce73..571f9fbf 100644 --- a/cpu/cpu.go +++ b/cpu/cpu.go @@ -1,7 +1,7 @@ package cpu import ( - "github.com/klauspost/cpuid/v2" + cpuid "github.com/klauspost/cpuid/v2" ) type X86CPU uint64 @@ -48,6 +48,7 @@ const ( AVX512DQ // AVX-512 Doubleword and Quadword Instructions AVX512ER // AVX-512 Exponential and Reciprocal Instructions AVX512F // AVX-512 Foundation + AVX512FP16 // AVX-512 FP16 Instructions AVX512IFMA // AVX-512 Integer Fused Multiply-Add Instructions AVX512PF // AVX-512 Prefetch Instructions AVX512VBMI // AVX-512 Vector Bit Manipulation Instructions @@ -83,6 +84,7 @@ func init() { X86.Set(AVX512DQ, cpuid.CPU.Has(cpuid.AVX512DQ)) X86.Set(AVX512ER, cpuid.CPU.Has(cpuid.AVX512ER)) X86.Set(AVX512F, cpuid.CPU.Has(cpuid.AVX512F)) + X86.Set(AVX512FP16, cpuid.CPU.Has(cpuid.AVX512FP16)) X86.Set(AVX512IFMA, cpuid.CPU.Has(cpuid.AVX512IFMA)) X86.Set(AVX512PF, cpuid.CPU.Has(cpuid.AVX512PF)) X86.Set(AVX512VBMI, cpuid.CPU.Has(cpuid.AVX512VBMI)) diff --git a/cpu/cpu_test.go b/cpu/cpu_test.go index 8ca78f91..4764c654 100644 --- a/cpu/cpu_test.go +++ b/cpu/cpu_test.go @@ -21,6 +21,7 @@ var x86 = map[string]X86Feature{ "AVX512DQ": AVX512DQ, "AVX512ER": AVX512ER, "AVX512F": AVX512F, + "AVX512FP16": AVX512FP16, "AVX512IFMA": AVX512IFMA, "AVX512PF": AVX512PF, "AVX512VBMI": AVX512VBMI, diff --git a/go.mod b/go.mod index e2cbe4b9..f7c666cb 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module github.com/segmentio/asm go 1.16 -require github.com/klauspost/cpuid/v2 v2.0.6 +require github.com/klauspost/cpuid/v2 v2.0.9 diff --git a/go.sum b/go.sum index 5b8b0f4d..a389a66f 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,2 @@ -github.com/klauspost/cpuid/v2 v2.0.6 h1:dQ5ueTiftKxp0gyjKSx5+8BtPWkyQbd95m8Gys/RarI= -github.com/klauspost/cpuid/v2 v2.0.6/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=