summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp
diff options
context:
space:
mode:
authorMihai Popa <mihail.popa@gmail.com>2013-07-03 09:21:44 +0000
committerMihai Popa <mihail.popa@gmail.com>2013-07-03 09:21:44 +0000
commitd36cbaa4231e51a42d761d298ff20aaa6e88d014 (patch)
tree978fd1c7d3586a4133e477ce7e8d4ead7357e2ad /llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp
parent36b2417f18f4b44d184cb54b5395d2f3e4397b18 (diff)
downloadbcm5719-llvm-d36cbaa4231e51a42d761d298ff20aaa6e88d014.tar.gz
bcm5719-llvm-d36cbaa4231e51a42d761d298ff20aaa6e88d014.zip
This corrects the implementation of Thumb ADR instruction. There are three issues:
1. it should accept only 4-byte aligned addresses 2. the maximum offset should be 1020 3. it should be encoded with the offset scaled by two bits llvm-svn: 185528
Diffstat (limited to 'llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp')
-rw-r--r--llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp b/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp
index 1797c6c3814..97da232cf08 100644
--- a/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp
+++ b/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp
@@ -900,6 +900,7 @@ void ARMInstPrinter::printPCLabel(const MCInst *MI, unsigned OpNum,
llvm_unreachable("Unhandled PC-relative pseudo-instruction!");
}
+template<unsigned scale>
void ARMInstPrinter::printAdrLabelOperand(const MCInst *MI, unsigned OpNum,
raw_ostream &O) {
const MCOperand &MO = MI->getOperand(OpNum);
@@ -909,7 +910,7 @@ void ARMInstPrinter::printAdrLabelOperand(const MCInst *MI, unsigned OpNum,
return;
}
- int32_t OffImm = (int32_t)MO.getImm();
+ int32_t OffImm = (int32_t)MO.getImm() << scale;
O << markup("<imm:");
if (OffImm == INT32_MIN)
OpenPOWER on IntegriCloud