diff options
author | Joel Jones <joelkevinjones@gmail.com> | 2018-10-05 22:23:21 +0000 |
---|---|---|
committer | Joel Jones <joelkevinjones@gmail.com> | 2018-10-05 22:23:21 +0000 |
commit | 0a6c000c1687d70d849f15a6d51f0dad7680359f (patch) | |
tree | 735ab30a3532713c913a74405e81b4da699fd5af /llvm/lib/Support | |
parent | 227f25420a4058fc2af63a795eed929e0c4bfef3 (diff) | |
download | bcm5719-llvm-0a6c000c1687d70d849f15a6d51f0dad7680359f.tar.gz bcm5719-llvm-0a6c000c1687d70d849f15a6d51f0dad7680359f.zip |
[AArch64] -mcpu=native CPU detection for Cavium processors
This small patch updates the CPU detection for Cavium processors when
-mcpu=native is passed on compile-line.
Patch by Stefan Teleman
Differential Revision: https://reviews.llvm.org/D51939
llvm-svn: 343897
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r-- | llvm/lib/Support/Host.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/Support/Host.cpp b/llvm/lib/Support/Host.cpp index 963b32b2c46..7de2a9e3fbb 100644 --- a/llvm/lib/Support/Host.cpp +++ b/llvm/lib/Support/Host.cpp @@ -196,6 +196,21 @@ StringRef sys::detail::getHostCPUNameForARM(StringRef ProcCpuinfoContent) { .Default("generic"); } + if (Implementer == "0x42" || Implementer == "0x43") { // Broadcom | Cavium. + for (unsigned I = 0, E = Lines.size(); I != E; ++I) { + if (Lines[I].startswith("CPU part")) { + return StringSwitch<const char *>(Lines[I].substr(8).ltrim("\t :")) + .Case("0x516", "thunderx2t99") + .Case("0x0516", "thunderx2t99") + .Case("0xaf", "thunderx2t99") + .Case("0x0af", "thunderx2t99") + .Case("0xa1", "thunderxt88") + .Case("0x0a1", "thunderxt88") + .Default("generic"); + } + } + } + if (Implementer == "0x51") // Qualcomm Technologies, Inc. // Look for the CPU part line. for (unsigned I = 0, E = Lines.size(); I != E; ++I) |