Index: test/CodeGen/X86/avx-blend.ll =================================================================== --- test/CodeGen/X86/avx-blend.ll +++ test/CodeGen/X86/avx-blend.ll @@ -112,4 +112,35 @@ ret <2 x double> %min } +; CHECK-LABEL: @blend_shufflevector_4xfloat +define <4 x float> @blend_shufflevector_4xfloat(<4 x float> %a, <4 x float> %b) { +; CHECK: vblendps +; CHECK: ret + %1 = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> + ret <4 x float> %1 +} + +; CHECK-LABEL: @blend_shufflevector_8xfloat +define <8 x float> @blend_shufflevector_8xfloat(<8 x float> %a, <8 x float> %b) { +; CHECK: vblendps +; CHECK: ret + %1 = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> + ret <8 x float> %1 +} + +; CHECK-LABEL: @blend_shufflevector_4xdouble +define <4 x double> @blend_shufflevector_4xdouble(<4 x double> %a, <4 x double> %b) { +; CHECK: vblendpd +; CHECK: ret + %1 = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> + ret <4 x double> %1 +} + +; CHECK-LABEL: @blend_shufflevector_4xi64 +define <4 x i64> @blend_shufflevector_4xi64(<4 x i64> %a, <4 x i64> %b) { +; CHECK: vblendpd +; CHECK: ret + %1 = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> + ret <4 x i64> %1 +} Index: test/CodeGen/X86/avx2-shuffle.ll =================================================================== --- test/CodeGen/X86/avx2-shuffle.ll +++ test/CodeGen/X86/avx2-shuffle.ll @@ -60,6 +60,23 @@ ret <4 x i64> %t } +; CHECK-LABEL: @blend_test5 +; CHECK: vpblendd +; CHECK: ret +define <4 x i32> @blend_test5(<4 x i32> %a, <4 x i32> %b) { + %1 = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> + ret <4 x i32> %1 +} + +; CHECK-LABEL: @blend_test6 +; CHECK: vpblendw +; CHECK: ret +define <16 x i16> @blend_test6(<16 x i16> %a, <16 x i16> %b) { + %1 = shufflevector <16 x i16> %a, <16 x i16> %b, <16 x i32> + ret <16 x i16> %1 +} + ; CHECK: vpshufhw $27, %ymm define <16 x i16> @vpshufhw(<16 x i16> %src1) nounwind uwtable readnone ssp { entry: Index: test/CodeGen/X86/sse41-blend.ll =================================================================== --- test/CodeGen/X86/sse41-blend.ll +++ test/CodeGen/X86/sse41-blend.ll @@ -88,3 +88,19 @@ store double %extract214vector_func.i, double addrspace(1)* undef, align 8 ret void } + +; CHECK-LABEL: @blend_shufflevector_4xfloat +; CHECK: blendps +; CHECK: ret +define <4 x float> @blend_shufflevector_4xfloat(<4 x float> %a, <4 x float> %b) { + %1 = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> + ret <4 x float> %1 +} + +; CHECK-LABEL: @blend_shufflevector_8xi16 +; CHECK: pblendw +; CHECK: ret +define <8 x i16> @blend_shufflevector_8xi16(<8 x i16> %a, <8 x i16> %b) { + %1 = shufflevector <8 x i16> %a, <8 x i16> %b, <8 x i32> + ret <8 x i16> %1 +}