From f23fd6ca7f90573bba22daae6ad9bb294b76c3e1 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Mon, 5 Oct 2020 00:10:08 -0700 Subject: [PATCH] lib/x86/cpu_features: rename PCLMULQDQ feature bit to PCLMUL This is less unwieldy and is consistent with "DISPATCH_PCLMUL" and with the "-mno-pclmul" compiler flag. --- lib/x86/cpu_features.c | 2 +- lib/x86/cpu_features.h | 2 +- lib/x86/crc32_impl.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/x86/cpu_features.c b/lib/x86/cpu_features.c index 5b5efd3..e931e62 100644 --- a/lib/x86/cpu_features.c +++ b/lib/x86/cpu_features.c @@ -97,7 +97,7 @@ void setup_cpu_features(void) features |= X86_CPU_FEATURE_SSE2; if (IS_SET(features_2, 1)) - features |= X86_CPU_FEATURE_PCLMULQDQ; + features |= X86_CPU_FEATURE_PCLMUL; if (IS_SET(features_2, 27)) { /* OSXSAVE set? */ u64 xcr0 = read_xcr(0); diff --git a/lib/x86/cpu_features.h b/lib/x86/cpu_features.h index a2ad544..4c02353 100644 --- a/lib/x86/cpu_features.h +++ b/lib/x86/cpu_features.h @@ -17,7 +17,7 @@ #if X86_CPU_FEATURES_ENABLED #define X86_CPU_FEATURE_SSE2 0x00000001 -#define X86_CPU_FEATURE_PCLMULQDQ 0x00000002 +#define X86_CPU_FEATURE_PCLMUL 0x00000002 #define X86_CPU_FEATURE_AVX 0x00000004 #define X86_CPU_FEATURE_AVX2 0x00000008 #define X86_CPU_FEATURE_BMI2 0x00000010 diff --git a/lib/x86/crc32_impl.h b/lib/x86/crc32_impl.h index ff89626..0c17700 100644 --- a/lib/x86/crc32_impl.h +++ b/lib/x86/crc32_impl.h @@ -74,12 +74,12 @@ arch_select_crc32_func(void) u32 features = get_cpu_features(); #ifdef DISPATCH_PCLMUL_AVX - if ((features & X86_CPU_FEATURE_PCLMULQDQ) && + if ((features & X86_CPU_FEATURE_PCLMUL) && (features & X86_CPU_FEATURE_AVX)) return crc32_pclmul_avx; #endif #ifdef DISPATCH_PCLMUL - if (features & X86_CPU_FEATURE_PCLMULQDQ) + if (features & X86_CPU_FEATURE_PCLMUL) return crc32_pclmul; #endif return NULL;