; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py ; RUN: llc -mtriple=riscv64 -mattr=+d,+experimental-zfh,+experimental-v -target-abi=lp64d \ ; RUN: -verify-machineinstrs < %s | FileCheck %s define @insertelt_nxv1i8_0( %v, i8 signext %elt) { ; CHECK-LABEL: insertelt_nxv1i8_0: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e8,mf8,ta,mu ; CHECK-NEXT: vmv.s.x v8, a0 ; CHECK-NEXT: ret %r = insertelement %v, i8 %elt, i32 0 ret %r } define @insertelt_nxv1i8_imm( %v, i8 signext %elt) { ; CHECK-LABEL: insertelt_nxv1i8_imm: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e8,mf8,ta,mu ; CHECK-NEXT: vslidedown.vi v25, v8, 3 ; CHECK-NEXT: vmv.s.x v25, a0 ; CHECK-NEXT: vsetvli a0, zero, e8,mf8,tu,mu ; CHECK-NEXT: vslideup.vi v8, v25, 3 ; CHECK-NEXT: ret %r = insertelement %v, i8 %elt, i32 3 ret %r } define @insertelt_nxv1i8_idx( %v, i8 signext %elt, i32 signext %idx) { ; CHECK-LABEL: insertelt_nxv1i8_idx: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a2, zero, e8,mf8,ta,mu ; CHECK-NEXT: vslidedown.vx v25, v8, a1 ; CHECK-NEXT: vmv.s.x v25, a0 ; CHECK-NEXT: vsetvli a0, zero, e8,mf8,tu,mu ; CHECK-NEXT: vslideup.vx v8, v25, a1 ; CHECK-NEXT: ret %r = insertelement %v, i8 %elt, i32 %idx ret %r } define @insertelt_nxv2i8_0( %v, i8 signext %elt) { ; CHECK-LABEL: insertelt_nxv2i8_0: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e8,mf4,ta,mu ; CHECK-NEXT: vmv.s.x v8, a0 ; CHECK-NEXT: ret %r = insertelement %v, i8 %elt, i32 0 ret %r } define @insertelt_nxv2i8_imm( %v, i8 signext %elt) { ; CHECK-LABEL: insertelt_nxv2i8_imm: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e8,mf4,ta,mu ; CHECK-NEXT: vslidedown.vi v25, v8, 3 ; CHECK-NEXT: vmv.s.x v25, a0 ; CHECK-NEXT: vsetvli a0, zero, e8,mf4,tu,mu ; CHECK-NEXT: vslideup.vi v8, v25, 3 ; CHECK-NEXT: ret %r = insertelement %v, i8 %elt, i32 3 ret %r } define @insertelt_nxv2i8_idx( %v, i8 signext %elt, i32 signext %idx) { ; CHECK-LABEL: insertelt_nxv2i8_idx: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a2, zero, e8,mf4,ta,mu ; CHECK-NEXT: vslidedown.vx v25, v8, a1 ; CHECK-NEXT: vmv.s.x v25, a0 ; CHECK-NEXT: vsetvli a0, zero, e8,mf4,tu,mu ; CHECK-NEXT: vslideup.vx v8, v25, a1 ; CHECK-NEXT: ret %r = insertelement %v, i8 %elt, i32 %idx ret %r } define @insertelt_nxv4i8_0( %v, i8 signext %elt) { ; CHECK-LABEL: insertelt_nxv4i8_0: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e8,mf2,ta,mu ; CHECK-NEXT: vmv.s.x v8, a0 ; CHECK-NEXT: ret %r = insertelement %v, i8 %elt, i32 0 ret %r } define @insertelt_nxv4i8_imm( %v, i8 signext %elt) { ; CHECK-LABEL: insertelt_nxv4i8_imm: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e8,mf2,ta,mu ; CHECK-NEXT: vslidedown.vi v25, v8, 3 ; CHECK-NEXT: vmv.s.x v25, a0 ; CHECK-NEXT: vsetvli a0, zero, e8,mf2,tu,mu ; CHECK-NEXT: vslideup.vi v8, v25, 3 ; CHECK-NEXT: ret %r = insertelement %v, i8 %elt, i32 3 ret %r } define @insertelt_nxv4i8_idx( %v, i8 signext %elt, i32 signext %idx) { ; CHECK-LABEL: insertelt_nxv4i8_idx: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a2, zero, e8,mf2,ta,mu ; CHECK-NEXT: vslidedown.vx v25, v8, a1 ; CHECK-NEXT: vmv.s.x v25, a0 ; CHECK-NEXT: vsetvli a0, zero, e8,mf2,tu,mu ; CHECK-NEXT: vslideup.vx v8, v25, a1 ; CHECK-NEXT: ret %r = insertelement %v, i8 %elt, i32 %idx ret %r } define @insertelt_nxv8i8_0( %v, i8 signext %elt) { ; CHECK-LABEL: insertelt_nxv8i8_0: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e8,m1,ta,mu ; CHECK-NEXT: vmv.s.x v8, a0 ; CHECK-NEXT: ret %r = insertelement %v, i8 %elt, i32 0 ret %r } define @insertelt_nxv8i8_imm( %v, i8 signext %elt) { ; CHECK-LABEL: insertelt_nxv8i8_imm: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e8,m1,ta,mu ; CHECK-NEXT: vslidedown.vi v25, v8, 3 ; CHECK-NEXT: vmv.s.x v25, a0 ; CHECK-NEXT: vsetvli a0, zero, e8,m1,tu,mu ; CHECK-NEXT: vslideup.vi v8, v25, 3 ; CHECK-NEXT: ret %r = insertelement %v, i8 %elt, i32 3 ret %r } define @insertelt_nxv8i8_idx( %v, i8 signext %elt, i32 signext %idx) { ; CHECK-LABEL: insertelt_nxv8i8_idx: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a2, zero, e8,m1,ta,mu ; CHECK-NEXT: vslidedown.vx v25, v8, a1 ; CHECK-NEXT: vmv.s.x v25, a0 ; CHECK-NEXT: vsetvli a0, zero, e8,m1,tu,mu ; CHECK-NEXT: vslideup.vx v8, v25, a1 ; CHECK-NEXT: ret %r = insertelement %v, i8 %elt, i32 %idx ret %r } define @insertelt_nxv16i8_0( %v, i8 signext %elt) { ; CHECK-LABEL: insertelt_nxv16i8_0: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e8,m2,ta,mu ; CHECK-NEXT: vmv.s.x v8, a0 ; CHECK-NEXT: ret %r = insertelement %v, i8 %elt, i32 0 ret %r } define @insertelt_nxv16i8_imm( %v, i8 signext %elt) { ; CHECK-LABEL: insertelt_nxv16i8_imm: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e8,m2,ta,mu ; CHECK-NEXT: vslidedown.vi v26, v8, 3 ; CHECK-NEXT: vmv.s.x v26, a0 ; CHECK-NEXT: vsetvli a0, zero, e8,m2,tu,mu ; CHECK-NEXT: vslideup.vi v8, v26, 3 ; CHECK-NEXT: ret %r = insertelement %v, i8 %elt, i32 3 ret %r } define @insertelt_nxv16i8_idx( %v, i8 signext %elt, i32 signext %idx) { ; CHECK-LABEL: insertelt_nxv16i8_idx: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a2, zero, e8,m2,ta,mu ; CHECK-NEXT: vslidedown.vx v26, v8, a1 ; CHECK-NEXT: vmv.s.x v26, a0 ; CHECK-NEXT: vsetvli a0, zero, e8,m2,tu,mu ; CHECK-NEXT: vslideup.vx v8, v26, a1 ; CHECK-NEXT: ret %r = insertelement %v, i8 %elt, i32 %idx ret %r } define @insertelt_nxv32i8_0( %v, i8 signext %elt) { ; CHECK-LABEL: insertelt_nxv32i8_0: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e8,m4,ta,mu ; CHECK-NEXT: vmv.s.x v8, a0 ; CHECK-NEXT: ret %r = insertelement %v, i8 %elt, i32 0 ret %r } define @insertelt_nxv32i8_imm( %v, i8 signext %elt) { ; CHECK-LABEL: insertelt_nxv32i8_imm: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e8,m4,ta,mu ; CHECK-NEXT: vslidedown.vi v28, v8, 3 ; CHECK-NEXT: vmv.s.x v28, a0 ; CHECK-NEXT: vsetvli a0, zero, e8,m4,tu,mu ; CHECK-NEXT: vslideup.vi v8, v28, 3 ; CHECK-NEXT: ret %r = insertelement %v, i8 %elt, i32 3 ret %r } define @insertelt_nxv32i8_idx( %v, i8 signext %elt, i32 signext %idx) { ; CHECK-LABEL: insertelt_nxv32i8_idx: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a2, zero, e8,m4,ta,mu ; CHECK-NEXT: vslidedown.vx v28, v8, a1 ; CHECK-NEXT: vmv.s.x v28, a0 ; CHECK-NEXT: vsetvli a0, zero, e8,m4,tu,mu ; CHECK-NEXT: vslideup.vx v8, v28, a1 ; CHECK-NEXT: ret %r = insertelement %v, i8 %elt, i32 %idx ret %r } define @insertelt_nxv64i8_0( %v, i8 signext %elt) { ; CHECK-LABEL: insertelt_nxv64i8_0: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e8,m8,ta,mu ; CHECK-NEXT: vmv.s.x v8, a0 ; CHECK-NEXT: ret %r = insertelement %v, i8 %elt, i32 0 ret %r } define @insertelt_nxv64i8_imm( %v, i8 signext %elt) { ; CHECK-LABEL: insertelt_nxv64i8_imm: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e8,m8,ta,mu ; CHECK-NEXT: vslidedown.vi v16, v8, 3 ; CHECK-NEXT: vmv.s.x v16, a0 ; CHECK-NEXT: vsetvli a0, zero, e8,m8,tu,mu ; CHECK-NEXT: vslideup.vi v8, v16, 3 ; CHECK-NEXT: ret %r = insertelement %v, i8 %elt, i32 3 ret %r } define @insertelt_nxv64i8_idx( %v, i8 signext %elt, i32 signext %idx) { ; CHECK-LABEL: insertelt_nxv64i8_idx: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a2, zero, e8,m8,ta,mu ; CHECK-NEXT: vslidedown.vx v16, v8, a1 ; CHECK-NEXT: vmv.s.x v16, a0 ; CHECK-NEXT: vsetvli a0, zero, e8,m8,tu,mu ; CHECK-NEXT: vslideup.vx v8, v16, a1 ; CHECK-NEXT: ret %r = insertelement %v, i8 %elt, i32 %idx ret %r } define @insertelt_nxv1i16_0( %v, i16 signext %elt) { ; CHECK-LABEL: insertelt_nxv1i16_0: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e16,mf4,ta,mu ; CHECK-NEXT: vmv.s.x v8, a0 ; CHECK-NEXT: ret %r = insertelement %v, i16 %elt, i32 0 ret %r } define @insertelt_nxv1i16_imm( %v, i16 signext %elt) { ; CHECK-LABEL: insertelt_nxv1i16_imm: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e16,mf4,ta,mu ; CHECK-NEXT: vslidedown.vi v25, v8, 3 ; CHECK-NEXT: vmv.s.x v25, a0 ; CHECK-NEXT: vsetvli a0, zero, e16,mf4,tu,mu ; CHECK-NEXT: vslideup.vi v8, v25, 3 ; CHECK-NEXT: ret %r = insertelement %v, i16 %elt, i32 3 ret %r } define @insertelt_nxv1i16_idx( %v, i16 signext %elt, i32 signext %idx) { ; CHECK-LABEL: insertelt_nxv1i16_idx: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a2, zero, e16,mf4,ta,mu ; CHECK-NEXT: vslidedown.vx v25, v8, a1 ; CHECK-NEXT: vmv.s.x v25, a0 ; CHECK-NEXT: vsetvli a0, zero, e16,mf4,tu,mu ; CHECK-NEXT: vslideup.vx v8, v25, a1 ; CHECK-NEXT: ret %r = insertelement %v, i16 %elt, i32 %idx ret %r } define @insertelt_nxv2i16_0( %v, i16 signext %elt) { ; CHECK-LABEL: insertelt_nxv2i16_0: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e16,mf2,ta,mu ; CHECK-NEXT: vmv.s.x v8, a0 ; CHECK-NEXT: ret %r = insertelement %v, i16 %elt, i32 0 ret %r } define @insertelt_nxv2i16_imm( %v, i16 signext %elt) { ; CHECK-LABEL: insertelt_nxv2i16_imm: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e16,mf2,ta,mu ; CHECK-NEXT: vslidedown.vi v25, v8, 3 ; CHECK-NEXT: vmv.s.x v25, a0 ; CHECK-NEXT: vsetvli a0, zero, e16,mf2,tu,mu ; CHECK-NEXT: vslideup.vi v8, v25, 3 ; CHECK-NEXT: ret %r = insertelement %v, i16 %elt, i32 3 ret %r } define @insertelt_nxv2i16_idx( %v, i16 signext %elt, i32 signext %idx) { ; CHECK-LABEL: insertelt_nxv2i16_idx: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a2, zero, e16,mf2,ta,mu ; CHECK-NEXT: vslidedown.vx v25, v8, a1 ; CHECK-NEXT: vmv.s.x v25, a0 ; CHECK-NEXT: vsetvli a0, zero, e16,mf2,tu,mu ; CHECK-NEXT: vslideup.vx v8, v25, a1 ; CHECK-NEXT: ret %r = insertelement %v, i16 %elt, i32 %idx ret %r } define @insertelt_nxv4i16_0( %v, i16 signext %elt) { ; CHECK-LABEL: insertelt_nxv4i16_0: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e16,m1,ta,mu ; CHECK-NEXT: vmv.s.x v8, a0 ; CHECK-NEXT: ret %r = insertelement %v, i16 %elt, i32 0 ret %r } define @insertelt_nxv4i16_imm( %v, i16 signext %elt) { ; CHECK-LABEL: insertelt_nxv4i16_imm: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e16,m1,ta,mu ; CHECK-NEXT: vslidedown.vi v25, v8, 3 ; CHECK-NEXT: vmv.s.x v25, a0 ; CHECK-NEXT: vsetvli a0, zero, e16,m1,tu,mu ; CHECK-NEXT: vslideup.vi v8, v25, 3 ; CHECK-NEXT: ret %r = insertelement %v, i16 %elt, i32 3 ret %r } define @insertelt_nxv4i16_idx( %v, i16 signext %elt, i32 signext %idx) { ; CHECK-LABEL: insertelt_nxv4i16_idx: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a2, zero, e16,m1,ta,mu ; CHECK-NEXT: vslidedown.vx v25, v8, a1 ; CHECK-NEXT: vmv.s.x v25, a0 ; CHECK-NEXT: vsetvli a0, zero, e16,m1,tu,mu ; CHECK-NEXT: vslideup.vx v8, v25, a1 ; CHECK-NEXT: ret %r = insertelement %v, i16 %elt, i32 %idx ret %r } define @insertelt_nxv8i16_0( %v, i16 signext %elt) { ; CHECK-LABEL: insertelt_nxv8i16_0: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e16,m2,ta,mu ; CHECK-NEXT: vmv.s.x v8, a0 ; CHECK-NEXT: ret %r = insertelement %v, i16 %elt, i32 0 ret %r } define @insertelt_nxv8i16_imm( %v, i16 signext %elt) { ; CHECK-LABEL: insertelt_nxv8i16_imm: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e16,m2,ta,mu ; CHECK-NEXT: vslidedown.vi v26, v8, 3 ; CHECK-NEXT: vmv.s.x v26, a0 ; CHECK-NEXT: vsetvli a0, zero, e16,m2,tu,mu ; CHECK-NEXT: vslideup.vi v8, v26, 3 ; CHECK-NEXT: ret %r = insertelement %v, i16 %elt, i32 3 ret %r } define @insertelt_nxv8i16_idx( %v, i16 signext %elt, i32 signext %idx) { ; CHECK-LABEL: insertelt_nxv8i16_idx: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a2, zero, e16,m2,ta,mu ; CHECK-NEXT: vslidedown.vx v26, v8, a1 ; CHECK-NEXT: vmv.s.x v26, a0 ; CHECK-NEXT: vsetvli a0, zero, e16,m2,tu,mu ; CHECK-NEXT: vslideup.vx v8, v26, a1 ; CHECK-NEXT: ret %r = insertelement %v, i16 %elt, i32 %idx ret %r } define @insertelt_nxv16i16_0( %v, i16 signext %elt) { ; CHECK-LABEL: insertelt_nxv16i16_0: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e16,m4,ta,mu ; CHECK-NEXT: vmv.s.x v8, a0 ; CHECK-NEXT: ret %r = insertelement %v, i16 %elt, i32 0 ret %r } define @insertelt_nxv16i16_imm( %v, i16 signext %elt) { ; CHECK-LABEL: insertelt_nxv16i16_imm: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e16,m4,ta,mu ; CHECK-NEXT: vslidedown.vi v28, v8, 3 ; CHECK-NEXT: vmv.s.x v28, a0 ; CHECK-NEXT: vsetvli a0, zero, e16,m4,tu,mu ; CHECK-NEXT: vslideup.vi v8, v28, 3 ; CHECK-NEXT: ret %r = insertelement %v, i16 %elt, i32 3 ret %r } define @insertelt_nxv16i16_idx( %v, i16 signext %elt, i32 signext %idx) { ; CHECK-LABEL: insertelt_nxv16i16_idx: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a2, zero, e16,m4,ta,mu ; CHECK-NEXT: vslidedown.vx v28, v8, a1 ; CHECK-NEXT: vmv.s.x v28, a0 ; CHECK-NEXT: vsetvli a0, zero, e16,m4,tu,mu ; CHECK-NEXT: vslideup.vx v8, v28, a1 ; CHECK-NEXT: ret %r = insertelement %v, i16 %elt, i32 %idx ret %r } define @insertelt_nxv32i16_0( %v, i16 signext %elt) { ; CHECK-LABEL: insertelt_nxv32i16_0: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e16,m8,ta,mu ; CHECK-NEXT: vmv.s.x v8, a0 ; CHECK-NEXT: ret %r = insertelement %v, i16 %elt, i32 0 ret %r } define @insertelt_nxv32i16_imm( %v, i16 signext %elt) { ; CHECK-LABEL: insertelt_nxv32i16_imm: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e16,m8,ta,mu ; CHECK-NEXT: vslidedown.vi v16, v8, 3 ; CHECK-NEXT: vmv.s.x v16, a0 ; CHECK-NEXT: vsetvli a0, zero, e16,m8,tu,mu ; CHECK-NEXT: vslideup.vi v8, v16, 3 ; CHECK-NEXT: ret %r = insertelement %v, i16 %elt, i32 3 ret %r } define @insertelt_nxv32i16_idx( %v, i16 signext %elt, i32 signext %idx) { ; CHECK-LABEL: insertelt_nxv32i16_idx: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a2, zero, e16,m8,ta,mu ; CHECK-NEXT: vslidedown.vx v16, v8, a1 ; CHECK-NEXT: vmv.s.x v16, a0 ; CHECK-NEXT: vsetvli a0, zero, e16,m8,tu,mu ; CHECK-NEXT: vslideup.vx v8, v16, a1 ; CHECK-NEXT: ret %r = insertelement %v, i16 %elt, i32 %idx ret %r } define @insertelt_nxv1i32_0( %v, i32 signext %elt) { ; CHECK-LABEL: insertelt_nxv1i32_0: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e32,mf2,ta,mu ; CHECK-NEXT: vmv.s.x v8, a0 ; CHECK-NEXT: ret %r = insertelement %v, i32 %elt, i32 0 ret %r } define @insertelt_nxv1i32_imm( %v, i32 signext %elt) { ; CHECK-LABEL: insertelt_nxv1i32_imm: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e32,mf2,ta,mu ; CHECK-NEXT: vslidedown.vi v25, v8, 3 ; CHECK-NEXT: vmv.s.x v25, a0 ; CHECK-NEXT: vsetvli a0, zero, e32,mf2,tu,mu ; CHECK-NEXT: vslideup.vi v8, v25, 3 ; CHECK-NEXT: ret %r = insertelement %v, i32 %elt, i32 3 ret %r } define @insertelt_nxv1i32_idx( %v, i32 signext %elt, i32 signext %idx) { ; CHECK-LABEL: insertelt_nxv1i32_idx: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a2, zero, e32,mf2,ta,mu ; CHECK-NEXT: vslidedown.vx v25, v8, a1 ; CHECK-NEXT: vmv.s.x v25, a0 ; CHECK-NEXT: vsetvli a0, zero, e32,mf2,tu,mu ; CHECK-NEXT: vslideup.vx v8, v25, a1 ; CHECK-NEXT: ret %r = insertelement %v, i32 %elt, i32 %idx ret %r } define @insertelt_nxv2i32_0( %v, i32 signext %elt) { ; CHECK-LABEL: insertelt_nxv2i32_0: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e32,m1,ta,mu ; CHECK-NEXT: vmv.s.x v8, a0 ; CHECK-NEXT: ret %r = insertelement %v, i32 %elt, i32 0 ret %r } define @insertelt_nxv2i32_imm( %v, i32 signext %elt) { ; CHECK-LABEL: insertelt_nxv2i32_imm: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e32,m1,ta,mu ; CHECK-NEXT: vslidedown.vi v25, v8, 3 ; CHECK-NEXT: vmv.s.x v25, a0 ; CHECK-NEXT: vsetvli a0, zero, e32,m1,tu,mu ; CHECK-NEXT: vslideup.vi v8, v25, 3 ; CHECK-NEXT: ret %r = insertelement %v, i32 %elt, i32 3 ret %r } define @insertelt_nxv2i32_idx( %v, i32 signext %elt, i32 signext %idx) { ; CHECK-LABEL: insertelt_nxv2i32_idx: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a2, zero, e32,m1,ta,mu ; CHECK-NEXT: vslidedown.vx v25, v8, a1 ; CHECK-NEXT: vmv.s.x v25, a0 ; CHECK-NEXT: vsetvli a0, zero, e32,m1,tu,mu ; CHECK-NEXT: vslideup.vx v8, v25, a1 ; CHECK-NEXT: ret %r = insertelement %v, i32 %elt, i32 %idx ret %r } define @insertelt_nxv4i32_0( %v, i32 signext %elt) { ; CHECK-LABEL: insertelt_nxv4i32_0: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e32,m2,ta,mu ; CHECK-NEXT: vmv.s.x v8, a0 ; CHECK-NEXT: ret %r = insertelement %v, i32 %elt, i32 0 ret %r } define @insertelt_nxv4i32_imm( %v, i32 signext %elt) { ; CHECK-LABEL: insertelt_nxv4i32_imm: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e32,m2,ta,mu ; CHECK-NEXT: vslidedown.vi v26, v8, 3 ; CHECK-NEXT: vmv.s.x v26, a0 ; CHECK-NEXT: vsetvli a0, zero, e32,m2,tu,mu ; CHECK-NEXT: vslideup.vi v8, v26, 3 ; CHECK-NEXT: ret %r = insertelement %v, i32 %elt, i32 3 ret %r } define @insertelt_nxv4i32_idx( %v, i32 signext %elt, i32 signext %idx) { ; CHECK-LABEL: insertelt_nxv4i32_idx: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a2, zero, e32,m2,ta,mu ; CHECK-NEXT: vslidedown.vx v26, v8, a1 ; CHECK-NEXT: vmv.s.x v26, a0 ; CHECK-NEXT: vsetvli a0, zero, e32,m2,tu,mu ; CHECK-NEXT: vslideup.vx v8, v26, a1 ; CHECK-NEXT: ret %r = insertelement %v, i32 %elt, i32 %idx ret %r } define @insertelt_nxv8i32_0( %v, i32 signext %elt) { ; CHECK-LABEL: insertelt_nxv8i32_0: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e32,m4,ta,mu ; CHECK-NEXT: vmv.s.x v8, a0 ; CHECK-NEXT: ret %r = insertelement %v, i32 %elt, i32 0 ret %r } define @insertelt_nxv8i32_imm( %v, i32 signext %elt) { ; CHECK-LABEL: insertelt_nxv8i32_imm: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e32,m4,ta,mu ; CHECK-NEXT: vslidedown.vi v28, v8, 3 ; CHECK-NEXT: vmv.s.x v28, a0 ; CHECK-NEXT: vsetvli a0, zero, e32,m4,tu,mu ; CHECK-NEXT: vslideup.vi v8, v28, 3 ; CHECK-NEXT: ret %r = insertelement %v, i32 %elt, i32 3 ret %r } define @insertelt_nxv8i32_idx( %v, i32 signext %elt, i32 signext %idx) { ; CHECK-LABEL: insertelt_nxv8i32_idx: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a2, zero, e32,m4,ta,mu ; CHECK-NEXT: vslidedown.vx v28, v8, a1 ; CHECK-NEXT: vmv.s.x v28, a0 ; CHECK-NEXT: vsetvli a0, zero, e32,m4,tu,mu ; CHECK-NEXT: vslideup.vx v8, v28, a1 ; CHECK-NEXT: ret %r = insertelement %v, i32 %elt, i32 %idx ret %r } define @insertelt_nxv16i32_0( %v, i32 signext %elt) { ; CHECK-LABEL: insertelt_nxv16i32_0: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e32,m8,ta,mu ; CHECK-NEXT: vmv.s.x v8, a0 ; CHECK-NEXT: ret %r = insertelement %v, i32 %elt, i32 0 ret %r } define @insertelt_nxv16i32_imm( %v, i32 signext %elt) { ; CHECK-LABEL: insertelt_nxv16i32_imm: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e32,m8,ta,mu ; CHECK-NEXT: vslidedown.vi v16, v8, 3 ; CHECK-NEXT: vmv.s.x v16, a0 ; CHECK-NEXT: vsetvli a0, zero, e32,m8,tu,mu ; CHECK-NEXT: vslideup.vi v8, v16, 3 ; CHECK-NEXT: ret %r = insertelement %v, i32 %elt, i32 3 ret %r } define @insertelt_nxv16i32_idx( %v, i32 signext %elt, i32 signext %idx) { ; CHECK-LABEL: insertelt_nxv16i32_idx: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a2, zero, e32,m8,ta,mu ; CHECK-NEXT: vslidedown.vx v16, v8, a1 ; CHECK-NEXT: vmv.s.x v16, a0 ; CHECK-NEXT: vsetvli a0, zero, e32,m8,tu,mu ; CHECK-NEXT: vslideup.vx v8, v16, a1 ; CHECK-NEXT: ret %r = insertelement %v, i32 %elt, i32 %idx ret %r } define @insertelt_nxv1i64_0( %v, i64 %elt) { ; CHECK-LABEL: insertelt_nxv1i64_0: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e64,m1,ta,mu ; CHECK-NEXT: vmv.s.x v8, a0 ; CHECK-NEXT: ret %r = insertelement %v, i64 %elt, i32 0 ret %r } define @insertelt_nxv1i64_imm( %v, i64 %elt) { ; CHECK-LABEL: insertelt_nxv1i64_imm: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e64,m1,ta,mu ; CHECK-NEXT: vslidedown.vi v25, v8, 3 ; CHECK-NEXT: vmv.s.x v25, a0 ; CHECK-NEXT: vsetvli a0, zero, e64,m1,tu,mu ; CHECK-NEXT: vslideup.vi v8, v25, 3 ; CHECK-NEXT: ret %r = insertelement %v, i64 %elt, i32 3 ret %r } define @insertelt_nxv1i64_idx( %v, i64 %elt, i32 %idx) { ; CHECK-LABEL: insertelt_nxv1i64_idx: ; CHECK: # %bb.0: ; CHECK-NEXT: sext.w a1, a1 ; CHECK-NEXT: vsetvli a2, zero, e64,m1,ta,mu ; CHECK-NEXT: vslidedown.vx v25, v8, a1 ; CHECK-NEXT: vmv.s.x v25, a0 ; CHECK-NEXT: vsetvli a0, zero, e64,m1,tu,mu ; CHECK-NEXT: vslideup.vx v8, v25, a1 ; CHECK-NEXT: ret %r = insertelement %v, i64 %elt, i32 %idx ret %r } define @insertelt_nxv2i64_0( %v, i64 %elt) { ; CHECK-LABEL: insertelt_nxv2i64_0: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e64,m2,ta,mu ; CHECK-NEXT: vmv.s.x v8, a0 ; CHECK-NEXT: ret %r = insertelement %v, i64 %elt, i32 0 ret %r } define @insertelt_nxv2i64_imm( %v, i64 %elt) { ; CHECK-LABEL: insertelt_nxv2i64_imm: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e64,m2,ta,mu ; CHECK-NEXT: vslidedown.vi v26, v8, 3 ; CHECK-NEXT: vmv.s.x v26, a0 ; CHECK-NEXT: vsetvli a0, zero, e64,m2,tu,mu ; CHECK-NEXT: vslideup.vi v8, v26, 3 ; CHECK-NEXT: ret %r = insertelement %v, i64 %elt, i32 3 ret %r } define @insertelt_nxv2i64_idx( %v, i64 %elt, i32 %idx) { ; CHECK-LABEL: insertelt_nxv2i64_idx: ; CHECK: # %bb.0: ; CHECK-NEXT: sext.w a1, a1 ; CHECK-NEXT: vsetvli a2, zero, e64,m2,ta,mu ; CHECK-NEXT: vslidedown.vx v26, v8, a1 ; CHECK-NEXT: vmv.s.x v26, a0 ; CHECK-NEXT: vsetvli a0, zero, e64,m2,tu,mu ; CHECK-NEXT: vslideup.vx v8, v26, a1 ; CHECK-NEXT: ret %r = insertelement %v, i64 %elt, i32 %idx ret %r } define @insertelt_nxv4i64_0( %v, i64 %elt) { ; CHECK-LABEL: insertelt_nxv4i64_0: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e64,m4,ta,mu ; CHECK-NEXT: vmv.s.x v8, a0 ; CHECK-NEXT: ret %r = insertelement %v, i64 %elt, i32 0 ret %r } define @insertelt_nxv4i64_imm( %v, i64 %elt) { ; CHECK-LABEL: insertelt_nxv4i64_imm: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e64,m4,ta,mu ; CHECK-NEXT: vslidedown.vi v28, v8, 3 ; CHECK-NEXT: vmv.s.x v28, a0 ; CHECK-NEXT: vsetvli a0, zero, e64,m4,tu,mu ; CHECK-NEXT: vslideup.vi v8, v28, 3 ; CHECK-NEXT: ret %r = insertelement %v, i64 %elt, i32 3 ret %r } define @insertelt_nxv4i64_idx( %v, i64 %elt, i32 %idx) { ; CHECK-LABEL: insertelt_nxv4i64_idx: ; CHECK: # %bb.0: ; CHECK-NEXT: sext.w a1, a1 ; CHECK-NEXT: vsetvli a2, zero, e64,m4,ta,mu ; CHECK-NEXT: vslidedown.vx v28, v8, a1 ; CHECK-NEXT: vmv.s.x v28, a0 ; CHECK-NEXT: vsetvli a0, zero, e64,m4,tu,mu ; CHECK-NEXT: vslideup.vx v8, v28, a1 ; CHECK-NEXT: ret %r = insertelement %v, i64 %elt, i32 %idx ret %r } define @insertelt_nxv8i64_0( %v, i64 %elt) { ; CHECK-LABEL: insertelt_nxv8i64_0: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e64,m8,ta,mu ; CHECK-NEXT: vmv.s.x v8, a0 ; CHECK-NEXT: ret %r = insertelement %v, i64 %elt, i32 0 ret %r } define @insertelt_nxv8i64_imm( %v, i64 %elt) { ; CHECK-LABEL: insertelt_nxv8i64_imm: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e64,m8,ta,mu ; CHECK-NEXT: vslidedown.vi v16, v8, 3 ; CHECK-NEXT: vmv.s.x v16, a0 ; CHECK-NEXT: vsetvli a0, zero, e64,m8,tu,mu ; CHECK-NEXT: vslideup.vi v8, v16, 3 ; CHECK-NEXT: ret %r = insertelement %v, i64 %elt, i32 3 ret %r } define @insertelt_nxv8i64_idx( %v, i64 %elt, i32 %idx) { ; CHECK-LABEL: insertelt_nxv8i64_idx: ; CHECK: # %bb.0: ; CHECK-NEXT: sext.w a1, a1 ; CHECK-NEXT: vsetvli a2, zero, e64,m8,ta,mu ; CHECK-NEXT: vslidedown.vx v16, v8, a1 ; CHECK-NEXT: vmv.s.x v16, a0 ; CHECK-NEXT: vsetvli a0, zero, e64,m8,tu,mu ; CHECK-NEXT: vslideup.vx v8, v16, a1 ; CHECK-NEXT: ret %r = insertelement %v, i64 %elt, i32 %idx ret %r }