[llvm-commits] [llvm] r117902 - in /llvm/trunk: lib/Target/X86/X86InstrInfo.td test/MC/X86/x86-64.s

Chris Lattner sabre at nondot.org
Sun Oct 31 22:41:10 PDT 2010


Author: lattner
Date: Mon Nov  1 00:41:10 2010
New Revision: 117902

URL: http://llvm.org/viewvc/llvm-project?rev=117902&view=rev
Log:
"mov[zs]x (mem), GR16" are not ambiguous: the mem
must be 8 bits.  Support this memory form.

Modified:
    llvm/trunk/lib/Target/X86/X86InstrInfo.td
    llvm/trunk/test/MC/X86/x86-64.s

Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=117902&r1=117901&r2=117902&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Mon Nov  1 00:41:10 2010
@@ -1262,6 +1262,9 @@
 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 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",

Modified: llvm/trunk/test/MC/X86/x86-64.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/x86-64.s?rev=117902&r1=117901&r2=117902&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/x86-64.s (original)
+++ llvm/trunk/test/MC/X86/x86-64.s Mon Nov  1 00:41:10 2010
@@ -692,7 +692,13 @@
 // 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





More information about the llvm-commits mailing list