Idenitify Apple Vortex & Tempest cores
diff --git a/include/cpuinfo.h b/include/cpuinfo.h
index de75a06..7d5833f 100644
--- a/include/cpuinfo.h
+++ b/include/cpuinfo.h
@@ -427,6 +427,10 @@
cpuinfo_uarch_monsoon = 0x00700105,
/** Apple A11 processor (little cores). */
cpuinfo_uarch_mistral = 0x00700106,
+ /** Apple A12 processor (big cores). */
+ cpuinfo_uarch_vortex = 0x00700107,
+ /** Apple A12 processor (little cores). */
+ cpuinfo_uarch_tempest = 0x00700108,
/** Cavium ThunderX. */
cpuinfo_uarch_thunderx = 0x00800100,
diff --git a/src/arm/mach/init.c b/src/arm/mach/init.c
index 64a0b37..3cca223 100644
--- a/src/arm/mach/init.c
+++ b/src/arm/mach/init.c
@@ -70,7 +70,7 @@
return result;
}
-static enum cpuinfo_uarch decode_uarch(uint32_t cpu_family, uint32_t cpu_subtype, uint32_t core_index) {
+static enum cpuinfo_uarch decode_uarch(uint32_t cpu_family, uint32_t cpu_subtype, uint32_t core_index, uint32_t core_count) {
switch (cpu_family) {
case CPUFAMILY_ARM_SWIFT:
return cpuinfo_uarch_swift;
@@ -82,14 +82,17 @@
return cpuinfo_uarch_twister;
case CPUFAMILY_ARM_HURRICANE:
return cpuinfo_uarch_hurricane;
-#ifdef CPUFAMILY_ARM_MONSOON_MISTRAL
case CPUFAMILY_ARM_MONSOON_MISTRAL:
-#else
- case 0xe81e7ef6:
- /* Hard-coded value for older SDKs which do not define CPUFAMILY_ARM_MONSOON_MISTRAL */
-#endif
/* 2x Monsoon + 4x Mistral cores */
return core_index < 2 ? cpuinfo_uarch_monsoon : cpuinfo_uarch_mistral;
+#ifdef CPUFAMILY_ARM_VORTEX_TEMPEST
+ case CPUFAMILY_ARM_VORTEX_TEMPEST:
+#else
+ case 0xe81e7ef6:
+ /* Hard-coded value for older SDKs which do not define CPUFAMILY_ARM_VORTEX_TEMPEST */
+#endif
+ /* Hexa-core: 2x Vortex + 4x Tempest; Octa-core: 4x Cortex + 4x Tempest */
+ return core_index + 4 < core_count ? cpuinfo_uarch_vortex : cpuinfo_uarch_tempest;
default:
/* Use hw.cpusubtype for detection */
break;
@@ -322,7 +325,7 @@
.core_id = i % cores_per_package,
.package = packages + i / cores_per_package,
.vendor = cpuinfo_vendor_apple,
- .uarch = decode_uarch(cpu_family, cpu_subtype, i),
+ .uarch = decode_uarch(cpu_family, cpu_subtype, i, mach_topology.cores),
};
if (i != 0 && cores[i].uarch != cores[i - 1].uarch) {
num_clusters++;
diff --git a/tools/cpu-info.c b/tools/cpu-info.c
index 7fd12e6..caef424 100644
--- a/tools/cpu-info.c
+++ b/tools/cpu-info.c
@@ -197,6 +197,14 @@
return "Twister";
case cpuinfo_uarch_hurricane:
return "Hurricane";
+ case cpuinfo_uarch_monsoon:
+ return "Monsoon";
+ case cpuinfo_uarch_mistral:
+ return "Mistral";
+ case cpuinfo_uarch_vortex:
+ return "Vortex";
+ case cpuinfo_uarch_tempest:
+ return "Tempest";
case cpuinfo_uarch_thunderx:
return "ThunderX";
case cpuinfo_uarch_thunderx2: