aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/ARM/ARMAsmPrinter.cpp
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2010-12-01 19:47:31 +0000
committerJim Grosbach <grosbach@apple.com>2010-12-01 19:47:31 +0000
commit5d14f9be7ba64162c7b996f36d419b11d8cdbe9a (patch)
treea82d935cfa230eaea3ce02a255dc58e15688d277 /lib/Target/ARM/ARMAsmPrinter.cpp
parentbee0c38f595f52d424161dc1db9c0bfe61421957 (diff)
downloadexternal_llvm-5d14f9be7ba64162c7b996f36d419b11d8cdbe9a.zip
external_llvm-5d14f9be7ba64162c7b996f36d419b11d8cdbe9a.tar.gz
external_llvm-5d14f9be7ba64162c7b996f36d419b11d8cdbe9a.tar.bz2
Refactor LEApcrelJT as a pseudo-instructionlowered to a cannonical ADR
instruction at MC lowering. Add binary encoding information for the ADR, including fixup data for the label operand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120594 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMAsmPrinter.cpp')
-rw-r--r--lib/Target/ARM/ARMAsmPrinter.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/Target/ARM/ARMAsmPrinter.cpp b/lib/Target/ARM/ARMAsmPrinter.cpp
index 51d576c..de6e068 100644
--- a/lib/Target/ARM/ARMAsmPrinter.cpp
+++ b/lib/Target/ARM/ARMAsmPrinter.cpp
@@ -726,6 +726,21 @@ void ARMAsmPrinter::EmitInstruction(const MachineInstr *MI) {
}
return;
}
+ case ARM::LEApcrelJT: {
+ unsigned JTI = MI->getOperand(1).getIndex();
+ unsigned Id = MI->getOperand(2).getImm();
+ MCSymbol *JTISymbol = GetARMJTIPICJumpTableLabel2(JTI, Id);
+ const MCExpr *SymbolExpr = MCSymbolRefExpr::Create(JTISymbol, OutContext);
+ MCInst TmpInst;
+ TmpInst.setOpcode(ARM::ADRadd);
+ TmpInst.addOperand(MCOperand::CreateReg(MI->getOperand(0).getReg()));
+ TmpInst.addOperand(MCOperand::CreateExpr(SymbolExpr));
+ // Add predicate operands.
+ TmpInst.addOperand(MCOperand::CreateImm(ARMCC::AL));
+ TmpInst.addOperand(MCOperand::CreateReg(0));
+ OutStreamer.EmitInstruction(TmpInst);
+ return;
+ }
case ARM::MOVPCRX: {
MCInst TmpInst;
TmpInst.setOpcode(ARM::MOVr);