From: Adam Nemet Date: Thu, 7 Aug 2014 23:18:18 +0000 (+0000) Subject: [AVX512] Add codegen test for the masking variant of valign X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=690499ed496c015bec6fa3fdadba3a785b443431 [AVX512] Add codegen test for the masking variant of valign The AddedComplexity is needed just like in avx512_perm_3src. There may be a bug in the complexity computation... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215168 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/X86InstrAVX512.td b/lib/Target/X86/X86InstrAVX512.td index 2dcf368add1..a62e926629e 100644 --- a/lib/Target/X86/X86InstrAVX512.td +++ b/lib/Target/X86/X86InstrAVX512.td @@ -8,8 +8,9 @@ multiclass AVX512_masking O, Format F, dag Outs, dag Ins, "$dst, "#IntelSrcAsm#"}", [(set RC:$dst, RHS)]>; - let Constraints = "$src0 = $dst" in - def NAME#k: AVX512 + let Constraints = "$src0 = $dst", AddedComplexity = 20 in + def NAME#k: AVX512 @test16(<8 x double> %a, <8 x double> %b) nounwind { ret <8 x double> %c } +; CHECK-LABEL: test16k +; CHECK: valignq $2, %zmm0, %zmm1, %zmm2 {%k1} # +define <8 x i64> @test16k(<8 x i64> %a, <8 x i64> %b, <8 x i64> %src, i8 %mask) nounwind { + %c = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> + %m = bitcast i8 %mask to <8 x i1> + %res = select <8 x i1> %m, <8 x i64> %c, <8 x i64> %src + ret <8 x i64> %res +} + ; CHECK-LABEL: test17 ; CHECK: vshufpd $19, %zmm1, %zmm0 ; CHECK: ret