summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM64/InstPrinter
diff options
context:
space:
mode:
authorBradley Smith <bradley.smith@arm.com>2014-04-09 14:44:31 +0000
committerBradley Smith <bradley.smith@arm.com>2014-04-09 14:44:31 +0000
commita0d7a9a12f25fa0fa11ba44e58ea0e4e9f0e5f85 (patch)
tree6e867164b3e2f3971599e9c8c5de42846c2e9476 /llvm/lib/Target/ARM64/InstPrinter
parent70c6acbbfd0c00ec8a950a75ac2f3fcadb328970 (diff)
downloadbcm5719-llvm-a0d7a9a12f25fa0fa11ba44e58ea0e4e9f0e5f85.tar.gz
bcm5719-llvm-a0d7a9a12f25fa0fa11ba44e58ea0e4e9f0e5f85.zip
[ARM64] When printing a pre-indexed address with #0, the ', #0' is not optional.
llvm-svn: 205892
Diffstat (limited to 'llvm/lib/Target/ARM64/InstPrinter')
-rw-r--r--llvm/lib/Target/ARM64/InstPrinter/ARM64InstPrinter.cpp13
-rw-r--r--llvm/lib/Target/ARM64/InstPrinter/ARM64InstPrinter.h20
2 files changed, 33 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM64/InstPrinter/ARM64InstPrinter.cpp b/llvm/lib/Target/ARM64/InstPrinter/ARM64InstPrinter.cpp
index a10624a0f89..ffa4a33b626 100644
--- a/llvm/lib/Target/ARM64/InstPrinter/ARM64InstPrinter.cpp
+++ b/llvm/lib/Target/ARM64/InstPrinter/ARM64InstPrinter.cpp
@@ -1200,6 +1200,19 @@ void ARM64InstPrinter::printAMIndexed(const MCInst *MI, unsigned OpNum,
O << ']';
}
+void ARM64InstPrinter::printAMIndexedWB(const MCInst *MI, unsigned OpNum,
+ unsigned Scale, raw_ostream &O) {
+ const MCOperand MO1 = MI->getOperand(OpNum + 1);
+ O << '[' << getRegisterName(MI->getOperand(OpNum).getReg());
+ if (MO1.isImm()) {
+ O << ", #" << (MO1.getImm() * Scale);
+ } else {
+ assert(MO1.isExpr() && "Unexpected operand type!");
+ O << ", " << *MO1.getExpr();
+ }
+ O << ']';
+}
+
void ARM64InstPrinter::printPrefetchOp(const MCInst *MI, unsigned OpNum,
raw_ostream &O) {
unsigned prfop = MI->getOperand(OpNum).getImm();
diff --git a/llvm/lib/Target/ARM64/InstPrinter/ARM64InstPrinter.h b/llvm/lib/Target/ARM64/InstPrinter/ARM64InstPrinter.h
index 13e92899c81..778e8651b8f 100644
--- a/llvm/lib/Target/ARM64/InstPrinter/ARM64InstPrinter.h
+++ b/llvm/lib/Target/ARM64/InstPrinter/ARM64InstPrinter.h
@@ -73,28 +73,48 @@ protected:
raw_ostream &O);
void printAMIndexed(const MCInst *MI, unsigned OpNum, unsigned Scale,
raw_ostream &O);
+ void printAMIndexedWB(const MCInst *MI, unsigned OpNum, unsigned Scale,
+ raw_ostream &O);
void printAMIndexed128(const MCInst *MI, unsigned OpNum, raw_ostream &O) {
printAMIndexed(MI, OpNum, 16, O);
}
+ void printAMIndexed128WB(const MCInst *MI, unsigned OpNum, raw_ostream &O) {
+ printAMIndexedWB(MI, OpNum, 16, O);
+ }
void printAMIndexed64(const MCInst *MI, unsigned OpNum, raw_ostream &O) {
printAMIndexed(MI, OpNum, 8, O);
}
+ void printAMIndexed64WB(const MCInst *MI, unsigned OpNum, raw_ostream &O) {
+ printAMIndexedWB(MI, OpNum, 8, O);
+ }
void printAMIndexed32(const MCInst *MI, unsigned OpNum, raw_ostream &O) {
printAMIndexed(MI, OpNum, 4, O);
}
+ void printAMIndexed32WB(const MCInst *MI, unsigned OpNum, raw_ostream &O) {
+ printAMIndexedWB(MI, OpNum, 4, O);
+ }
void printAMIndexed16(const MCInst *MI, unsigned OpNum, raw_ostream &O) {
printAMIndexed(MI, OpNum, 2, O);
}
+ void printAMIndexed16WB(const MCInst *MI, unsigned OpNum, raw_ostream &O) {
+ printAMIndexedWB(MI, OpNum, 2, O);
+ }
void printAMIndexed8(const MCInst *MI, unsigned OpNum, raw_ostream &O) {
printAMIndexed(MI, OpNum, 1, O);
}
+ void printAMIndexed8WB(const MCInst *MI, unsigned OpNum, raw_ostream &O) {
+ printAMIndexedWB(MI, OpNum, 1, O);
+ }
void printAMUnscaled(const MCInst *MI, unsigned OpNum, raw_ostream &O) {
printAMIndexed(MI, OpNum, 1, O);
}
+ void printAMUnscaledWB(const MCInst *MI, unsigned OpNum, raw_ostream &O) {
+ printAMIndexedWB(MI, OpNum, 1, O);
+ }
void printAMNoIndex(const MCInst *MI, unsigned OpNum, raw_ostream &O);
void printImmScale4(const MCInst *MI, unsigned OpNum, raw_ostream &O);
void printImmScale8(const MCInst *MI, unsigned OpNum, raw_ostream &O);
OpenPOWER on IntegriCloud