Intel syntax: Parse "BYTE PTR [RDX + RCX]"
authorDevang Patel <dpatel@apple.com>
Tue, 17 Jan 2012 21:25:10 +0000 (21:25 +0000)
committerDevang Patel <dpatel@apple.com>
Tue, 17 Jan 2012 21:25:10 +0000 (21:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148334 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/AsmParser/X86AsmParser.cpp
test/MC/X86/intel-syntax.s

index b31993c0f200625b7f8c3019053d47d8403d91a5..75e286625b8005cf0c0e9938e4283dd0b7c923bd 100644 (file)
@@ -637,6 +637,10 @@ X86Operand *X86AsmParser::ParseIntelBracExpression(unsigned Size) {
         Disp = isPlus ? ValExpr : MCUnaryExpr::CreateMinus(ValExpr, getContext());
       } else
         return ErrorOperand(PlusLoc, "unexpected token after +");
+    } else if (getLexer().is(AsmToken::Identifier)) {
+      IndexReg = getIntelRegisterOperand(Tok.getString());
+      if (IndexReg)
+       Parser.Lex();
     }
   }
 
index 2966dd7822d5c67ffbda1f11391e6109cd17dfed..42638f268543eaad6f78f462fa6e38faa5f6617f 100644 (file)
@@ -23,6 +23,8 @@ _main:
        mov     RCX, QWORD PTR [0]
 // CHECK:      movl    -24(%rsp,%rax,4), %eax  
        mov     EAX, DWORD PTR [RSP + 4*RAX - 24]
+// CHECK:      movb    %dil, (%rdx,%rcx)
+       mov     BYTE PTR [RDX + RCX], DIL
 // CHECK:      callq   _test
        call    _test
        ret