[llvm-commits] [llvm] r70734 - in /llvm/trunk/lib/Target/MSP430: MSP430AsmPrinter.cpp MSP430ISelDAGToDAG.cpp MSP430InstrInfo.td
Anton Korobeynikov
asl at math.spbu.ru
Sun May 3 06:09:40 PDT 2009
Author: asl
Date: Sun May 3 08:09:40 2009
New Revision: 70734
URL: http://llvm.org/viewvc/llvm-project?rev=70734&view=rev
Log:
Reverse order of memory arguments
Modified:
llvm/trunk/lib/Target/MSP430/MSP430AsmPrinter.cpp
llvm/trunk/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp
llvm/trunk/lib/Target/MSP430/MSP430InstrInfo.td
Modified: llvm/trunk/lib/Target/MSP430/MSP430AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430AsmPrinter.cpp?rev=70734&r1=70733&r2=70734&view=diff
==============================================================================
--- llvm/trunk/lib/Target/MSP430/MSP430AsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/MSP430/MSP430AsmPrinter.cpp Sun May 3 08:09:40 2009
@@ -161,22 +161,22 @@
void MSP430AsmPrinter::printSrcMemOperand(const MachineInstr *MI, int OpNum,
const char* Modifier) {
- const MachineOperand &Disp = MI->getOperand(OpNum);
- const MachineOperand &Base = MI->getOperand(OpNum+1);
+ const MachineOperand &Base = MI->getOperand(OpNum);
+ const MachineOperand &Disp = MI->getOperand(OpNum+1);
- if (Disp.isGlobal())
+ if (Base.isGlobal())
printOperand(MI, OpNum, "mem");
else if (Disp.isImm() && !Base.getReg())
printOperand(MI, OpNum);
else if (Base.getReg()) {
if (Disp.getImm()) {
- printOperand(MI, OpNum, "nohash");
+ printOperand(MI, OpNum + 1, "nohash");
O << '(';
- printOperand(MI, OpNum + 1);
+ printOperand(MI, OpNum);
O << ')';
} else {
O << '@';
- printOperand(MI, OpNum + 1);
+ printOperand(MI, OpNum);
}
} else
assert(0 && "Unsupported memory operand");
Modified: llvm/trunk/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp?rev=70734&r1=70733&r2=70734&view=diff
==============================================================================
--- llvm/trunk/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp Sun May 3 08:09:40 2009
@@ -57,7 +57,7 @@
private:
SDNode *Select(SDValue Op);
- bool SelectAddr(SDValue Op, SDValue Addr, SDValue &Disp, SDValue &Base);
+ bool SelectAddr(SDValue Op, SDValue Addr, SDValue &Base, SDValue &Disp);
#ifndef NDEBUG
unsigned Indent;
@@ -74,7 +74,7 @@
// FIXME: This is pretty dummy routine and needs to be rewritten in the future.
bool MSP430DAGToDAGISel::SelectAddr(SDValue Op, SDValue Addr,
- SDValue &Disp, SDValue &Base) {
+ SDValue &Base, SDValue &Disp) {
// We don't support frame index stuff yet.
if (isa<FrameIndexSDNode>(Addr))
return false;
@@ -100,17 +100,17 @@
case MSP430ISD::Wrapper:
SDValue N0 = Addr.getOperand(0);
if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(N0)) {
- Base = CurDAG->getRegister(0, MVT::i16);
- Disp = CurDAG->getTargetGlobalAddress(G->getGlobal(),
+ Base = CurDAG->getTargetGlobalAddress(G->getGlobal(),
MVT::i16, G->getOffset());
+ Disp = CurDAG->getTargetConstant(0, MVT::i16);
return true;
}
break;
};
- Base = CurDAG->getRegister(0, MVT::i16);
- Disp = Addr;
+ Base = Addr;
+ Disp = CurDAG->getTargetConstant(0, MVT::i16);
return true;
}
Modified: llvm/trunk/lib/Target/MSP430/MSP430InstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430InstrInfo.td?rev=70734&r1=70733&r2=70734&view=diff
==============================================================================
--- llvm/trunk/lib/Target/MSP430/MSP430InstrInfo.td (original)
+++ llvm/trunk/lib/Target/MSP430/MSP430InstrInfo.td Sun May 3 08:09:40 2009
@@ -52,12 +52,12 @@
// Address operands
def memsrc : Operand<i16> {
let PrintMethod = "printSrcMemOperand";
- let MIOperandInfo = (ops i16imm, GR16);
+ let MIOperandInfo = (ops GR16, i16imm);
}
def memdst : Operand<i16> {
let PrintMethod = "printSrcMemOperand";
- let MIOperandInfo = (ops i16imm, GR16);
+ let MIOperandInfo = (ops GR16, i16imm);
}
More information about the llvm-commits
mailing list