diff options
author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2008-07-14 14:42:54 +0000 |
---|---|---|
committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2008-07-14 14:42:54 +0000 |
commit | 43d526d162c69f29a1cc6734014576eade49529b (patch) | |
tree | 1e06364189d502030d9727a5cee6da5a0139e76b /lib/Target/Mips/MipsSubtarget.cpp | |
parent | 91e1c32dd025c1595a46e2ae59b0ce6ad0f0edea (diff) |
Added Subtarget support into RegisterInfo
Added HasABICall and HasAbsoluteCall (equivalent to gcc -mabicall and
-mno-shared). HasAbsoluteCall is not implemented but HasABICall is the
default for o32 ABI. Now, both should help into a more accurate
relocation types implementation.
Added IsLinux is needed to choose between asm directives.
Instruction name strings cleanup.
AsmPrinter improved.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53551 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/MipsSubtarget.cpp')
-rw-r--r-- | lib/Target/Mips/MipsSubtarget.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/lib/Target/Mips/MipsSubtarget.cpp b/lib/Target/Mips/MipsSubtarget.cpp index 96ff30ba4a..3424388011 100644 --- a/lib/Target/Mips/MipsSubtarget.cpp +++ b/lib/Target/Mips/MipsSubtarget.cpp @@ -15,23 +15,34 @@ #include "Mips.h" #include "MipsGenSubtarget.inc" #include "llvm/Module.h" +#include "llvm/Support/CommandLine.h" using namespace llvm; +cl::opt<bool> NotABICall("disable-mips-abicall", cl::Hidden, + cl::desc("Disable code for SVR4-style dynamic objects")); +cl::opt<bool> AbsoluteCall("enable-mips-absolute-call", cl::Hidden, + cl::desc("Enable absolute call within abicall")); + MipsSubtarget::MipsSubtarget(const TargetMachine &TM, const Module &M, const std::string &FS, bool little) : MipsArchVersion(Mips1), MipsABI(O32), IsLittle(little), IsSingleFloat(false), - IsFP64bit(false), IsGP64bit(false), HasVFPU(false), HasSEInReg(false) + IsFP64bit(false), IsGP64bit(false), HasVFPU(false), HasSEInReg(false), + HasABICall(true), HasAbsoluteCall(false), IsLinux(true) { std::string CPU = "mips1"; // Parse features string. ParseSubtargetFeatures(FS, CPU); + const std::string& TT = M.getTargetTriple(); + + // Is the target system Linux ? + if (TT.find("linux") == std::string::npos) + IsLinux = false; // When only the target triple is specified and is // a allegrex target, set the features. We also match // big and little endian allegrex cores (dont really // know if a big one exists) - const std::string& TT = M.getTargetTriple(); if (TT.find("mipsallegrex") != std::string::npos) { MipsABI = EABI; IsSingleFloat = true; @@ -39,4 +50,13 @@ MipsSubtarget::MipsSubtarget(const TargetMachine &TM, const Module &M, HasVFPU = true; // Enables Allegrex Vector FPU (not supported yet) HasSEInReg = true; } + + // Abicall is the default for O32 ABI and is ignored + // for EABI. + if (NotABICall || isABI_EABI()) + HasABICall = false; + + // TODO: disable when handling 64 bit symbols in the future. + if (HasABICall && AbsoluteCall) + HasAbsoluteCall = true; } |