Expand the repertoire of the forms we can print and encode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11537 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2004-02-17 07:40:44 +00:00
parent 651fd55d5f
commit 5b67252620
3 changed files with 15 additions and 16 deletions

View File

@ -699,17 +699,16 @@ void Printer::printMachineInstruction(const MachineInstr *MI) {
//
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;
}

View File

@ -699,17 +699,16 @@ void Printer::printMachineInstruction(const MachineInstr *MI) {
//
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;
}

View File

@ -574,8 +574,9 @@ void Emitter::emitInstruction(MachineInstr &MI) {
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: