mirror of
https://github.com/google/cpu_features.git
synced 2025-04-28 07:23:37 +02:00
Detect Intel's Multi-Precision Add-Carry Instruction Extensions (#157)
This commit is contained in:
parent
3e8243b7d9
commit
d35e2f38eb
@ -89,6 +89,7 @@ typedef struct {
|
|||||||
|
|
||||||
int dca : 1;
|
int dca : 1;
|
||||||
int ss : 1;
|
int ss : 1;
|
||||||
|
int adx : 1;
|
||||||
// Make sure to update X86FeaturesEnum below if you add a field here.
|
// Make sure to update X86FeaturesEnum below if you add a field here.
|
||||||
} X86Features;
|
} X86Features;
|
||||||
|
|
||||||
@ -214,6 +215,7 @@ typedef enum {
|
|||||||
X86_RDRND,
|
X86_RDRND,
|
||||||
X86_DCA,
|
X86_DCA,
|
||||||
X86_SS,
|
X86_SS,
|
||||||
|
X86_ADX,
|
||||||
X86_LAST_,
|
X86_LAST_,
|
||||||
} X86FeaturesEnum;
|
} X86FeaturesEnum;
|
||||||
|
|
||||||
|
@ -88,7 +88,8 @@
|
|||||||
FEATURE(X86_MOVBE, movbe, "movbe", 0, 0) \
|
FEATURE(X86_MOVBE, movbe, "movbe", 0, 0) \
|
||||||
FEATURE(X86_RDRND, rdrnd, "rdrnd", 0, 0) \
|
FEATURE(X86_RDRND, rdrnd, "rdrnd", 0, 0) \
|
||||||
FEATURE(X86_DCA, dca, "dca", 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_FEATURE_TYPE X86Features
|
||||||
#define DEFINE_TABLE_DONT_GENERATE_HWCAPS
|
#define DEFINE_TABLE_DONT_GENERATE_HWCAPS
|
||||||
#include "define_tables.h"
|
#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->sha = IsBitSet(leaf_7.ebx, 29);
|
||||||
features->vaes = IsBitSet(leaf_7.ecx, 9);
|
features->vaes = IsBitSet(leaf_7.ecx, 9);
|
||||||
features->vpclmulqdq = IsBitSet(leaf_7.ecx, 10);
|
features->vpclmulqdq = IsBitSet(leaf_7.ecx, 10);
|
||||||
|
features->adx = IsBitSet(leaf_7.ebx, 19);
|
||||||
|
|
||||||
if (os_support.have_sse_via_os) {
|
if (os_support.have_sse_via_os) {
|
||||||
DetectSseViaOs(features);
|
DetectSseViaOs(features);
|
||||||
|
@ -148,6 +148,7 @@ TEST_F(CpuidX86Test, SandyBridge) {
|
|||||||
EXPECT_TRUE(features.popcnt);
|
EXPECT_TRUE(features.popcnt);
|
||||||
EXPECT_FALSE(features.movbe);
|
EXPECT_FALSE(features.movbe);
|
||||||
EXPECT_FALSE(features.rdrnd);
|
EXPECT_FALSE(features.rdrnd);
|
||||||
|
EXPECT_FALSE(features.adx);
|
||||||
}
|
}
|
||||||
|
|
||||||
const int KiB = 1024;
|
const int KiB = 1024;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user