; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve -asm-verbose=1 < %s | FileCheck %s ; ; LD1B ; define @masked_ld1b_i8_sext_i32( *%base, %mask) { ; CHECK-LABEL: masked_ld1b_i8_sext_i32: ; CHECK: // %bb.0: ; CHECK-NEXT: ld1b { z0.b }, p0/z, [x0] ; CHECK-NEXT: sunpklo z1.h, z0.b ; CHECK-NEXT: sunpkhi z3.h, z0.b ; CHECK-NEXT: sunpklo z0.s, z1.h ; CHECK-NEXT: sunpkhi z1.s, z1.h ; CHECK-NEXT: sunpklo z2.s, z3.h ; CHECK-NEXT: sunpkhi z3.s, z3.h ; CHECK-NEXT: ret %wide.masked.load = call @llvm.masked.load.nxv16i8.p0(* %base, i32 2, %mask, undef) %res = sext %wide.masked.load to ret %res } define @masked_ld1b_nxv8i8_sext_i32( *%a, %mask) { ; CHECK-LABEL: masked_ld1b_nxv8i8_sext_i32: ; CHECK: // %bb.0: ; CHECK-NEXT: ld1sb { z1.h }, p0/z, [x0] ; CHECK-NEXT: sunpklo z0.s, z1.h ; CHECK-NEXT: sunpkhi z1.s, z1.h ; CHECK-NEXT: ret %wide.masked.load = call @llvm.masked.load.nxv8i8.p0(ptr %a, i32 1, %mask, poison) %res = sext %wide.masked.load to ret %res } define @masked_ld1b_i8_zext_i32( *%base, %mask) { ; CHECK-LABEL: masked_ld1b_i8_zext_i32: ; CHECK: // %bb.0: ; CHECK-NEXT: ld1b { z0.b }, p0/z, [x0] ; CHECK-NEXT: uunpklo z1.h, z0.b ; CHECK-NEXT: uunpkhi z3.h, z0.b ; CHECK-NEXT: uunpklo z0.s, z1.h ; CHECK-NEXT: uunpkhi z1.s, z1.h ; CHECK-NEXT: uunpklo z2.s, z3.h ; CHECK-NEXT: uunpkhi z3.s, z3.h ; CHECK-NEXT: ret %wide.masked.load = call @llvm.masked.load.nxv16i8.p0(* %base, i32 2, %mask, undef) %res = zext %wide.masked.load to ret %res } define @masked_ld1b_nxv8i8_zext_i32( *%a, %mask) { ; CHECK-LABEL: masked_ld1b_nxv8i8_zext_i32: ; CHECK: // %bb.0: ; CHECK-NEXT: ld1b { z1.h }, p0/z, [x0] ; CHECK-NEXT: uunpklo z0.s, z1.h ; CHECK-NEXT: uunpkhi z1.s, z1.h ; CHECK-NEXT: ret %wide.masked.load = call @llvm.masked.load.nxv8i8.p0(ptr %a, i32 1, %mask, poison) %res = zext %wide.masked.load to ret %res } define @masked_ld1b_i8_sext( *%base, %mask) { ; CHECK-LABEL: masked_ld1b_i8_sext: ; CHECK: // %bb.0: ; CHECK-NEXT: ld1b { z0.b }, p0/z, [x0] ; CHECK-NEXT: sunpklo z1.h, z0.b ; CHECK-NEXT: sunpkhi z0.h, z0.b ; CHECK-NEXT: sunpklo z2.s, z1.h ; CHECK-NEXT: sunpkhi z3.s, z1.h ; CHECK-NEXT: sunpklo z5.s, z0.h ; CHECK-NEXT: sunpkhi z7.s, z0.h ; CHECK-NEXT: sunpklo z0.d, z2.s ; CHECK-NEXT: sunpkhi z1.d, z2.s ; CHECK-NEXT: sunpklo z2.d, z3.s ; CHECK-NEXT: sunpkhi z3.d, z3.s ; CHECK-NEXT: sunpklo z4.d, z5.s ; CHECK-NEXT: sunpkhi z5.d, z5.s ; CHECK-NEXT: sunpklo z6.d, z7.s ; CHECK-NEXT: sunpkhi z7.d, z7.s ; CHECK-NEXT: ret %wide.masked.load = call @llvm.masked.load.nxv16i8.p0(* %base, i32 2, %mask, undef) %res = sext %wide.masked.load to ret %res } define @masked_ld1b_nxv4i8_sext_i64( *%a, %mask) { ; CHECK-LABEL: masked_ld1b_nxv4i8_sext_i64: ; CHECK: // %bb.0: ; CHECK-NEXT: ld1sb { z1.s }, p0/z, [x0] ; CHECK-NEXT: sunpklo z0.d, z1.s ; CHECK-NEXT: sunpkhi z1.d, z1.s ; CHECK-NEXT: ret %wide.masked.load = call @llvm.masked.load.nxv4i8.p0(ptr %a, i32 1, %mask, poison) %res = sext %wide.masked.load to ret %res } define @masked_ld1b_i8_zext( *%base, %mask) { ; CHECK-LABEL: masked_ld1b_i8_zext: ; CHECK: // %bb.0: ; CHECK-NEXT: ld1b { z0.b }, p0/z, [x0] ; CHECK-NEXT: uunpklo z1.h, z0.b ; CHECK-NEXT: uunpkhi z0.h, z0.b ; CHECK-NEXT: uunpklo z2.s, z1.h ; CHECK-NEXT: uunpkhi z3.s, z1.h ; CHECK-NEXT: uunpklo z5.s, z0.h ; CHECK-NEXT: uunpkhi z7.s, z0.h ; CHECK-NEXT: uunpklo z0.d, z2.s ; CHECK-NEXT: uunpkhi z1.d, z2.s ; CHECK-NEXT: uunpklo z2.d, z3.s ; CHECK-NEXT: uunpkhi z3.d, z3.s ; CHECK-NEXT: uunpklo z4.d, z5.s ; CHECK-NEXT: uunpkhi z5.d, z5.s ; CHECK-NEXT: uunpklo z6.d, z7.s ; CHECK-NEXT: uunpkhi z7.d, z7.s ; CHECK-NEXT: ret %wide.masked.load = call @llvm.masked.load.nxv16i8.p0(* %base, i32 2, %mask, undef) %res = zext %wide.masked.load to ret %res } define @masked_ld1b_nxv4i8_zext_i64( *%a, %mask) { ; CHECK-LABEL: masked_ld1b_nxv4i8_zext_i64: ; CHECK: // %bb.0: ; CHECK-NEXT: ld1b { z1.s }, p0/z, [x0] ; CHECK-NEXT: uunpklo z0.d, z1.s ; CHECK-NEXT: uunpkhi z1.d, z1.s ; CHECK-NEXT: ret %wide.masked.load = call @llvm.masked.load.nxv4i8.p0(ptr %a, i32 1, %mask, poison) %res = zext %wide.masked.load to ret %res } ; ; LD1H ; define @masked_ld1h_i16_sext( *%base, %mask) { ; CHECK-LABEL: masked_ld1h_i16_sext: ; CHECK: // %bb.0: ; CHECK-NEXT: ld1h { z0.h }, p0/z, [x0] ; CHECK-NEXT: sunpklo z1.s, z0.h ; CHECK-NEXT: sunpkhi z3.s, z0.h ; CHECK-NEXT: sunpklo z0.d, z1.s ; CHECK-NEXT: sunpkhi z1.d, z1.s ; CHECK-NEXT: sunpklo z2.d, z3.s ; CHECK-NEXT: sunpkhi z3.d, z3.s ; CHECK-NEXT: ret %wide.masked.load = call @llvm.masked.load.nxv8i16.p0(* %base, i32 2, %mask, undef) %res = sext %wide.masked.load to ret %res } define @masked_ld1h_nxv4i16_sext( *%a, %mask) { ; CHECK-LABEL: masked_ld1h_nxv4i16_sext: ; CHECK: // %bb.0: ; CHECK-NEXT: ld1sh { z1.s }, p0/z, [x0] ; CHECK-NEXT: sunpklo z0.d, z1.s ; CHECK-NEXT: sunpkhi z1.d, z1.s ; CHECK-NEXT: ret %wide.masked.load = call @llvm.masked.load.nxv4i16.p0(ptr %a, i32 1, %mask, poison) %res = sext %wide.masked.load to ret %res } define @masked_ld1h_i16_zext( *%base, %mask) { ; CHECK-LABEL: masked_ld1h_i16_zext: ; CHECK: // %bb.0: ; CHECK-NEXT: ld1h { z0.h }, p0/z, [x0] ; CHECK-NEXT: uunpklo z1.s, z0.h ; CHECK-NEXT: uunpkhi z3.s, z0.h ; CHECK-NEXT: uunpklo z0.d, z1.s ; CHECK-NEXT: uunpkhi z1.d, z1.s ; CHECK-NEXT: uunpklo z2.d, z3.s ; CHECK-NEXT: uunpkhi z3.d, z3.s ; CHECK-NEXT: ret %wide.masked.load = call @llvm.masked.load.nxv8i16.p0(* %base, i32 2, %mask, undef) %res = zext %wide.masked.load to ret %res } define @masked_ld1h_nxv4i16_zext( *%a, %mask) { ; CHECK-LABEL: masked_ld1h_nxv4i16_zext: ; CHECK: // %bb.0: ; CHECK-NEXT: ld1h { z1.s }, p0/z, [x0] ; CHECK-NEXT: uunpklo z0.d, z1.s ; CHECK-NEXT: uunpkhi z1.d, z1.s ; CHECK-NEXT: ret %wide.masked.load = call @llvm.masked.load.nxv4i16.p0(ptr %a, i32 1, %mask, poison) %res = zext %wide.masked.load to ret %res } ; ; LD1W ; define @masked_ld1w_i32_sext( *%base, %mask) { ; CHECK-LABEL: masked_ld1w_i32_sext: ; CHECK: // %bb.0: ; CHECK-NEXT: ld1w { z1.s }, p0/z, [x0] ; CHECK-NEXT: sunpklo z0.d, z1.s ; CHECK-NEXT: sunpkhi z1.d, z1.s ; CHECK-NEXT: ret %wide.masked.load = call @llvm.masked.load.nxv4i32.p0(* %base, i32 4, %mask, undef) %res = sext %wide.masked.load to ret %res } define @masked_ld1w_i32_zext( *%base, %mask) { ; CHECK-LABEL: masked_ld1w_i32_zext: ; CHECK: // %bb.0: ; CHECK-NEXT: ld1w { z1.s }, p0/z, [x0] ; CHECK-NEXT: uunpklo z0.d, z1.s ; CHECK-NEXT: uunpkhi z1.d, z1.s ; CHECK-NEXT: ret %wide.masked.load = call @llvm.masked.load.nxv4i32.p0(* %base, i32 4, %mask, undef) %res = zext %wide.masked.load to ret %res } declare @llvm.masked.load.nxv16i8.p0(*, i32 immarg, , ) declare @llvm.masked.load.nxv8i8.p0(*, i32 immarg, , ) declare @llvm.masked.load.nxv4i8.p0(*, i32 immarg, , ) declare @llvm.masked.load.nxv8i16.p0(*, i32 immarg, , ) declare @llvm.masked.load.nxv4i16.p0(*, i32 immarg, , ) declare @llvm.masked.load.nxv4i32.p0(*, i32 immarg, , )