; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve < %s 2>%t | FileCheck %s --check-prefixes=CHECK ; RUN: FileCheck --check-prefix=WARN --allow-empty %s < %t ; If this check fails please read test/CodeGen/AArch64/README for instructions on how to resolve it. ; WARN-NOT: warning define @insert_v2i64_nxv2i64( %vec, <2 x i64> %subvec) nounwind { ; CHECK-LABEL: insert_v2i64_nxv2i64: ; CHECK: // %bb.0: ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill ; CHECK-NEXT: addvl sp, sp, #-1 ; CHECK-NEXT: cntd x8 ; CHECK-NEXT: sub x8, x8, #1 // =1 ; CHECK-NEXT: cmp x8, #0 // =0 ; CHECK-NEXT: csel x8, x8, xzr, lo ; CHECK-NEXT: ptrue p0.d ; CHECK-NEXT: lsl x8, x8, #3 ; CHECK-NEXT: mov x9, sp ; CHECK-NEXT: st1d { z0.d }, p0, [sp] ; CHECK-NEXT: str q1, [x9, x8] ; CHECK-NEXT: ld1d { z0.d }, p0/z, [sp] ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret %retval = call @llvm.experimental.vector.insert.nxv2i64.v2i64( %vec, <2 x i64> %subvec, i64 0) ret %retval } define @insert_v2i64_nxv2i64_idx1( %vec, <2 x i64> %subvec) nounwind { ; CHECK-LABEL: insert_v2i64_nxv2i64_idx1: ; CHECK: // %bb.0: ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill ; CHECK-NEXT: addvl sp, sp, #-1 ; CHECK-NEXT: cntd x8 ; CHECK-NEXT: sub x8, x8, #1 // =1 ; CHECK-NEXT: cmp x8, #1 // =1 ; CHECK-NEXT: csinc x8, x8, xzr, lo ; CHECK-NEXT: ptrue p0.d ; CHECK-NEXT: lsl x8, x8, #3 ; CHECK-NEXT: mov x9, sp ; CHECK-NEXT: st1d { z0.d }, p0, [sp] ; CHECK-NEXT: str q1, [x9, x8] ; CHECK-NEXT: ld1d { z0.d }, p0/z, [sp] ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret %retval = call @llvm.experimental.vector.insert.nxv2i64.v2i64( %vec, <2 x i64> %subvec, i64 1) ret %retval } define @insert_v4i32_nxv4i32( %vec, <4 x i32> %subvec) nounwind { ; CHECK-LABEL: insert_v4i32_nxv4i32: ; CHECK: // %bb.0: ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill ; CHECK-NEXT: addvl sp, sp, #-1 ; CHECK-NEXT: cntw x8 ; CHECK-NEXT: sub x8, x8, #1 // =1 ; CHECK-NEXT: cmp x8, #0 // =0 ; CHECK-NEXT: csel x8, x8, xzr, lo ; CHECK-NEXT: ptrue p0.s ; CHECK-NEXT: lsl x8, x8, #2 ; CHECK-NEXT: mov x9, sp ; CHECK-NEXT: st1w { z0.s }, p0, [sp] ; CHECK-NEXT: str q1, [x9, x8] ; CHECK-NEXT: ld1w { z0.s }, p0/z, [sp] ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret %retval = call @llvm.experimental.vector.insert.nxv4i32.v4i32( %vec, <4 x i32> %subvec, i64 0) ret %retval } define @insert_v4i32_nxv4i32_idx1( %vec, <4 x i32> %subvec) nounwind { ; CHECK-LABEL: insert_v4i32_nxv4i32_idx1: ; CHECK: // %bb.0: ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill ; CHECK-NEXT: addvl sp, sp, #-1 ; CHECK-NEXT: cntw x8 ; CHECK-NEXT: sub x8, x8, #1 // =1 ; CHECK-NEXT: cmp x8, #1 // =1 ; CHECK-NEXT: csinc x8, x8, xzr, lo ; CHECK-NEXT: ptrue p0.s ; CHECK-NEXT: lsl x8, x8, #2 ; CHECK-NEXT: mov x9, sp ; CHECK-NEXT: st1w { z0.s }, p0, [sp] ; CHECK-NEXT: str q1, [x9, x8] ; CHECK-NEXT: ld1w { z0.s }, p0/z, [sp] ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret %retval = call @llvm.experimental.vector.insert.nxv4i32.v4i32( %vec, <4 x i32> %subvec, i64 1) ret %retval } define @insert_v8i16_nxv8i16( %vec, <8 x i16> %subvec) nounwind { ; CHECK-LABEL: insert_v8i16_nxv8i16: ; CHECK: // %bb.0: ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill ; CHECK-NEXT: addvl sp, sp, #-1 ; CHECK-NEXT: cnth x8 ; CHECK-NEXT: sub x8, x8, #1 // =1 ; CHECK-NEXT: cmp x8, #0 // =0 ; CHECK-NEXT: csel x8, x8, xzr, lo ; CHECK-NEXT: ptrue p0.h ; CHECK-NEXT: lsl x8, x8, #1 ; CHECK-NEXT: mov x9, sp ; CHECK-NEXT: st1h { z0.h }, p0, [sp] ; CHECK-NEXT: str q1, [x9, x8] ; CHECK-NEXT: ld1h { z0.h }, p0/z, [sp] ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret %retval = call @llvm.experimental.vector.insert.nxv8i16.v8i16( %vec, <8 x i16> %subvec, i64 0) ret %retval } define @insert_v8i16_nxv8i16_idx1( %vec, <8 x i16> %subvec) nounwind { ; CHECK-LABEL: insert_v8i16_nxv8i16_idx1: ; CHECK: // %bb.0: ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill ; CHECK-NEXT: addvl sp, sp, #-1 ; CHECK-NEXT: cnth x8 ; CHECK-NEXT: sub x8, x8, #1 // =1 ; CHECK-NEXT: cmp x8, #1 // =1 ; CHECK-NEXT: csinc x8, x8, xzr, lo ; CHECK-NEXT: ptrue p0.h ; CHECK-NEXT: lsl x8, x8, #1 ; CHECK-NEXT: mov x9, sp ; CHECK-NEXT: st1h { z0.h }, p0, [sp] ; CHECK-NEXT: str q1, [x9, x8] ; CHECK-NEXT: ld1h { z0.h }, p0/z, [sp] ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret %retval = call @llvm.experimental.vector.insert.nxv8i16.v8i16( %vec, <8 x i16> %subvec, i64 1) ret %retval } define @insert_v16i8_nxv16i8( %vec, <16 x i8> %subvec) nounwind { ; CHECK-LABEL: insert_v16i8_nxv16i8: ; CHECK: // %bb.0: ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill ; CHECK-NEXT: addvl sp, sp, #-1 ; CHECK-NEXT: rdvl x8, #1 ; CHECK-NEXT: sub x8, x8, #1 // =1 ; CHECK-NEXT: cmp x8, #0 // =0 ; CHECK-NEXT: ptrue p0.b ; CHECK-NEXT: csel x8, x8, xzr, lo ; CHECK-NEXT: mov x9, sp ; CHECK-NEXT: st1b { z0.b }, p0, [sp] ; CHECK-NEXT: str q1, [x9, x8] ; CHECK-NEXT: ld1b { z0.b }, p0/z, [sp] ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret %retval = call @llvm.experimental.vector.insert.nxv16i8.v16i8( %vec, <16 x i8> %subvec, i64 0) ret %retval } define @insert_v16i8_nxv16i8_idx1( %vec, <16 x i8> %subvec) nounwind { ; CHECK-LABEL: insert_v16i8_nxv16i8_idx1: ; CHECK: // %bb.0: ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill ; CHECK-NEXT: addvl sp, sp, #-1 ; CHECK-NEXT: rdvl x8, #1 ; CHECK-NEXT: sub x8, x8, #1 // =1 ; CHECK-NEXT: cmp x8, #1 // =1 ; CHECK-NEXT: ptrue p0.b ; CHECK-NEXT: csinc x8, x8, xzr, lo ; CHECK-NEXT: mov x9, sp ; CHECK-NEXT: st1b { z0.b }, p0, [sp] ; CHECK-NEXT: str q1, [x9, x8] ; CHECK-NEXT: ld1b { z0.b }, p0/z, [sp] ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret %retval = call @llvm.experimental.vector.insert.nxv16i8.v16i8( %vec, <16 x i8> %subvec, i64 1) ret %retval } declare @llvm.experimental.vector.insert.nxv2i64.v2i64(, <2 x i64>, i64) declare @llvm.experimental.vector.insert.nxv4i32.v4i32(, <4 x i32>, i64) declare @llvm.experimental.vector.insert.nxv8i16.v8i16(, <8 x i16>, i64) declare @llvm.experimental.vector.insert.nxv16i8.v16i8(, <16 x i8>, i64)