From e9f0fb4179d57c631a72fa8020ca05a4d132e15b Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Tue, 4 May 2010 17:31:02 +0000 Subject: [PATCH] MC/X86: Chris pointed that 'as' isn't consistent in accepting the long form of 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 | 5 ----- test/MC/AsmParser/X86/x86_64-suffix-matching.s | 2 -- 2 files changed, 7 deletions(-) diff --git a/lib/Target/X86/AsmParser/X86AsmParser.cpp b/lib/Target/X86/AsmParser/X86AsmParser.cpp index aaa1c0620ba..6b403c10a1e 100644 --- a/lib/Target/X86/AsmParser/X86AsmParser.cpp +++ b/lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -683,11 +683,6 @@ X86ATTAsmParser::MatchInstruction(const SmallVectorImpl 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; } diff --git a/test/MC/AsmParser/X86/x86_64-suffix-matching.s b/test/MC/AsmParser/X86/x86_64-suffix-matching.s index 9a38e1bb06e..c4f0be2c6ea 100644 --- a/test/MC/AsmParser/X86/x86_64-suffix-matching.s +++ b/test/MC/AsmParser/X86/x86_64-suffix-matching.s @@ -4,5 +4,3 @@ add $0, %eax // CHECK: addb $255, %al add $0xFF, %al -// CHECK: addl $0, (%rax) - add $0, 0(%rax)