diff --git a/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-fp-shuffles.ll b/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-fp-shuffles.ll --- a/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-fp-shuffles.ll +++ b/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-fp-shuffles.ll @@ -226,6 +226,54 @@ ret <4 x double> %s } +define <4 x half> @shuffle_v8f16_to_vslidedown_1(<8 x half> %x) { +; CHECK-LABEL: shuffle_v8f16_to_vslidedown_1: +; CHECK: # %bb.0: # %entry +; CHECK-NEXT: vsetivli zero, 3, e16, mf2, ta, ma +; CHECK-NEXT: vslidedown.vi v9, v8, 1 +; CHECK-NEXT: vsetivli zero, 4, e16, m1, ta, ma +; CHECK-NEXT: vslidedown.vi v8, v8, 4 +; CHECK-NEXT: vsetivli zero, 4, e16, mf2, tu, ma +; CHECK-NEXT: vslideup.vi v9, v8, 3 +; CHECK-NEXT: vmv1r.v v8, v9 +; CHECK-NEXT: ret +entry: + %s = shufflevector <8 x half> %x, <8 x half> poison, <4 x i32> + ret <4 x half> %s +} + +define <4 x half> @shuffle_v8f16_to_vslidedown_3(<8 x half> %x) { +; CHECK-LABEL: shuffle_v8f16_to_vslidedown_3: +; CHECK: # %bb.0: # %entry +; CHECK-NEXT: vsetivli zero, 1, e16, mf2, ta, ma +; CHECK-NEXT: vslidedown.vi v9, v8, 3 +; CHECK-NEXT: vsetivli zero, 4, e16, m1, ta, ma +; CHECK-NEXT: vslidedown.vi v8, v8, 4 +; CHECK-NEXT: vsetivli zero, 4, e16, mf2, tu, ma +; CHECK-NEXT: vslideup.vi v9, v8, 1 +; CHECK-NEXT: vmv1r.v v8, v9 +; CHECK-NEXT: ret +entry: + %s = shufflevector <8 x half> %x, <8 x half> poison, <4 x i32> + ret <4 x half> %s +} + +define <2 x float> @shuffle_v4f32_to_vslidedown(<4 x float> %x) { +; CHECK-LABEL: shuffle_v4f32_to_vslidedown: +; CHECK: # %bb.0: # %entry +; CHECK-NEXT: vsetivli zero, 1, e32, mf2, ta, ma +; CHECK-NEXT: vslidedown.vi v9, v8, 1 +; CHECK-NEXT: vsetivli zero, 2, e32, m1, ta, ma +; CHECK-NEXT: vslidedown.vi v8, v8, 2 +; CHECK-NEXT: vsetivli zero, 2, e32, mf2, tu, ma +; CHECK-NEXT: vslideup.vi v9, v8, 1 +; CHECK-NEXT: vmv1r.v v8, v9 +; CHECK-NEXT: ret +entry: + %s = shufflevector <4 x float> %x, <4 x float> poison, <2 x i32> + ret <2 x float> %s +} + define <4 x half> @slidedown_v4f16(<4 x half> %x) { ; CHECK-LABEL: slidedown_v4f16: ; CHECK: # %bb.0: diff --git a/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-int-shuffles.ll b/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-int-shuffles.ll --- a/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-int-shuffles.ll +++ b/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-int-shuffles.ll @@ -292,6 +292,54 @@ ret <8 x i64> %s } +define <4 x i16> @shuffle_v8i16_to_vslidedown_1(<8 x i16> %x) { +; CHECK-LABEL: shuffle_v8i16_to_vslidedown_1: +; CHECK: # %bb.0: # %entry +; CHECK-NEXT: vsetivli zero, 3, e16, mf2, ta, ma +; CHECK-NEXT: vslidedown.vi v9, v8, 1 +; CHECK-NEXT: vsetivli zero, 4, e16, m1, ta, ma +; CHECK-NEXT: vslidedown.vi v8, v8, 4 +; CHECK-NEXT: vsetivli zero, 4, e16, mf2, tu, ma +; CHECK-NEXT: vslideup.vi v9, v8, 3 +; CHECK-NEXT: vmv1r.v v8, v9 +; CHECK-NEXT: ret +entry: + %s = shufflevector <8 x i16> %x, <8 x i16> poison, <4 x i32> + ret <4 x i16> %s +} + +define <4 x i16> @shuffle_v8i16_to_vslidedown_3(<8 x i16> %x) { +; CHECK-LABEL: shuffle_v8i16_to_vslidedown_3: +; CHECK: # %bb.0: # %entry +; CHECK-NEXT: vsetivli zero, 1, e16, mf2, ta, ma +; CHECK-NEXT: vslidedown.vi v9, v8, 3 +; CHECK-NEXT: vsetivli zero, 4, e16, m1, ta, ma +; CHECK-NEXT: vslidedown.vi v8, v8, 4 +; CHECK-NEXT: vsetivli zero, 4, e16, mf2, tu, ma +; CHECK-NEXT: vslideup.vi v9, v8, 1 +; CHECK-NEXT: vmv1r.v v8, v9 +; CHECK-NEXT: ret +entry: + %s = shufflevector <8 x i16> %x, <8 x i16> poison, <4 x i32> + ret <4 x i16> %s +} + +define <2 x i32> @shuffle_v4i32_to_vslidedown(<4 x i32> %x) { +; CHECK-LABEL: shuffle_v4i32_to_vslidedown: +; CHECK: # %bb.0: # %entry +; CHECK-NEXT: vsetivli zero, 1, e32, mf2, ta, ma +; CHECK-NEXT: vslidedown.vi v9, v8, 1 +; CHECK-NEXT: vsetivli zero, 2, e32, m1, ta, ma +; CHECK-NEXT: vslidedown.vi v8, v8, 2 +; CHECK-NEXT: vsetivli zero, 2, e32, mf2, tu, ma +; CHECK-NEXT: vslideup.vi v9, v8, 1 +; CHECK-NEXT: vmv1r.v v8, v9 +; CHECK-NEXT: ret +entry: + %s = shufflevector <4 x i32> %x, <4 x i32> poison, <2 x i32> + ret <2 x i32> %s +} + define <4 x i8> @interleave_shuffles(<4 x i8> %x) { ; CHECK-LABEL: interleave_shuffles: ; CHECK: # %bb.0: