aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/ARM/ARMSubtarget.cpp
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2009-05-29 23:41:08 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2009-05-29 23:41:08 +0000
commitf2e14756aa488fb1b09eb78ffe0055db6581dd5f (patch)
tree58d6cbf11f9a3be932d48a868b47f699738d8b75 /lib/Target/ARM/ARMSubtarget.cpp
parent6724446aa1b2842adc3bdb2e2becf77c5c79a674 (diff)
downloadexternal_llvm-f2e14756aa488fb1b09eb78ffe0055db6581dd5f.zip
external_llvm-f2e14756aa488fb1b09eb78ffe0055db6581dd5f.tar.gz
external_llvm-f2e14756aa488fb1b09eb78ffe0055db6581dd5f.tar.bz2
Add placeholder for thumb2 stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72593 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMSubtarget.cpp')
-rw-r--r--lib/Target/ARM/ARMSubtarget.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/Target/ARM/ARMSubtarget.cpp b/lib/Target/ARM/ARMSubtarget.cpp
index edeea2e..96daca8 100644
--- a/lib/Target/ARM/ARMSubtarget.cpp
+++ b/lib/Target/ARM/ARMSubtarget.cpp
@@ -16,10 +16,11 @@
#include "llvm/Module.h"
using namespace llvm;
-ARMSubtarget::ARMSubtarget(const Module &M, const std::string &FS, bool thumb)
+ARMSubtarget::ARMSubtarget(const Module &M, const std::string &FS,
+ bool isThumb)
: ARMArchVersion(V4T)
, ARMFPUType(None)
- , IsThumb(thumb)
+ , ThumbMode((isThumb ? Thumb1 : ThumbNone))
, UseThumbBacktraces(false)
, IsR9Reserved(false)
, stackAlignment(4)
@@ -36,19 +37,26 @@ ARMSubtarget::ARMSubtarget(const Module &M, const std::string &FS, bool thumb)
const std::string& TT = M.getTargetTriple();
unsigned Len = TT.length();
unsigned Idx = 0;
+
if (Len >= 5 && TT.substr(0, 4) == "armv")
Idx = 4;
else if (Len >= 6 && TT.substr(0, 6) == "thumb") {
- IsThumb = true;
+ isThumb = true;
if (Len >= 7 && TT[5] == 'v')
Idx = 6;
}
if (Idx) {
unsigned SubVer = TT[Idx];
if (SubVer > '4' && SubVer <= '9') {
- if (SubVer >= '6')
+ if (SubVer >= '7') {
+ ARMArchVersion = V7A;
+ if (isThumb)
+ ThumbMode = Thumb2;
+ } else if (SubVer == '6') {
ARMArchVersion = V6;
- else if (SubVer == '5') {
+ if (isThumb && Len >= Idx+3 && TT[Idx+1] == 't' && TT[Idx+2] == '2')
+ ThumbMode = Thumb2;
+ } else if (SubVer == '5') {
ARMArchVersion = V5T;
if (Len >= Idx+3 && TT[Idx+1] == 't' && TT[Idx+2] == 'e')
ARMArchVersion = V5TE;