Intel syntax: Fix parser match class to check memory operand size.
authorDevang Patel <dpatel@apple.com>
Tue, 17 Jan 2012 21:48:03 +0000 (21:48 +0000)
committerDevang Patel <dpatel@apple.com>
Tue, 17 Jan 2012 21:48:03 +0000 (21:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148338 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86InstrInfo.td
test/MC/X86/intel-syntax.s

index 663e07b0f08bfeeb44d16d0ea92ea1baf178bc1e..8518ed07dc5b48cfe69e312bd9236692aa3b7344 100644 (file)
@@ -318,7 +318,7 @@ def f256mem : X86MemOperand<"printf256mem">{
 def i8mem_NOREX : Operand<i64> {
   let PrintMethod = "printi8mem";
   let MIOperandInfo = (ops GR64_NOREX, i8imm, GR64_NOREX_NOSP, i32imm, i8imm);
-  let ParserMatchClass = X86MemAsmOperand;
+  let ParserMatchClass = X86Mem8AsmOperand;
   let OperandType = "OPERAND_MEMORY";
 }
 
@@ -332,7 +332,7 @@ def ptr_rc_tailcall : PointerLikeRegClass<2>;
 def i32mem_TC : Operand<i32> {
   let PrintMethod = "printi32mem";
   let MIOperandInfo = (ops GR32_TC, i8imm, GR32_TC, i32imm, i8imm);
-  let ParserMatchClass = X86MemAsmOperand;
+  let ParserMatchClass = X86Mem32AsmOperand;
   let OperandType = "OPERAND_MEMORY";
 }
 
@@ -343,7 +343,7 @@ def i64mem_TC : Operand<i64> {
   let PrintMethod = "printi64mem";
   let MIOperandInfo = (ops ptr_rc_tailcall, i8imm,
                        ptr_rc_tailcall, i32imm, i8imm);
-  let ParserMatchClass = X86MemAsmOperand;
+  let ParserMatchClass = X86Mem64AsmOperand;
   let OperandType = "OPERAND_MEMORY";
 }
 
index 42638f268543eaad6f78f462fa6e38faa5f6617f..46d3761f3df7cd5ca483da5a589d52bba5c078ce 100644 (file)
@@ -25,6 +25,8 @@ _main:
        mov     EAX, DWORD PTR [RSP + 4*RAX - 24]
 // CHECK:      movb    %dil, (%rdx,%rcx)
        mov     BYTE PTR [RDX + RCX], DIL
+// CHECK:      movzwl  2(%rcx), %edi
+       movzx   EDI, WORD PTR [RCX + 2]
 // CHECK:      callq   _test
        call    _test
        ret