mirror of
https://github.com/google/cpu_features.git
synced 2025-07-01 21:31:15 +02:00
[NFC] Remove unused max_cpuid_leaf
variable (#131)
This commit is contained in:

committed by
GitHub

parent
91f525c74d
commit
76dafc7e3b
@ -1154,9 +1154,10 @@ static void ParseCpuId(const uint32_t max_cpuid_leaf, X86Info* info, OsSupport*
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Reference https://en.wikipedia.org/wiki/CPUID#EAX=80000000h:_Get_Highest_Extended_Function_Implemented.
|
// Reference https://en.wikipedia.org/wiki/CPUID#EAX=80000000h:_Get_Highest_Extended_Function_Implemented.
|
||||||
static void ParseExtraAMDCpuId(const uint32_t max_cpuid_leaf, X86Info* info, OsSupport os_support) {
|
static void ParseExtraAMDCpuId(X86Info* info, OsSupport os_support) {
|
||||||
const Leaf leaf_80000000 = CpuId(0x80000000);
|
const Leaf leaf_80000000 = CpuId(0x80000000);
|
||||||
const Leaf leaf_80000001 = SafeCpuId(leaf_80000000.eax, 0x80000001);
|
const uint32_t max_extended_cpuid_leaf = leaf_80000000.eax;
|
||||||
|
const Leaf leaf_80000001 = SafeCpuId(max_extended_cpuid_leaf, 0x80000001);
|
||||||
|
|
||||||
X86Features* const features = &info->features;
|
X86Features* const features = &info->features;
|
||||||
|
|
||||||
@ -1177,13 +1178,15 @@ X86Info GetX86Info(void) {
|
|||||||
X86Info info = kEmptyX86Info;
|
X86Info info = kEmptyX86Info;
|
||||||
OsSupport os_support = kEmptyOsSupport;
|
OsSupport os_support = kEmptyOsSupport;
|
||||||
const Leaf leaf_0 = CpuId(0);
|
const Leaf leaf_0 = CpuId(0);
|
||||||
const uint32_t max_cpuid_leaf = leaf_0.eax;
|
const bool is_intel = IsVendor(leaf_0, "GenuineIntel");
|
||||||
|
const bool is_amd = IsVendor(leaf_0, "AuthenticAMD");
|
||||||
SetVendor(leaf_0, info.vendor);
|
SetVendor(leaf_0, info.vendor);
|
||||||
if (IsVendor(leaf_0, "GenuineIntel") || IsVendor(leaf_0, "AuthenticAMD")) {
|
if (is_intel || is_amd) {
|
||||||
|
const uint32_t max_cpuid_leaf = leaf_0.eax;
|
||||||
ParseCpuId(max_cpuid_leaf, &info, &os_support);
|
ParseCpuId(max_cpuid_leaf, &info, &os_support);
|
||||||
}
|
}
|
||||||
if (IsVendor(leaf_0, "AuthenticAMD")) {
|
if (is_amd) {
|
||||||
ParseExtraAMDCpuId(max_cpuid_leaf, &info, os_support);
|
ParseExtraAMDCpuId(&info, os_support);
|
||||||
}
|
}
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user