aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/ARM/AsmPrinter
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2010-03-20 22:13:40 +0000
committerBob Wilson <bob.wilson@apple.com>2010-03-20 22:13:40 +0000
commit255e748b064722604ac95dc365639f0035c3e48a (patch)
tree810462699200a53793f916326b5e6f9726aeaa31 /lib/Target/ARM/AsmPrinter
parent029da9589fbb6ab0321af1cdc5582fa93074907a (diff)
downloadexternal_llvm-255e748b064722604ac95dc365639f0035c3e48a.zip
external_llvm-255e748b064722604ac95dc365639f0035c3e48a.tar.gz
external_llvm-255e748b064722604ac95dc365639f0035c3e48a.tar.bz2
Re-commit r98683 ("remove redundant writeback flag from ARM address mode 6")
with changes to add a separate optional register update argument. Change all the NEON instructions with address register writeback to use it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99095 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/AsmPrinter')
-rw-r--r--lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp20
-rw-r--r--lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp23
-rw-r--r--lib/Target/ARM/AsmPrinter/ARMInstPrinter.h1
3 files changed, 25 insertions, 19 deletions
diff --git a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
index ce7c488..4a7a1e4 100644
--- a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
+++ b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
@@ -101,6 +101,7 @@ namespace {
void printAddrMode5Operand(const MachineInstr *MI, int OpNum,
const char *Modifier = 0);
void printAddrMode6Operand(const MachineInstr *MI, int OpNum);
+ void printAddrMode6OffsetOperand(const MachineInstr *MI, int OpNum);
void printAddrModePCOperand(const MachineInstr *MI, int OpNum,
const char *Modifier = 0);
void printBitfieldInvMaskImmOperand (const MachineInstr *MI, int OpNum);
@@ -562,22 +563,21 @@ void ARMAsmPrinter::printAddrMode5Operand(const MachineInstr *MI, int Op,
void ARMAsmPrinter::printAddrMode6Operand(const MachineInstr *MI, int Op) {
const MachineOperand &MO1 = MI->getOperand(Op);
const MachineOperand &MO2 = MI->getOperand(Op+1);
- const MachineOperand &MO3 = MI->getOperand(Op+2);
- const MachineOperand &MO4 = MI->getOperand(Op+3);
O << "[" << getRegisterName(MO1.getReg());
- if (MO4.getImm()) {
+ if (MO2.getImm()) {
// FIXME: Both darwin as and GNU as violate ARM docs here.
- O << ", :" << MO4.getImm();
+ O << ", :" << MO2.getImm();
}
O << "]";
+}
- if (ARM_AM::getAM6WBFlag(MO3.getImm())) {
- if (MO2.getReg() == 0)
- O << "!";
- else
- O << ", " << getRegisterName(MO2.getReg());
- }
+void ARMAsmPrinter::printAddrMode6OffsetOperand(const MachineInstr *MI, int Op){
+ const MachineOperand &MO = MI->getOperand(Op);
+ if (MO.getReg() == 0)
+ O << "!";
+ else
+ O << ", " << getRegisterName(MO.getReg());
}
void ARMAsmPrinter::printAddrModePCOperand(const MachineInstr *MI, int Op,
diff --git a/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp b/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp
index 33db90e..30763a9 100644
--- a/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp
+++ b/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp
@@ -428,17 +428,22 @@ void ARMInstPrinter::printAddrMode5Operand(const MCInst *MI, unsigned OpNum,
void ARMInstPrinter::printAddrMode6Operand(const MCInst *MI, unsigned OpNum) {
const MCOperand &MO1 = MI->getOperand(OpNum);
const MCOperand &MO2 = MI->getOperand(OpNum+1);
- const MCOperand &MO3 = MI->getOperand(OpNum+2);
-
- // FIXME: No support yet for specifying alignment.
- O << '[' << getRegisterName(MO1.getReg()) << ']';
- if (ARM_AM::getAM6WBFlag(MO3.getImm())) {
- if (MO2.getReg() == 0)
- O << '!';
- else
- O << ", " << getRegisterName(MO2.getReg());
+ O << "[" << getRegisterName(MO1.getReg());
+ if (MO2.getImm()) {
+ // FIXME: Both darwin as and GNU as violate ARM docs here.
+ O << ", :" << MO2.getImm();
}
+ O << "]";
+}
+
+void ARMInstPrinter::printAddrMode6OffsetOperand(const MCInst *MI,
+ unsigned OpNum) {
+ const MCOperand &MO = MI->getOperand(OpNum);
+ if (MO.getReg() == 0)
+ O << "!";
+ else
+ O << ", " << getRegisterName(MO.getReg());
}
void ARMInstPrinter::printAddrModePCOperand(const MCInst *MI, unsigned OpNum,
diff --git a/lib/Target/ARM/AsmPrinter/ARMInstPrinter.h b/lib/Target/ARM/AsmPrinter/ARMInstPrinter.h
index ceb641d..d41b5df 100644
--- a/lib/Target/ARM/AsmPrinter/ARMInstPrinter.h
+++ b/lib/Target/ARM/AsmPrinter/ARMInstPrinter.h
@@ -48,6 +48,7 @@ public:
void printAddrMode5Operand(const MCInst *MI, unsigned OpNum,
const char *Modifier = 0);
void printAddrMode6Operand(const MCInst *MI, unsigned OpNum);
+ void printAddrMode6OffsetOperand(const MCInst *MI, unsigned OpNum);
void printAddrModePCOperand(const MCInst *MI, unsigned OpNum,
const char *Modifier = 0);