From 08aea9aa5b015e11fbaea3727f7cfe2f7b2ebb08 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 21 May 2021 22:26:09 +0200 Subject: [PATCH] Detect Intel's Multi-Precision Add-Carry Instruction Extensions See https://github.com/google/cpu_features/commit/d35e2f38eb28ad09010a0616a34fd87dfbfd6609 --- .../volk_gnsssdr/cpu_features/include/cpuinfo_x86.h | 2 ++ .../volk_gnsssdr/cpu_features/src/cpuinfo_x86.c | 4 +++- .../volk_gnsssdr/cpu_features/test/cpuinfo_x86_test.cc | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/include/cpuinfo_x86.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/include/cpuinfo_x86.h index cb073a177..4831f6db0 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/include/cpuinfo_x86.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/include/cpuinfo_x86.h @@ -79,6 +79,7 @@ typedef struct int dca : 1; int ss : 1; + int adx : 1; // Make sure to update X86FeaturesEnum below if you add a field here. } X86Features; @@ -207,6 +208,7 @@ typedef enum X86_RDRND, X86_DCA, X86_SS, + X86_ADX, X86_LAST_, } X86FeaturesEnum; diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/src/cpuinfo_x86.c b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/src/cpuinfo_x86.c index e84843e85..85415639f 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/src/cpuinfo_x86.c +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/src/cpuinfo_x86.c @@ -74,7 +74,8 @@ FEATURE(X86_MOVBE, movbe, "movbe", 0, 0) \ FEATURE(X86_RDRND, rdrnd, "rdrnd", 0, 0) \ FEATURE(X86_DCA, dca, "dca", 0, 0) \ - FEATURE(X86_SS, ss, "ss", 0, 0) + FEATURE(X86_SS, ss, "ss", 0, 0) \ + FEATURE(X86_ADX, adx, "adx", 0, 0) #define DEFINE_TABLE_FEATURE_TYPE X86Features #define DEFINE_TABLE_DONT_GENERATE_HWCAPS #include "define_tables.h" @@ -1347,6 +1348,7 @@ static void ParseCpuId(const uint32_t max_cpuid_leaf, features->sha = IsBitSet(leaf_7.ebx, 29); features->vaes = IsBitSet(leaf_7.ecx, 9); features->vpclmulqdq = IsBitSet(leaf_7.ecx, 10); + features->adx = IsBitSet(leaf_7.ebx, 19); if (os_support.have_sse_via_os) { diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/test/cpuinfo_x86_test.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/test/cpuinfo_x86_test.cc index 5d964ec64..c43b6c367 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/test/cpuinfo_x86_test.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/test/cpuinfo_x86_test.cc @@ -150,6 +150,7 @@ TEST_F(CpuidX86Test, SandyBridge) EXPECT_TRUE(features.popcnt); EXPECT_FALSE(features.movbe); EXPECT_FALSE(features.rdrnd); + EXPECT_FALSE(features.adx); } const int KiB = 1024;