Intel syntax: Parse "BYTE PTR [RDX + RCX]"

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148334 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2012-01-17 21:25:10 +00:00
parent fced294599
commit 6220fea2a8
2 changed files with 6 additions and 0 deletions

View 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();
}
}

View 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