1
0
mirror of https://github.com/google/cpu_features.git synced 2025-07-01 21:31:15 +02:00

Add x86 missing feature detections for ndk_compat (#58)

One more step towards #47.
This commit is contained in:
Guillaume Chatelet
2019-01-22 13:19:42 +01:00
committed by GitHub
parent 5911e96bbd
commit d395dfa026
4 changed files with 38 additions and 5 deletions

View File

@ -145,12 +145,16 @@ static void ParseCpuId(const uint32_t max_cpuid_leaf, X86Info* info) {
features->smx = IsBitSet(leaf_1.ecx, 6);
features->cx16 = IsBitSet(leaf_1.ecx, 13);
features->movbe = IsBitSet(leaf_1.ecx, 22);
features->popcnt = IsBitSet(leaf_1.ecx, 23);
features->aes = IsBitSet(leaf_1.ecx, 25);
features->f16c = IsBitSet(leaf_1.ecx, 29);
features->rdrnd = IsBitSet(leaf_1.ecx, 30);
features->sgx = IsBitSet(leaf_7.ebx, 2);
features->bmi1 = IsBitSet(leaf_7.ebx, 3);
features->bmi2 = IsBitSet(leaf_7.ebx, 8);
features->erms = IsBitSet(leaf_7.ebx, 9);
features->sha = IsBitSet(leaf_7.ebx, 29);
features->vpclmulqdq = IsBitSet(leaf_7.ecx, 10);
if (have_sse_os_support) {
@ -370,6 +374,14 @@ int GetX86FeaturesEnumValue(const X86Features* features,
return features->sgx;
case X86_CX16:
return features->cx16;
case X86_SHA:
return features->sha;
case X86_POPCNT:
return features->popcnt;
case X86_MOVBE:
return features->movbe;
case X86_RDRND:
return features->rdrnd;
case X86_LAST_:
break;
}
@ -438,6 +450,14 @@ const char* GetX86FeaturesEnumName(X86FeaturesEnum value) {
return "sgx";
case X86_CX16:
return "cx16";
case X86_SHA:
return "sha";
case X86_POPCNT:
return "popcnt";
case X86_MOVBE:
return "movbe";
case X86_RDRND:
return "rdrnd";
case X86_LAST_:
break;
}