summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-09-15 05:30:20 +0000
committerChris Lattner <sabre@nondot.org>2010-09-15 05:30:20 +0000
commitee7e6f42f8755e61ff72ea531e54e5b69ebb1039 (patch)
tree9507cdfb9b508b0c1a9ea8be16309e5dabd63b96 /llvm
parent09bfe645f666df86abb3e3f9b9ce7528ab91644e (diff)
downloadbcm5719-llvm-ee7e6f42f8755e61ff72ea531e54e5b69ebb1039.tar.gz
bcm5719-llvm-ee7e6f42f8755e61ff72ea531e54e5b69ebb1039.zip
lcall and ljmp always default to lcalll and ljmpl. This finally
wraps up r8418316 llvm-svn: 113949
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp18
-rw-r--r--llvm/test/MC/AsmParser/X86/x86_32-new-encoder.s10
2 files changed, 18 insertions, 10 deletions
diff --git a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
index acee68c54ef..303a0f282ad 100644
--- a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -979,16 +979,6 @@ 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);
- }
-
// jmp $42,$5 -> ljmp, similarly for call.
if ((Name.startswith("call") || Name.startswith("jmp")) &&
Operands.size() == 3 &&
@@ -1007,9 +997,17 @@ ParseInstruction(StringRef Name, SMLoc NameLoc,
if (NewOpName) {
delete Operands[0];
Operands[0] = X86Operand::CreateToken(NewOpName, NameLoc);
+ Name = NewOpName;
}
}
+ // lcall and ljmp -> lcalll and ljmpl
+ if ((Name == "lcall" || Name == "ljmp") && Operands.size() == 3) {
+ delete Operands[0];
+ Operands[0] = X86Operand::CreateToken(Name == "lcall" ? "lcalll" : "ljmpl",
+ NameLoc);
+ }
+
return false;
}
diff --git a/llvm/test/MC/AsmParser/X86/x86_32-new-encoder.s b/llvm/test/MC/AsmParser/X86/x86_32-new-encoder.s
index f5a53bf4eac..e24fce27236 100644
--- a/llvm/test/MC/AsmParser/X86/x86_32-new-encoder.s
+++ b/llvm/test/MC/AsmParser/X86/x86_32-new-encoder.s
@@ -551,4 +551,14 @@ lcalll $0x7ace,$0x7ace
jmpl $0x7ace,$0x7ace
ljmpl $0x7ace,$0x7ace
+// CHECK: lcalll $31438, $31438
+// CHECK: lcalll $31438, $31438
+// CHECK: ljmpl $31438, $31438
+// CHECK: ljmpl $31438, $31438
+
+call $0x7ace,$0x7ace
+lcall $0x7ace,$0x7ace
+jmp $0x7ace,$0x7ace
+ljmp $0x7ace,$0x7ace
+
OpenPOWER on IntegriCloud