MC/X86: Chris pointed that 'as' isn't consistent in accepting the long form of
authorDaniel Dunbar <daniel@zuster.org>
Tue, 4 May 2010 17:31:02 +0000 (17:31 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 4 May 2010 17:31:02 +0000 (17:31 +0000)
instructions which have no direct register usage.

Darwin 'as' accepts:
  add $0, (%rax)
but rejects
  mov $0, (%rax)
for example.

Given that, only accept suffix matches which match exactly one form. We still
need to emit nice diagnostics for failures...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103015 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/AsmParser/X86AsmParser.cpp
test/MC/AsmParser/X86/x86_64-suffix-matching.s

index aaa1c0620baf606699cf42d33b2f8e5fdded50f0..6b403c10a1eb78944aa170434e9a5777925bb889 100644 (file)
@@ -683,11 +683,6 @@ X86ATTAsmParser::MatchInstruction(const SmallVectorImpl<MCParsedAsmOperand*>
   if (MatchB + MatchW + MatchL == 2)
     return false;
 
-  // Similarly, if all three matched then we assume this is a generic operation
-  // involving memory, and take the 'l' form (to match 'gas').
-  if (MatchB + MatchW + MatchL == 0)
-    return false;
-
   // Otherwise, the match failed.
   return true;
 }
index 9a38e1bb06ebcb3130fdd4f9696c6e9f2e055cf4..c4f0be2c6eab3b07595787b32ca5b4d69ac6fbe2 100644 (file)
@@ -4,5 +4,3 @@
         add $0, %eax
 // CHECK: addb $255, %al
         add $0xFF, %al
-// CHECK: addl $0, (%rax)
-        add $0, 0(%rax)