[llvm-commits] [llvm] r103535 - in /llvm/trunk: lib/Target/X86/AsmParser/X86AsmParser.cpp test/MC/AsmParser/X86/x86_64-suffix-matching.s

Daniel Dunbar daniel at zuster.org
Tue May 11 17:54:20 PDT 2010


Author: ddunbar
Date: Tue May 11 19:54:20 2010
New Revision: 103535

URL: http://llvm.org/viewvc/llvm-project?rev=103535&view=rev
Log:
MC/X86: Extend suffix matching hack to match 'q' suffix.

Modified:
    llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
    llvm/trunk/test/MC/AsmParser/X86/x86_64-suffix-matching.s

Modified: llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp?rev=103535&r1=103534&r2=103535&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Tue May 11 19:54:20 2010
@@ -673,6 +673,8 @@
   bool MatchW = MatchInstructionImpl(Operands, Inst);
   Tmp[Base.size()] = 'l';
   bool MatchL = MatchInstructionImpl(Operands, Inst);
+  Tmp[Base.size()] = 'q';
+  bool MatchQ = MatchInstructionImpl(Operands, Inst);
 
   // Restore the old token.
   Op->setTokenValue(Base);
@@ -680,7 +682,7 @@
   // If exactly one matched, then we treat that as a successful match (and the
   // instruction will already have been filled in correctly, since the failing
   // matches won't have modified it).
-  if (MatchB + MatchW + MatchL == 2)
+  if (MatchB + MatchW + MatchL + MatchQ == 3)
     return false;
 
   // Otherwise, the match failed.

Modified: llvm/trunk/test/MC/AsmParser/X86/x86_64-suffix-matching.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_64-suffix-matching.s?rev=103535&r1=103534&r2=103535&view=diff
==============================================================================
--- llvm/trunk/test/MC/AsmParser/X86/x86_64-suffix-matching.s (original)
+++ llvm/trunk/test/MC/AsmParser/X86/x86_64-suffix-matching.s Tue May 11 19:54:20 2010
@@ -4,3 +4,7 @@
         add $0, %eax
 // CHECK: addb $255, %al
         add $0xFF, %al
+// CHECK: orq %rax, %rdx
+        or %rax, %rdx
+// CHECK: shlq $3, %rax
+        shl $3, %rax





More information about the llvm-commits mailing list