We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 08379d6 commit 38eaea7Copy full SHA for 38eaea7
llvm/lib/TargetParser/Host.cpp
@@ -347,6 +347,29 @@ StringRef sys::detail::getHostCPUNameForARM(StringRef ProcCpuinfoContent) {
347
}
348
349
350
+ if (Implementer == "0x61") { // Apple
351
+ return StringSwitch<const char *>(Part)
352
+ .Case("0x020", "apple-m1")
353
+ .Case("0x021", "apple-m1")
354
+ .Case("0x022", "apple-m1")
355
+ .Case("0x023", "apple-m1")
356
+ .Case("0x024", "apple-m1")
357
+ .Case("0x025", "apple-m1")
358
+ .Case("0x028", "apple-m1")
359
+ .Case("0x029", "apple-m1")
360
+ .Case("0x030", "apple-m2")
361
+ .Case("0x031", "apple-m2")
362
+ .Case("0x032", "apple-m2")
363
+ .Case("0x033", "apple-m2")
364
+ .Case("0x034", "apple-m2")
365
+ .Case("0x035", "apple-m2")
366
+ .Case("0x038", "apple-m2")
367
+ .Case("0x039", "apple-m2")
368
+ .Case("0x049", "apple-m3")
369
+ .Case("0x048", "apple-m3")
370
+ .Default("generic");
371
+ }
372
+
373
if (Implementer == "0x63") { // Arm China.
374
return StringSwitch<const char *>(Part)
375
.Case("0x132", "star-mc1")
llvm/unittests/TargetParser/Host.cpp
@@ -143,6 +143,9 @@ TEST(getLinuxHostCPUName, AArch64) {
143
EXPECT_EQ(sys::detail::getHostCPUNameForARM("CPU implementer : 0x46\n"
144
"CPU part : 0x003"),
145
"fujitsu-monaka");
146
+ EXPECT_EQ(sys::detail::getHostCPUNameForARM("CPU implementer : 0x61\n"
147
+ "CPU part : 0x039"),
148
+ "apple-m2");
149
150
// MSM8992/4 weirdness
151
StringRef MSM8992ProcCpuInfo = R"(
0 commit comments