From 27f08ea1c7abf04125f6f9f23b8ba2f8c20e95b6 Mon Sep 17 00:00:00 2001 From: Robert Hoo Date: Sat, 29 Feb 2020 20:34:35 +0800 Subject: util: add util function buffer_zero_avx512() And intialize buffer_is_zero() with it, when Intel AVX512F is available on host. This function utilizes Intel AVX512 fundamental instructions which is faster than its implementation with AVX2 (in my unit test, with 4K buffer, on CascadeLake SP, ~36% faster, buffer_zero_avx512() V.S. buffer_zero_avx2()). Signed-off-by: Robert Hoo Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- include/qemu/cpuid.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/qemu') diff --git a/include/qemu/cpuid.h b/include/qemu/cpuid.h index 69301700bd..09fc245b91 100644 --- a/include/qemu/cpuid.h +++ b/include/qemu/cpuid.h @@ -45,6 +45,9 @@ #ifndef bit_AVX2 #define bit_AVX2 (1 << 5) #endif +#ifndef bit_AVX512F +#define bit_AVX512F (1 << 16) +#endif #ifndef bit_BMI2 #define bit_BMI2 (1 << 8) #endif -- cgit 1.4.1