aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-11-01 05:41:10 +0000
committerChris Lattner <sabre@nondot.org>2010-11-01 05:41:10 +0000
commitacc473fcf9860567d4da60625944d48b075d28f8 (patch)
treefd853ce941718a7cfc045a819239abc3fa49284e
parentb501d4f673c0db267a76800339f9943f2ce6fe33 (diff)
"mov[zs]x (mem), GR16" are not ambiguous: the mem
must be 8 bits. Support this memory form. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117902 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/X86/X86InstrInfo.td6
-rw-r--r--test/MC/X86/x86-64.s6
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/Target/X86/X86InstrInfo.td b/lib/Target/X86/X86InstrInfo.td
index f5463c0d6a..114f3d380c 100644
--- a/lib/Target/X86/X86InstrInfo.td
+++ b/lib/Target/X86/X86InstrInfo.td
@@ -1262,6 +1262,9 @@ include "X86InstrCompiler.td"
def : InstAlias<(outs GR16:$dst), (ins GR8 :$src),
"movsx $src, $dst",
(MOVSX16rr8W GR16:$dst, GR8:$src)>;
+def : InstAlias<(outs GR16:$dst), (ins i8mem:$src),
+ "movsx $src, $dst",
+ (MOVSX16rm8W GR16:$dst, i8mem:$src)>;
def : InstAlias<(outs GR32:$dst), (ins GR8 :$src),
"movsx $src, $dst",
@@ -1284,6 +1287,9 @@ def : InstAlias<(outs GR64:$dst), (ins GR32:$src),
def : InstAlias<(outs GR16:$dst), (ins GR8 :$src),
"movzx $src, $dst",
(MOVZX16rr8W GR16:$dst, GR8:$src)>;
+def : InstAlias<(outs GR16:$dst), (ins i8mem:$src),
+ "movzx $src, $dst",
+ (MOVZX16rm8W GR16:$dst, i8mem:$src)>;
def : InstAlias<(outs GR32:$dst), (ins GR8 :$src),
"movzx $src, $dst",
diff --git a/test/MC/X86/x86-64.s b/test/MC/X86/x86-64.s
index 5cc08441a6..d386facfa1 100644
--- a/test/MC/X86/x86-64.s
+++ b/test/MC/X86/x86-64.s
@@ -692,7 +692,13 @@ movzx %bl, %rax
// CHECK: encoding: [0x48,0x0f,0xb7,0xc1]
movzx %cx, %rax
+// CHECK: movsbw (%rax), %ax
+// CHECK: encoding: [0x66,0x0f,0xbe,0x00]
+movsx (%rax), %ax
+// CHECK: movzbw (%rax), %ax
+// CHECK: encoding: [0x66,0x0f,0xb6,0x00]
+movzx (%rax), %ax
// rdar://7873482