[llvm] 56edcbc - Fix misspelled instruction in X86 assembly parser

Eric Astor via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 13 15:34:36 PDT 2021


Author: Eric Astor
Date: 2021-06-13T18:34:15-04:00
New Revision: 56edcbc2ad8c15b01fd8b47c1f2665d274d0e896

URL: https://github.com/llvm/llvm-project/commit/56edcbc2ad8c15b01fd8b47c1f2665d274d0e896
DIFF: https://github.com/llvm/llvm-project/commit/56edcbc2ad8c15b01fd8b47c1f2665d274d0e896.diff

LOG: Fix misspelled instruction in X86 assembly parser

Did not correctly handle "jecxz short <address>".

Discovered while working on LLVM-ML; shows up in z_Windows_NT-586_asm.asm from the OpenMP runtime

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D104194

Added: 
    

Modified: 
    llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
    llvm/test/MC/X86/intel-syntax.s

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
index c21b5042f0de1..7f01f81605a5d 100644
--- a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -3101,7 +3101,7 @@ bool X86AsmParser::ParseInstruction(ParseInstructionInfo &Info, StringRef Name,
   // Hack to skip "short" following Jcc.
   if (isParsingIntelSyntax() &&
       (PatchedName == "jmp" || PatchedName == "jc" || PatchedName == "jnc" ||
-       PatchedName == "jcxz" || PatchedName == "jexcz" ||
+       PatchedName == "jcxz" || PatchedName == "jecxz" ||
        (PatchedName.startswith("j") &&
         ParseConditionCode(PatchedName.substr(1)) != X86::COND_INVALID))) {
     StringRef NextTok = Parser.getTok().getString();

diff  --git a/llvm/test/MC/X86/intel-syntax.s b/llvm/test/MC/X86/intel-syntax.s
index b11402c44e96e..2b365699eec7b 100644
--- a/llvm/test/MC/X86/intel-syntax.s
+++ b/llvm/test/MC/X86/intel-syntax.s
@@ -66,6 +66,12 @@ main:
   ljmp [rax]
 // CHECK: jmp _foo
   jmp short _foo
+// CHECK: jb _foo
+  jc short _foo
+// CHECK: jae _foo
+  jnc short _foo
+// CHECK: jecxz _foo
+  jecxz short _foo
 // CHECK: jp _foo
   jpe short _foo
 


        


More information about the llvm-commits mailing list