[llvm-commits] [llvm] r152136 - in /llvm/trunk: lib/Target/X86/X86InstrInfo.td test/MC/X86/x86-64.s
Eli Friedman
eli.friedman at gmail.com
Tue Mar 6 11:58:47 PST 2012
Author: efriedma
Date: Tue Mar 6 13:58:46 2012
New Revision: 152136
URL: http://llvm.org/viewvc/llvm-project?rev=152136&view=rev
Log:
Fix the operand ordering on aliases for shld and shrd. PR12173, part 2.
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=152136&r1=152135&r2=152136&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Tue Mar 6 13:58:46 2012
@@ -1856,19 +1856,19 @@
def : InstAlias<"sldt $mem", (SLDT16m i16mem:$mem)>;
// shld/shrd op,op -> shld op, op, CL
-def : InstAlias<"shldw $r1, $r2", (SHLD16rrCL GR16:$r1, GR16:$r2)>;
-def : InstAlias<"shldl $r1, $r2", (SHLD32rrCL GR32:$r1, GR32:$r2)>;
-def : InstAlias<"shldq $r1, $r2", (SHLD64rrCL GR64:$r1, GR64:$r2)>;
-def : InstAlias<"shrdw $r1, $r2", (SHRD16rrCL GR16:$r1, GR16:$r2)>;
-def : InstAlias<"shrdl $r1, $r2", (SHRD32rrCL GR32:$r1, GR32:$r2)>;
-def : InstAlias<"shrdq $r1, $r2", (SHRD64rrCL GR64:$r1, GR64:$r2)>;
-
-def : InstAlias<"shldw $mem, $reg", (SHLD16mrCL i16mem:$mem, GR16:$reg)>;
-def : InstAlias<"shldl $mem, $reg", (SHLD32mrCL i32mem:$mem, GR32:$reg)>;
-def : InstAlias<"shldq $mem, $reg", (SHLD64mrCL i64mem:$mem, GR64:$reg)>;
-def : InstAlias<"shrdw $mem, $reg", (SHRD16mrCL i16mem:$mem, GR16:$reg)>;
-def : InstAlias<"shrdl $mem, $reg", (SHRD32mrCL i32mem:$mem, GR32:$reg)>;
-def : InstAlias<"shrdq $mem, $reg", (SHRD64mrCL i64mem:$mem, GR64:$reg)>;
+def : InstAlias<"shldw $r2, $r1", (SHLD16rrCL GR16:$r1, GR16:$r2)>;
+def : InstAlias<"shldl $r2, $r1", (SHLD32rrCL GR32:$r1, GR32:$r2)>;
+def : InstAlias<"shldq $r2, $r1", (SHLD64rrCL GR64:$r1, GR64:$r2)>;
+def : InstAlias<"shrdw $r2, $r1", (SHRD16rrCL GR16:$r1, GR16:$r2)>;
+def : InstAlias<"shrdl $r2, $r1", (SHRD32rrCL GR32:$r1, GR32:$r2)>;
+def : InstAlias<"shrdq $r2, $r1", (SHRD64rrCL GR64:$r1, GR64:$r2)>;
+
+def : InstAlias<"shldw $reg, $mem", (SHLD16mrCL i16mem:$mem, GR16:$reg)>;
+def : InstAlias<"shldl $reg, $mem", (SHLD32mrCL i32mem:$mem, GR32:$reg)>;
+def : InstAlias<"shldq $reg, $mem", (SHLD64mrCL i64mem:$mem, GR64:$reg)>;
+def : InstAlias<"shrdw $reg, $mem", (SHRD16mrCL i16mem:$mem, GR16:$reg)>;
+def : InstAlias<"shrdl $reg, $mem", (SHRD32mrCL i32mem:$mem, GR32:$reg)>;
+def : InstAlias<"shrdq $reg, $mem", (SHRD64mrCL i64mem:$mem, GR64:$reg)>;
/* FIXME: This is disabled because the asm matcher is currently incapable of
* matching a fixed immediate like $1.
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=152136&r1=152135&r2=152136&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/x86-64.s (original)
+++ llvm/trunk/test/MC/X86/x86-64.s Tue Mar 6 13:58:46 2012
@@ -340,19 +340,27 @@
// rdar://8418316
// PR12173
-// CHECK: shldw %cl, %bx, %bx
-// CHECK: shldw %cl, %bx, %bx
-// CHECK: shldw $1, %bx, %bx
-// CHECK: shrdw %cl, %bx, %bx
-// CHECK: shrdw %cl, %bx, %bx
-// CHECK: shrdw $1, %bx, %bx
-
-shld %bx, %bx
-shld %cl, %bx, %bx
-shld $1, %bx, %bx
-shrd %bx, %bx
-shrd %cl, %bx, %bx
-shrd $1, %bx, %bx
+// CHECK: shldw %cl, %bx, %dx
+// CHECK: shldw %cl, %bx, %dx
+// CHECK: shldw $1, %bx, %dx
+// CHECK: shldw %cl, %bx, (%rax)
+// CHECK: shldw %cl, %bx, (%rax)
+// CHECK: shrdw %cl, %bx, %dx
+// CHECK: shrdw %cl, %bx, %dx
+// CHECK: shrdw $1, %bx, %dx
+// CHECK: shrdw %cl, %bx, (%rax)
+// CHECK: shrdw %cl, %bx, (%rax)
+
+shld %bx, %dx
+shld %cl, %bx, %dx
+shld $1, %bx, %dx
+shld %bx, (%rax)
+shld %cl, %bx, (%rax)
+shrd %bx, %dx
+shrd %cl, %bx, %dx
+shrd $1, %bx, %dx
+shrd %bx, (%rax)
+shrd %cl, %bx, (%rax)
// CHECK: sldtl %ecx
// CHECK: encoding: [0x0f,0x00,0xc1]
More information about the llvm-commits
mailing list