Work around some x86 Darwin assembler bugs

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25638 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2006-01-26 02:27:43 +00:00
parent f0b415f178
commit 67caa39e4c

View File

@ -220,6 +220,32 @@ void X86ATTAsmPrinter::printMemReference(const MachineInstr *MI, unsigned Op){
///
void X86ATTAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
++EmittedInsts;
// This works around some Darwin assembler bugs.
if (forDarwin) {
switch (MI->getOpcode()) {
case X86::REP_MOVSB:
O << "rep/movsb (%esi),(%edi)\n";
return;
case X86::REP_MOVSD:
O << "rep/movsl (%esi),(%edi)\n";
return;
case X86::REP_MOVSW:
O << "rep/movsw (%esi),(%edi)\n";
return;
case X86::REP_STOSB:
O << "rep/stosb\n";
return;
case X86::REP_STOSD:
O << "rep/stosl\n";
return;
case X86::REP_STOSW:
O << "rep/stosw\n";
return;
default:
break;
}
}
// Call the autogenerated instruction printer routines.
printInstruction(MI);
}