[llvm-commits] [llvm] r84566 - in /llvm/trunk/lib/Target/ARM/AsmPrinter: ARMInstPrinter.cpp ARMMCInstLower.cpp
Chris Lattner
sabre at nondot.org
Mon Oct 19 16:31:43 PDT 2009
Author: lattner
Date: Mon Oct 19 18:31:43 2009
New Revision: 84566
URL: http://llvm.org/viewvc/llvm-project?rev=84566&view=rev
Log:
handle addmode4 modifiers, fix a fixme in printRegisterList
by ignoring all implicit regs when lowering.
Modified:
llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp
llvm/trunk/lib/Target/ARM/AsmPrinter/ARMMCInstLower.cpp
Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp?rev=84566&r1=84565&r2=84566&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp Mon Oct 19 18:31:43 2009
@@ -116,13 +116,10 @@
void ARMInstPrinter::printAddrMode4Operand(const MCInst *MI, unsigned OpNum,
const char *Modifier) {
- // FIXME: ENABLE assert.
- //assert((Modifier == 0 || Modifier[0] == 0) && "Cannot print modifiers");
-
const MCOperand &MO1 = MI->getOperand(OpNum);
const MCOperand &MO2 = MI->getOperand(OpNum+1);
ARM_AM::AMSubMode Mode = ARM_AM::getAM4SubMode(MO2.getImm());
- if (0 && Modifier && strcmp(Modifier, "submode") == 0) {
+ if (Modifier && strcmp(Modifier, "submode") == 0) {
if (MO1.getReg() == ARM::SP) {
// FIXME
bool isLDM = (MI->getOpcode() == ARM::LDM ||
@@ -132,7 +129,7 @@
O << ARM_AM::getAMSubModeAltStr(Mode, isLDM);
} else
O << ARM_AM::getAMSubModeStr(Mode);
- } else if (0 && Modifier && strcmp(Modifier, "wide") == 0) {
+ } else if (Modifier && strcmp(Modifier, "wide") == 0) {
ARM_AM::AMSubMode Mode = ARM_AM::getAM4SubMode(MO2.getImm());
if (Mode == ARM_AM::ia)
O << ".w";
@@ -147,12 +144,7 @@
O << "{";
// Always skip the first operand, it's the optional (and implicit writeback).
for (unsigned i = OpNum+1, e = MI->getNumOperands(); i != e; ++i) {
-#if 0 // FIXME: HANDLE WHEN LOWERING??
- if (MI->getOperand(i).isImplicit())
- continue;
-#endif
if (i != OpNum+1) O << ", ";
-
O << getRegisterName(MI->getOperand(i).getReg());
}
O << "}";
Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMMCInstLower.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMMCInstLower.cpp?rev=84566&r1=84565&r2=84566&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMMCInstLower.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMMCInstLower.cpp Mon Oct 19 18:31:43 2009
@@ -118,6 +118,8 @@
MI->dump();
assert(0 && "unknown operand type");
case MachineOperand::MO_Register:
+ // Ignore all implicit register operands.
+ if (MO.isImplicit()) continue;
MCOp = MCOperand::CreateReg(MO.getReg());
break;
case MachineOperand::MO_Immediate:
More information about the llvm-commits
mailing list