diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-03-08 04:02:49 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-03-08 04:02:49 +0000 |
commit | 4b1747430a2d67702958b95d6776396734f184a0 (patch) | |
tree | 92c1690547c0cabf1b7c4a1451ec4cc2a818aec3 | |
parent | dfe964ce8c367248e587f2d9ecc7fac5ee2c6fdc (diff) |
Recognize triplets starting with armv5-, armv6- etc. And set the ARM arch version accordingly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66365 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/ARM/ARMSubtarget.cpp | 18 | ||||
-rw-r--r-- | test/CodeGen/ARM/uxtb.ll | 2 |
2 files changed, 18 insertions, 2 deletions
diff --git a/lib/Target/ARM/ARMSubtarget.cpp b/lib/Target/ARM/ARMSubtarget.cpp index bbc2202c3b..f5a18405f9 100644 --- a/lib/Target/ARM/ARMSubtarget.cpp +++ b/lib/Target/ARM/ARMSubtarget.cpp @@ -35,7 +35,23 @@ ARMSubtarget::ARMSubtarget(const Module &M, const std::string &FS, bool thumb) // Set the boolean corresponding to the current target triple, or the default // if one cannot be determined, to true. const std::string& TT = M.getTargetTriple(); - if (TT.length() > 5) { + unsigned Len = TT.length(); + if (Len >= 5) { + if (TT.substr(0, 4) == "armv") { + unsigned SubVer = TT[4]; + if (SubVer > '4' && SubVer <= '9') { + if (SubVer >= '6') + ARMArchVersion = V6; + else if (SubVer == '5') { + ARMArchVersion = V5T; + if (Len >= 7 && TT[5] == 't' && TT[6] == 'e') + ARMArchVersion = V5TE; + } + } + } + } + + if (Len > 5) { if (TT.find("-darwin") != std::string::npos) TargetType = isDarwin; } else if (TT.empty()) { diff --git a/test/CodeGen/ARM/uxtb.ll b/test/CodeGen/ARM/uxtb.ll index 85659a7cc9..73e918b7a5 100644 --- a/test/CodeGen/ARM/uxtb.ll +++ b/test/CodeGen/ARM/uxtb.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=arm -mattr=+v6 | \ +; RUN: llvm-as < %s | llc -mtriple=armv6-apple-darwin | \ ; RUN: grep uxt | count 10 define i32 @test1(i32 %x) { |