[PATCH] D24957: [x86][ms-inline-asm] use of "jmp short" in asm is not supported

Ziv Izhar via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 6 04:30:54 PDT 2016


zizhar removed rL LLVM as the repository for this revision.
zizhar updated this revision to Diff 73762.
zizhar added a comment.

fixed :>


https://reviews.llvm.org/D24957

Files:
  lib/Target/X86/AsmParser/X86AsmParser.cpp


Index: lib/Target/X86/AsmParser/X86AsmParser.cpp
===================================================================
--- lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -2132,6 +2132,20 @@
   InstInfo = &Info;
   StringRef PatchedName = Name;
 
+  if (Name == "jmp" && isParsingIntelSyntax() && isParsingInlineAsm()) {
+    StringRef NextTok = Parser.getTok().getString();
+    if (NextTok == "short") {
+      SMLoc NameEndLoc =
+          NameLoc.getFromPointer(NameLoc.getPointer() + Name.size());
+      // Eat the short keyword
+      Parser.Lex();
+      // MS ignores the short keyword, it determines the jmp type based
+      // on the distance of the label
+      InstInfo->AsmRewrites->emplace_back(AOK_Skip, NameEndLoc,
+                                          NextTok.size() + 1);
+    }
+  }
+
   // FIXME: Hack to recognize setneb as setne.
   if (PatchedName.startswith("set") && PatchedName.endswith("b") &&
       PatchedName != "setb" && PatchedName != "setnb")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24957.73762.patch
Type: text/x-patch
Size: 1037 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161006/444fe0ae/attachment.bin>


More information about the llvm-commits mailing list