1
0
mirror of https://github.com/google/cpu_features.git synced 2025-04-27 23:22:31 +02:00

Detect Intel's Multi-Precision Add-Carry Instruction Extensions (#157)

This commit is contained in:
Kris Kwiatkowski 2021-05-21 09:47:32 +01:00 committed by GitHub
parent 3e8243b7d9
commit d35e2f38eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View File

@ -89,6 +89,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;
@ -214,6 +215,7 @@ typedef enum {
X86_RDRND,
X86_DCA,
X86_SS,
X86_ADX,
X86_LAST_,
} X86FeaturesEnum;

View File

@ -88,7 +88,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"
@ -1314,6 +1315,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) {
DetectSseViaOs(features);

View File

@ -148,6 +148,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;