Disambiguate lcall/ljmp to the 32-bit version. This happens
authorChris Lattner <sabre@nondot.org>
Wed, 15 Sep 2010 05:14:54 +0000 (05:14 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 15 Sep 2010 05:14:54 +0000 (05:14 +0000)
even in 64-bit mode apparently.

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

lib/Target/X86/AsmParser/X86AsmParser.cpp
test/MC/AsmParser/X86/x86_instructions.s

index 7afa7e66d5e1a4bf5bbfd6a94665e7920cd97fc3..37334ad4ceb06a2bc92a640c090b0cb7574e4a2c 100644 (file)
@@ -979,6 +979,16 @@ ParseInstruction(StringRef Name, SMLoc NameLoc,
                                                NameLoc, NameLoc));
   }
   
+  // lcall *x  and ljmp *x  -> lcalll and ljmpl
+  if ((Name == "lcall" || Name == "ljmp") &&
+      Operands.size() == 3 &&
+      static_cast<X86Operand*>(Operands[1])->isToken() &&
+      static_cast<X86Operand*>(Operands[1])->getToken() == "*") {
+    delete Operands[0];
+    Operands[0] = X86Operand::CreateToken(Name == "lcall" ? "lcalll" : "ljmpl",
+                                          NameLoc);
+  }
+  
   return false;
 }
 
index 16b1aac61932fc713020710533f9cce6328575e9..092aff3b48bc213296ec76daac95c5048a3ead10 100644 (file)
@@ -288,3 +288,9 @@ shrd        $1, %bx,%bx
 sldt   %ecx
 sldt   %cx
 
+// CHECK: lcalll       *3135175374 
+// CHECK: ljmpl        *3135175374
+lcall  *0xbadeface
+ljmp   *0xbadeface
+
+