Add v8i32 and v4i64 vpermil patterns
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Fri, 29 Jul 2011 01:31:07 +0000 (01:31 +0000)
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Fri, 29 Jul 2011 01:31:07 +0000 (01:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136451 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86InstrSSE.td
test/CodeGen/X86/avx-vpermil.ll

index 441c14639e052343d9e26b551965bc08f2cf05fa..066f7c01a53afa3b30675e1d34d53ce6e0f35852 100644 (file)
@@ -5581,6 +5581,10 @@ def : Pat<(v8f32 (X86VPermilpsy VR256:$src1, (i8 imm:$imm))),
           (VPERMILPSYri VR256:$src1, imm:$imm)>;
 def : Pat<(v4f64 (X86VPermilpdy VR256:$src1, (i8 imm:$imm))),
           (VPERMILPDYri VR256:$src1, imm:$imm)>;
+def : Pat<(v8i32 (X86VPermilpsy VR256:$src1, (i8 imm:$imm))),
+          (VPERMILPSYri VR256:$src1, imm:$imm)>;
+def : Pat<(v4i64 (X86VPermilpdy VR256:$src1, (i8 imm:$imm))),
+          (VPERMILPDYri VR256:$src1, imm:$imm)>;
 
 //===----------------------------------------------------------------------===//
 // VZERO - Zero YMM registers
index d57c1737c46058e7935b73b6f42993e844e61a20..f059948a799a9db323c3149029f12edb02de6a3e 100644 (file)
@@ -14,3 +14,16 @@ entry:
   ret <4 x double> %shuffle
 }
 
+; CHECK: vpermilps
+define <8 x i32> @funcC(<8 x i32> %a) nounwind uwtable readnone ssp {
+entry:
+  %shuffle = shufflevector <8 x i32> %a, <8 x i32> undef, <8 x i32> <i32 1, i32 2, i32 3, i32 1, i32 5, i32 6, i32 7, i32 5>
+  ret <8 x i32> %shuffle
+}
+
+; CHECK: vpermilpd
+define <4 x i64> @funcD(<4 x i64> %a) nounwind uwtable readnone ssp {
+entry:
+  %shuffle = shufflevector <4 x i64> %a, <4 x i64> undef, <4 x i32> <i32 1, i32 0, i32 3, i32 3>
+  ret <4 x i64> %shuffle
+}