diff --git a/xxhash_asm_amd64.go b/xxhash_asm_amd64.go index 54a2b91..c8465a3 100644 --- a/xxhash_asm_amd64.go +++ b/xxhash_asm_amd64.go @@ -7,7 +7,20 @@ package xxhash import "github.com/klauspost/cpuid/v2" -var useAvx512 = cpuid.CPU.Supports(cpuid.AVX, cpuid.AVX2, cpuid.AVX512DQ, cpuid.AVX512F, cpuid.AVX512VL, cpuid.BMI1) +var useAvx512 = cpuid.CPU.Supports( + cpuid.AVX, + cpuid.AVX2, + cpuid.AVX512DQ, + cpuid.AVX512F, + cpuid.AVX512VL, + cpuid.BMI1, + +// Today, vectorized 64 bits integer multiples positively sucks on intel, +// with ILP a single scalar unit is multiple times faster. +// This means sometime we wont be using the AVX512 when under virtualization +// because vendor will be the hypervisor, but in my experience that is rare. +// Most virtualization setups defaults to reporting the vendorid of the host. +) && cpuid.CPU.IsVendor(cpuid.AMD) // Sum64 computes the 64-bit xxHash digest of b with a zero seed. func Sum64(b []byte) uint64 {