OSDN Git Service

MC: Split the x86 asm matcher implementations by dialect
authorReid Kleckner <reid@kleckner.net>
Tue, 26 Aug 2014 20:32:34 +0000 (20:32 +0000)
committerReid Kleckner <reid@kleckner.net>
Tue, 26 Aug 2014 20:32:34 +0000 (20:32 +0000)
commit3c92309f0d95b7e247de682446ac47774f29af29
tree168f117121f7ac629155fd29210928281840889d
parent1d5cdfd75192df4a690b651ca86f110568a69dda
MC: Split the x86 asm matcher implementations by dialect

The existing matcher has lots of AT&T assembly dialect assumptions baked
into it.  In particular, the hack for resolving the size of a memory
operand by appending the four most common suffixes doesn't work at all.
The Intel assembly dialect mnemonic table has ambiguous entries, so we
need to try matching multiple times with different operand sizes, since
that's the only way to choose different instruction variants.

This makes us more compatible with gas's implementation of Intel
assembly syntax.  MSVC assumes you want byte-sized operations for the
instructions that we reject as ambiguous.

Reviewed By: grosbach

Differential Revision: http://reviews.llvm.org/D4747

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216481 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/AsmParser/X86AsmParser.cpp
lib/Target/X86/AsmParser/X86Operand.h
test/MC/X86/intel-syntax-ambiguous.s [new file with mode: 0644]
test/MC/X86/intel-syntax-ptr-sized.s [new file with mode: 0644]
test/MC/X86/intel-syntax.s