[PATCH] D117111: [AArch64] Add native CPU detection for Ampere1
Philipp Tomsich via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 27 14:25:05 PDT 2022
philipp.tomsich updated this revision to Diff 425607.
philipp.tomsich added a comment.
Herald added a project: All.
Update formatting as requested.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D117111/new/
https://reviews.llvm.org/D117111
Files:
llvm/lib/Support/Host.cpp
llvm/unittests/Support/Host.cpp
Index: llvm/unittests/Support/Host.cpp
===================================================================
--- llvm/unittests/Support/Host.cpp
+++ llvm/unittests/Support/Host.cpp
@@ -133,6 +133,10 @@
"CPU part : 0xc01"),
"saphira");
+ EXPECT_EQ(sys::detail::getHostCPUNameForARM("CPU implementer : 0xc0\n"
+ "CPU part : 0xac3"),
+ "ampere1");
+
// MSM8992/4 weirdness
StringRef MSM8992ProcCpuInfo = R"(
Processor : AArch64 Processor rev 3 (aarch64)
Index: llvm/lib/Support/Host.cpp
===================================================================
--- llvm/lib/Support/Host.cpp
+++ llvm/lib/Support/Host.cpp
@@ -296,6 +296,12 @@
}
}
+ if (Implementer == "0xc0") { // Ampere Computing
+ return StringSwitch<const char *>(Part)
+ .Case("0xac3", "ampere1")
+ .Default("generic");
+ }
+
return "generic";
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117111.425607.patch
Type: text/x-patch
Size: 986 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220427/173e32f7/attachment.bin>
More information about the llvm-commits
mailing list