diff options
author | Jim Grosbach <grosbach@apple.com> | 2011-12-19 23:06:24 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2011-12-19 23:06:24 +0000 |
commit | 8648c1018464b743019f6f1c796b200e49b5b8a8 (patch) | |
tree | af17aef5810d032b238a95c257ea917233d897a7 /llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp | |
parent | 3184a5e4821ad2d580e1ab7879f21c6bf7cd458c (diff) | |
download | bcm5719-llvm-8648c1018464b743019f6f1c796b200e49b5b8a8.tar.gz bcm5719-llvm-8648c1018464b743019f6f1c796b200e49b5b8a8.zip |
ARM assembly parsing and encoding support for LDRD(label).
rdar://9932658
llvm-svn: 146921
Diffstat (limited to 'llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp b/llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp index 854729fbbda..7e7dd4f9ab5 100644 --- a/llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp +++ b/llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp @@ -791,7 +791,7 @@ getT2AddrModeImm8s4OpValue(const MCInst &MI, unsigned OpIdx, assert(MO.isExpr() && "Unexpected machine operand type!"); const MCExpr *Expr = MO.getExpr(); - MCFixupKind Kind = MCFixupKind(ARM::fixup_arm_pcrel_10); + MCFixupKind Kind = MCFixupKind(ARM::fixup_t2_pcrel_10); Fixups.push_back(MCFixup::Create(0, Expr, Kind)); ++MCNumCPRelocations; @@ -993,6 +993,19 @@ getAddrMode3OpValue(const MCInst &MI, unsigned OpIdx, const MCOperand &MO = MI.getOperand(OpIdx); const MCOperand &MO1 = MI.getOperand(OpIdx+1); const MCOperand &MO2 = MI.getOperand(OpIdx+2); + + // If The first operand isn't a register, we have a label reference. + if (!MO.isReg()) { + unsigned Rn = getARMRegisterNumbering(ARM::PC); // Rn is PC. + + assert(MO.isExpr() && "Unexpected machine operand type!"); + const MCExpr *Expr = MO.getExpr(); + MCFixupKind Kind = MCFixupKind(ARM::fixup_arm_pcrel_10_unscaled); + Fixups.push_back(MCFixup::Create(0, Expr, Kind)); + + ++MCNumCPRelocations; + return (Rn << 9) | (1 << 13); + } unsigned Rn = getARMRegisterNumbering(MO.getReg()); unsigned Imm = MO2.getImm(); bool isAdd = ARM_AM::getAM3Op(Imm) == ARM_AM::add; |