1
0
mirror of https://github.com/c64scene-ar/llvm-6502.git synced 2025-04-11 16:37:42 +00:00

add a hack to lower MOV16r0 to MOV32r0 in MCInstLower, eliminating

the problem with subreg32 modifiers.  This gets all of Olden working
with the new asmprinter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81195 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2009-09-08 05:49:25 +00:00
parent ba3931b667
commit 7ffa3c8029

@ -39,6 +39,13 @@ MCSymbol *X86ATTAsmPrinter::GetPICBaseSymbol() {
}
static void lower_subreg32(MCInst *MI, unsigned OpNo) {
// Convert registers in the addr mode according to subreg32.
unsigned Reg = MI->getOperand(OpNo).getReg();
if (Reg != 0)
MI->getOperand(OpNo).setReg(getX86SubSuperRegister(Reg, MVT::i32));
}
static void lower_lea64_32mem(MCInst *MI, unsigned OpNo) {
// Convert registers in the addr mode according to subreg64.
@ -302,6 +309,11 @@ printInstructionThroughMCStreamer(const MachineInstr *MI) {
// Handle the 'subreg rewriting' for the lea64_32mem operand.
lower_lea64_32mem(&TmpInst, 1);
break;
case X86::MOV16r0:
TmpInst.setOpcode(X86::MOV32r0);
lower_subreg32(&TmpInst, 0);
break;
}
printInstruction(&TmpInst);