mirror of
https://github.com/Dr-Noob/cpufetch.git
synced 2026-03-25 07:50:40 +01:00
[v1.00] Fix ambiguity in uarch detection with 0x806E9; it may be Amber/Kaby Lake (thanks to #122 for pointing this out!). We can differentiate by CPU name (hacky, but is there a better way?)
This commit is contained in:
@@ -176,7 +176,7 @@ struct uarch* get_cpu_uarch(struct cpuInfo* cpu) {
|
|||||||
uint32_t family = (eax >> 8) & 0xF;
|
uint32_t family = (eax >> 8) & 0xF;
|
||||||
uint32_t efamily = (eax >> 20) & 0xFF;
|
uint32_t efamily = (eax >> 20) & 0xFF;
|
||||||
|
|
||||||
return get_uarch_from_cpuid(cpu, efamily, family, emodel, model, (int)stepping);
|
return get_uarch_from_cpuid(cpu, eax, efamily, family, emodel, model, (int)stepping);
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t get_peak_performance(struct cpuInfo* cpu, struct topology* topo, int64_t max_freq, bool accurate_pp) {
|
int64_t get_peak_performance(struct cpuInfo* cpu, struct topology* topo, int64_t max_freq, bool accurate_pp) {
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ struct uarch* get_uarch_from_cpuid_intel(uint32_t ef, uint32_t f, uint32_t em, u
|
|||||||
CHECK_UARCH(arch, 0, 6, 8, 10, NA, "Tremont", UARCH_TREMONT, 10) // no spec update; only geekbench.com example
|
CHECK_UARCH(arch, 0, 6, 8, 10, NA, "Tremont", UARCH_TREMONT, 10) // no spec update; only geekbench.com example
|
||||||
CHECK_UARCH(arch, 0, 6, 8, 12, NA, "Tiger Lake", UARCH_TIGER_LAKE, 10) // instlatx64
|
CHECK_UARCH(arch, 0, 6, 8, 12, NA, "Tiger Lake", UARCH_TIGER_LAKE, 10) // instlatx64
|
||||||
CHECK_UARCH(arch, 0, 6, 8, 13, NA, "Tiger Lake", UARCH_TIGER_LAKE, 10) // instlatx64
|
CHECK_UARCH(arch, 0, 6, 8, 13, NA, "Tiger Lake", UARCH_TIGER_LAKE, 10) // instlatx64
|
||||||
CHECK_UARCH(arch, 0, 6, 8, 14, 9, "Amber Lake", UARCH_AMBER_LAKE, 14) // wikichip
|
// CHECK_UARCH(arch, 0, 6, 8, 14, 9, ...) It is not possible to determine uarch only from CPUID dump (can be Kaby Lake or Amber Lake)
|
||||||
CHECK_UARCH(arch, 0, 6, 8, 14, 10, "Kaby Lake", UARCH_KABY_LAKE, 14) // wikichip
|
CHECK_UARCH(arch, 0, 6, 8, 14, 10, "Kaby Lake", UARCH_KABY_LAKE, 14) // wikichip
|
||||||
CHECK_UARCH(arch, 0, 6, 8, 14, 11, "Whiskey Lake", UARCH_WHISKEY_LAKE, 14) // wikichip
|
CHECK_UARCH(arch, 0, 6, 8, 14, 11, "Whiskey Lake", UARCH_WHISKEY_LAKE, 14) // wikichip
|
||||||
CHECK_UARCH(arch, 0, 6, 8, 14, 12, "Comet Lake", UARCH_COMET_LAKE, 14) // wikichip
|
CHECK_UARCH(arch, 0, 6, 8, 14, 12, "Comet Lake", UARCH_COMET_LAKE, 14) // wikichip
|
||||||
@@ -364,9 +364,23 @@ struct uarch* get_uarch_from_cpuid_amd(uint32_t ef, uint32_t f, uint32_t em, uin
|
|||||||
return arch;
|
return arch;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct uarch* get_uarch_from_cpuid(struct cpuInfo* cpu, uint32_t ef, uint32_t f, uint32_t em, uint32_t m, int s) {
|
struct uarch* get_uarch_from_cpuid(struct cpuInfo* cpu, uint32_t dump, uint32_t ef, uint32_t f, uint32_t em, uint32_t m, int s) {
|
||||||
if(cpu->cpu_vendor == CPU_VENDOR_INTEL)
|
if(cpu->cpu_vendor == CPU_VENDOR_INTEL) {
|
||||||
|
if(dump == 0x000806E9) {
|
||||||
|
// It is not possible to determine uarch only from CPUID dump (can be Kaby Lake or Amber Lake)
|
||||||
|
struct uarch* arch = emalloc(sizeof(struct uarch));
|
||||||
|
|
||||||
|
if(strstr(cpu->cpu_name, "Y") != NULL) {
|
||||||
|
fill_uarch(arch, "Amber Lake", UARCH_AMBER_LAKE, 14);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
fill_uarch(arch, "Kaby Lake", UARCH_KABY_LAKE, 14);
|
||||||
|
}
|
||||||
|
|
||||||
|
return arch;
|
||||||
|
}
|
||||||
return get_uarch_from_cpuid_intel(ef, f, em, m, s);
|
return get_uarch_from_cpuid_intel(ef, f, em, m, s);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return get_uarch_from_cpuid_amd(ef, f, em, m, s);
|
return get_uarch_from_cpuid_amd(ef, f, em, m, s);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
struct uarch;
|
struct uarch;
|
||||||
|
|
||||||
struct uarch* get_uarch_from_cpuid(struct cpuInfo* cpu, uint32_t ef, uint32_t f, uint32_t em, uint32_t m, int s);
|
struct uarch* get_uarch_from_cpuid(struct cpuInfo* cpu, uint32_t dump, uint32_t ef, uint32_t f, uint32_t em, uint32_t m, int s);
|
||||||
bool vpus_are_AVX512(struct cpuInfo* cpu);
|
bool vpus_are_AVX512(struct cpuInfo* cpu);
|
||||||
bool is_knights_landing(struct cpuInfo* cpu);
|
bool is_knights_landing(struct cpuInfo* cpu);
|
||||||
int get_number_of_vpus(struct cpuInfo* cpu);
|
int get_number_of_vpus(struct cpuInfo* cpu);
|
||||||
|
|||||||
Reference in New Issue
Block a user