summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKai Nacke <kai.nacke@redstar.de>2013-12-20 09:24:13 +0000
committerKai Nacke <kai.nacke@redstar.de>2013-12-20 09:24:13 +0000
commit66732aeff2aba2899b6c128d73a27c6ed271acc8 (patch)
treef310a61b0043630ef413210588652c78f4d2c4dd /lib
parentbcb726dc8addb8155a722a43898af872532b317a (diff)
downloadllvm-66732aeff2aba2899b6c128d73a27c6ed271acc8.tar.gz
llvm-66732aeff2aba2899b6c128d73a27c6ed271acc8.tar.bz2
llvm-66732aeff2aba2899b6c128d73a27c6ed271acc8.tar.xz
Add support for krait cpu in llvm::sys::getHostCPUName()
Recently, support for krait cpu was added. This commit extends getHostCPUName() to return krait as cpu for the APQ8064 (a Krait 300). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197792 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Support/Host.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Support/Host.cpp b/lib/Support/Host.cpp
index c5f9c87248..b6e2cb164d 100644
--- a/lib/Support/Host.cpp
+++ b/lib/Support/Host.cpp
@@ -620,6 +620,17 @@ StringRef sys::getHostCPUName() {
.Case("0xc24", "cortex-m4")
.Default("generic");
+ if (Implementer == "0x51") // Qualcomm Technologies, Inc.
+ // Look for the CPU part line.
+ for (unsigned I = 0, E = Lines.size(); I != E; ++I)
+ if (Lines[I].startswith("CPU part"))
+ // The CPU part is a 3 digit hexadecimal number with a 0x prefix. The
+ // values correspond to the "Part number" in the CP15/c0 register. The
+ // contents are specified in the various processor manuals.
+ return StringSwitch<const char *>(Lines[I].substr(8).ltrim("\t :"))
+ .Case("0x06f", "krait") // APQ8064
+ .Default("generic");
+
return "generic";
}
#elif defined(__linux__) && defined(__s390x__)