summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-09-06 23:40:56 +0000
committerChris Lattner <sabre@nondot.org>2010-09-06 23:40:56 +0000
commitd68c474ec55a3dd43f9fa8ea4c89e5fae62909ab (patch)
tree85e4cc0c287cf0237465590b0deae5330a520899
parent9bb9fa19a5e121b83866867ad1d8f7bf2618c1a0 (diff)
downloadllvm-d68c474ec55a3dd43f9fa8ea4c89e5fae62909ab.tar.gz
llvm-d68c474ec55a3dd43f9fa8ea4c89e5fae62909ab.tar.bz2
llvm-d68c474ec55a3dd43f9fa8ea4c89e5fae62909ab.tar.xz
fix rdar://8017621 - llvm-mc can't guess encoding for "push $(1000)"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113184 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/X86/AsmParser/X86AsmParser.cpp1
-rw-r--r--test/MC/AsmParser/X86/x86_instructions.s5
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/Target/X86/AsmParser/X86AsmParser.cpp b/lib/Target/X86/AsmParser/X86AsmParser.cpp
index 2aa632d429..19d9470639 100644
--- a/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ b/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -636,6 +636,7 @@ ParseInstruction(StringRef Name, SMLoc NameLoc,
.Case("repe", "rep")
.Case("repz", "rep")
.Case("repnz", "repne")
+ .Case("push", Is64Bit ? "pushq" : "pushl")
.Case("pushf", Is64Bit ? "pushfq" : "pushfl")
.Case("popf", Is64Bit ? "popfq" : "popfl")
.Case("retl", Is64Bit ? "retl" : "ret")
diff --git a/test/MC/AsmParser/X86/x86_instructions.s b/test/MC/AsmParser/X86/x86_instructions.s
index 43702a1617..308dc09586 100644
--- a/test/MC/AsmParser/X86/x86_instructions.s
+++ b/test/MC/AsmParser/X86/x86_instructions.s
@@ -173,3 +173,8 @@ outb %al, $161
outw %ax, $128
// CHECK: inb $161, %al
inb $161, %al
+
+// rdar://8017621
+// CHECK: pushq $1
+push $1
+