summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-09-08 05:49:25 +0000
committerChris Lattner <sabre@nondot.org>2009-09-08 05:49:25 +0000
commit7ffa3c80294a2a55b5945b2a6bab43354c801033 (patch)
tree93ff6204307a570f9e29e63d2cef4e8d5e087639
parentba3931b667ea2c8f30dff4cd176a106d6d4cb51c (diff)
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
-rw-r--r--lib/Target/X86/AsmPrinter/X86MCInstLower.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp b/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
index 0a1f87e7996..7cafe83fc7a 100644
--- a/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
+++ b/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
@@ -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);