diff options
author | Akira Hatanaka <ahatanaka@mips.com> | 2012-07-31 21:49:49 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@mips.com> | 2012-07-31 21:49:49 +0000 |
commit | 0bc1adbbc4fdc6d85a671ed70a1bbd345dba445d (patch) | |
tree | bff519453a5ba3fad9afa0ba5a6ed76668e29d64 /lib/Target/Mips/MipsTargetMachine.cpp | |
parent | b4f921b1f0ae34d6cfda6034a7d32c73b0738351 (diff) |
Add definitions of two subclasses of MipsInstrInfo, MipsInstrInfo (for mips16),
and MipsSEInstrInfo (for mips32/64).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161081 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/MipsTargetMachine.cpp')
-rw-r--r-- | lib/Target/Mips/MipsTargetMachine.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/Target/Mips/MipsTargetMachine.cpp b/lib/Target/Mips/MipsTargetMachine.cpp index 96f0a00fc9..d16632453b 100644 --- a/lib/Target/Mips/MipsTargetMachine.cpp +++ b/lib/Target/Mips/MipsTargetMachine.cpp @@ -12,6 +12,8 @@ //===----------------------------------------------------------------------===// #include "MipsTargetMachine.h" +#include "MipsSEInstrInfo.h" +#include "Mips16InstrInfo.h" #include "Mips.h" #include "llvm/PassManager.h" #include "llvm/CodeGen/Passes.h" @@ -26,6 +28,17 @@ extern "C" void LLVMInitializeMipsTarget() { RegisterTargetMachine<MipselTargetMachine> B(TheMips64elTarget); } +static const MipsInstrInfo *genInstrInfo(MipsTargetMachine &TM) { + const MipsInstrInfo *II; + + if (TM.getSubtargetImpl()->inMips16Mode()) + II = new Mips16InstrInfo(TM); + else + II = new MipsSEInstrInfo(TM); + + return II; +} + // DataLayout --> Big-endian, 32-bit pointer/ABI/alignment // The stack is always 8 byte aligned // On function prologue, the stack is created by decrementing @@ -48,7 +61,7 @@ MipsTargetMachine(const Target &T, StringRef TT, (Subtarget.isABI_N64() ? "E-p:64:64:64-i8:8:32-i16:16:32-i64:64:64-f128:128:128-n32" : "E-p:32:32:32-i8:8:32-i16:16:32-i64:64:64-n32")), - InstrInfo(*this), + InstrInfo(genInstrInfo(*this)), FrameLowering(Subtarget), TLInfo(*this), TSInfo(*this), JITInfo() { } |