multiclass AVX512_masking<bits<8> O, Format F, dag Outs, dag Ins,
string OpcodeStr,
string AttSrcAsm, string IntelSrcAsm,
- dag RHS,
+ dag RHS, ValueType OpVT,
RegisterClass RC, RegisterClass KRC> {
def NAME: AVX512<O, F, Outs, Ins,
OpcodeStr#" \t{"#AttSrcAsm#", $dst|"#
[(set RC:$dst,
(vselect KRC:$mask, RHS, RC:$src0))]>,
EVEX_K;
+ let AddedComplexity = 30 in // Prefer over VMOV*rrkz Pat<>
+ def NAME#kz: AVX512<O, F, Outs,
+ !con((ins KRC:$mask), Ins),
+ OpcodeStr#" \t{"#AttSrcAsm#", $dst {${mask}} {z}|"#
+ "$dst {${mask}} {z}, "#IntelSrcAsm#"}",
+ [(set RC:$dst,
+ (vselect KRC:$mask, RHS,
+ (OpVT (bitconvert
+ (v16i32 immAllZerosV)))))]>,
+ EVEX_KZ;
}
// Bitcasts between 512-bit vector types. Return the original type since
"$src3, $src2, $src1", "$src1, $src2, $src3",
(IntVT (X86VAlign RC:$src2, RC:$src1,
(i8 imm:$src3))),
- RC, KRC>,
+ IntVT, RC, KRC>,
AVX512AIi8Base, EVEX_4V;
// Also match valign of packed floats.
ret <8 x i64> %res
}
+; CHECK-LABEL: test16kz
+; CHECK: valignq $2, %zmm0, %zmm1, %zmm0 {%k1} {z} ## encoding: [0x62,0xf3,0xf5,0xc9,0x03,0xc0,0x02]
+define <8 x i64> @test16kz(<8 x i64> %a, <8 x i64> %b, i8 %mask) nounwind {
+ %c = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9>
+ %m = bitcast i8 %mask to <8 x i1>
+ %res = select <8 x i1> %m, <8 x i64> %c, <8 x i64> zeroinitializer
+ ret <8 x i64> %res
+}
+
; CHECK-LABEL: test17
; CHECK: vshufpd $19, %zmm1, %zmm0
; CHECK: ret