[llvm-commits] [llvm] r75937 - in /llvm/trunk/lib/Target/SystemZ: AsmPrinter/SystemZAsmPrinter.cpp SystemZISelDAGToDAG.cpp SystemZInstrInfo.td
Anton Korobeynikov
asl at math.spbu.ru
Thu Jul 16 06:48:43 PDT 2009
Author: asl
Date: Thu Jul 16 08:48:42 2009
New Revision: 75937
URL: http://llvm.org/viewvc/llvm-project?rev=75937&view=rev
Log:
Swap the order of imm and idx field for rri addrmode in order to make handling of rri and ri addrmodes common
Modified:
llvm/trunk/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp
llvm/trunk/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp
llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.td
Modified: llvm/trunk/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp?rev=75937&r1=75936&r2=75937&view=diff
==============================================================================
--- llvm/trunk/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp Thu Jul 16 08:48:42 2009
@@ -208,10 +208,10 @@
void SystemZAsmPrinter::printRRIAddrOperand(const MachineInstr *MI, int OpNum,
const char* Modifier) {
const MachineOperand &Base = MI->getOperand(OpNum);
- const MachineOperand &Index = MI->getOperand(OpNum+1);
+ const MachineOperand &Index = MI->getOperand(OpNum+2);
// Print displacement operand.
- printOperand(MI, OpNum+2);
+ printOperand(MI, OpNum+1);
// Print base operand (if any)
if (Base.getReg()) {
@@ -219,7 +219,7 @@
printOperand(MI, OpNum);
if (Index.getReg()) {
O << ',';
- printOperand(MI, OpNum+1);
+ printOperand(MI, OpNum+2);
}
O << ')';
} else
Modified: llvm/trunk/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp?rev=75937&r1=75936&r2=75937&view=diff
==============================================================================
--- llvm/trunk/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp Thu Jul 16 08:48:42 2009
@@ -105,14 +105,14 @@
#include "SystemZGenDAGISel.inc"
private:
+ bool SelectAddrRI(const SDValue& Op, SDValue& Addr,
+ SDValue &Base, SDValue &Disp);
bool SelectAddrRRI(SDValue Op, SDValue Addr,
- SDValue &Base, SDValue &Index, SDValue &Disp);
+ SDValue &Base, SDValue &Disp, SDValue &Index);
bool SelectLAAddr(SDValue Op, SDValue Addr,
- SDValue &Base, SDValue &Index, SDValue &Disp);
+ SDValue &Base, SDValue &Disp, SDValue &Index);
SDNode *Select(SDValue Op);
- bool SelectAddrRI(const SDValue& Op, SDValue& Addr,
- SDValue &Base, SDValue &Disp);
bool MatchAddress(SDValue N, SystemZRRIAddressMode &AM, unsigned Depth = 0);
bool MatchAddressBase(SDValue N, SystemZRRIAddressMode &AM);
@@ -368,7 +368,7 @@
/// Returns true if the address can be represented by a base register plus
/// index register plus a signed 20-bit displacement [base + idx + imm].
bool SystemZDAGToDAGISel::SelectAddrRRI(SDValue Op, SDValue Addr,
- SDValue &Base, SDValue &Index, SDValue &Disp) {
+ SDValue &Base, SDValue &Disp, SDValue &Index) {
SystemZRRIAddressMode AM;
bool Done = false;
@@ -417,7 +417,7 @@
/// SelectLAAddr - it calls SelectAddr and determines if the maximal addressing
/// mode it matches can be cost effectively emitted as an LA/LAY instruction.
bool SystemZDAGToDAGISel::SelectLAAddr(SDValue Op, SDValue Addr,
- SDValue &Base, SDValue &Index, SDValue &Disp) {
+ SDValue &Base, SDValue &Disp, SDValue &Index) {
SystemZRRIAddressMode AM;
if (MatchAddress(Addr, AM))
Modified: llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.td?rev=75937&r1=75936&r2=75937&view=diff
==============================================================================
--- llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.td (original)
+++ llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.td Thu Jul 16 08:48:42 2009
@@ -164,12 +164,12 @@
def rriaddr : Operand<i64>,
ComplexPattern<i64, 3, "SelectAddrRRI", [], []> {
let PrintMethod = "printRRIAddrOperand";
- let MIOperandInfo = (ops ADDR64:$base, ADDR64:$index, i64imm:$disp);
+ let MIOperandInfo = (ops ADDR64:$base, i64imm:$disp, ADDR64:$index);
}
def laaddr : Operand<i64>,
ComplexPattern<i64, 3, "SelectLAAddr", [add, sub, or, frameindex], []> {
let PrintMethod = "printRRIAddrOperand";
- let MIOperandInfo = (ops ADDR64:$base, ADDR64:$index, i64imm:$disp);
+ let MIOperandInfo = (ops ADDR64:$base, i64imm:$disp, ADDR64:$index);
}
More information about the llvm-commits
mailing list