[llvm] 5ecf85a - [AArch64] Add native CPU detection for Neoverse N1
Sjoerd Meijer via llvm-commits
llvm-commits at lists.llvm.org
Thu May 28 11:54:53 PDT 2020
Author: Sjoerd Meijer
Date: 2020-05-28T19:54:18+01:00
New Revision: 5ecf85a5fcb71fc616afef8d22d2bfd9c7854402
URL: https://github.com/llvm/llvm-project/commit/5ecf85a5fcb71fc616afef8d22d2bfd9c7854402
DIFF: https://github.com/llvm/llvm-project/commit/5ecf85a5fcb71fc616afef8d22d2bfd9c7854402.diff
LOG: [AArch64] Add native CPU detection for Neoverse N1
Map the CPU ID value 0xd0c to "neoverse-n1".
Patch by James Greenhalgh.
Differential Revision: https://reviews.llvm.org/D80736
Added:
Modified:
llvm/lib/Support/Host.cpp
llvm/unittests/Support/Host.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Support/Host.cpp b/llvm/lib/Support/Host.cpp
index d80c7228f6e0..a3a0a4c2d01a 100644
--- a/llvm/lib/Support/Host.cpp
+++ b/llvm/lib/Support/Host.cpp
@@ -204,6 +204,7 @@ StringRef sys::detail::getHostCPUNameForARM(StringRef ProcCpuinfoContent) {
.Case("0xd09", "cortex-a73")
.Case("0xd0a", "cortex-a75")
.Case("0xd0b", "cortex-a76")
+ .Case("0xd0c", "neoverse-n1")
.Default("generic");
}
diff --git a/llvm/unittests/Support/Host.cpp b/llvm/unittests/Support/Host.cpp
index dd43f041d0e8..7d43366631c5 100644
--- a/llvm/unittests/Support/Host.cpp
+++ b/llvm/unittests/Support/Host.cpp
@@ -100,6 +100,10 @@ TEST(getLinuxHostCPUName, AArch64) {
EXPECT_EQ(sys::detail::getHostCPUNameForARM("CPU implementer : 0x41\n"
"CPU part : 0xd03"),
"cortex-a53");
+
+ EXPECT_EQ(sys::detail::getHostCPUNameForARM("CPU implementer : 0x41\n"
+ "CPU part : 0xd0c"),
+ "neoverse-n1");
// Verify that both CPU implementer and CPU part are checked:
EXPECT_EQ(sys::detail::getHostCPUNameForARM("CPU implementer : 0x40\n"
"CPU part : 0xd03"),
More information about the llvm-commits
mailing list