[llvm-commits] CVS: llvm/lib/Target/X86/Printer.cpp X86CodeEmitter.cpp
Chris Lattner
lattner at cs.uiuc.edu
Tue Feb 17 01:41:01 PST 2004
Changes in directory llvm/lib/Target/X86:
Printer.cpp updated: 1.84 -> 1.85
X86CodeEmitter.cpp updated: 1.51 -> 1.52
---
Log message:
Expand the repertoire of the forms we can print and encode.
---
Diffs of the changes: (+9 -9)
Index: llvm/lib/Target/X86/Printer.cpp
diff -u llvm/lib/Target/X86/Printer.cpp:1.84 llvm/lib/Target/X86/Printer.cpp:1.85
--- llvm/lib/Target/X86/Printer.cpp:1.84 Tue Feb 17 00:16:44 2004
+++ llvm/lib/Target/X86/Printer.cpp Tue Feb 17 01:40:44 2004
@@ -699,17 +699,16 @@
//
assert(MI->getOperand(0).isRegister() &&
(MI->getNumOperands() == 1+4 && isMem(MI, 1)) ||
- (MI->getNumOperands() == 2+4 && MI->getOperand(1).isRegister() &&
- isMem(MI, 2))
+(MI->getNumOperands() == 2+4 && MI->getOperand(5).isImmediate() && isMem(MI, 1))
&& "Bad format for MRMSrcMem!");
- if (MI->getNumOperands() == 2+4 &&
- MI->getOperand(0).getReg() != MI->getOperand(1).getReg())
- O << "**";
-
O << TII.getName(MI->getOpcode()) << " ";
printOp(MI->getOperand(0));
O << ", " << sizePtr(Desc) << " ";
- printMemReference(MI, MI->getNumOperands()-4);
+ printMemReference(MI, 1);
+ if (MI->getNumOperands() == 2+4) {
+ O << ", ";
+ printOp(MI->getOperand(5));
+ }
O << "\n";
return;
}
Index: llvm/lib/Target/X86/X86CodeEmitter.cpp
diff -u llvm/lib/Target/X86/X86CodeEmitter.cpp:1.51 llvm/lib/Target/X86/X86CodeEmitter.cpp:1.52
--- llvm/lib/Target/X86/X86CodeEmitter.cpp:1.51 Sun Feb 15 15:37:17 2004
+++ llvm/lib/Target/X86/X86CodeEmitter.cpp Tue Feb 17 01:40:44 2004
@@ -574,8 +574,9 @@
case X86II::MRMSrcMem:
MCE.emitByte(BaseOpcode);
- emitMemModRMByte(MI, MI.getNumOperands()-4,
- getX86RegNum(MI.getOperand(0).getReg()));
+ emitMemModRMByte(MI, 1, getX86RegNum(MI.getOperand(0).getReg()));
+ if (MI.getNumOperands() == 2+4)
+ emitConstant(MI.getOperand(5).getImmedValue(), sizeOfPtr(Desc));
break;
case X86II::MRMS0r: case X86II::MRMS1r:
More information about the llvm-commits
mailing list