; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve < %s 2>%t | FileCheck %s ; 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 ; ; LDFF1B ; define @ldff1b( %pg, i8* %a) { ; CHECK-LABEL: ldff1b: ; CHECK: ldff1b { z0.b }, p0/z, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ldff1.nxv16i8( %pg, i8* %a) ret %load } define @ldff1b_reg( %pg, i8* %a, i64 %offset) { ; CHECK-LABEL: ldff1b_reg: ; CHECK: ldff1b { z0.b }, p0/z, [x0, x1] ; CHECK-NEXT: ret %base = getelementptr i8, i8* %a, i64 %offset %load = call @llvm.aarch64.sve.ldff1.nxv16i8( %pg, i8* %base) ret %load } define @ldff1b_h( %pg, i8* %a) { ; CHECK-LABEL: ldff1b_h: ; CHECK: ldff1b { z0.h }, p0/z, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ldff1.nxv8i8( %pg, i8* %a) %res = zext %load to ret %res } define @ldff1b_h_reg( %pg, i8* %a, i64 %offset) { ; CHECK-LABEL: ldff1b_h_reg: ; CHECK: ldff1b { z0.h }, p0/z, [x0, x1] ; CHECK-NEXT: ret %base = getelementptr i8, i8* %a, i64 %offset %load = call @llvm.aarch64.sve.ldff1.nxv8i8( %pg, i8* %base) %res = zext %load to ret %res } define @ldff1b_s( %pg, i8* %a) { ; CHECK-LABEL: ldff1b_s: ; CHECK: ldff1b { z0.s }, p0/z, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ldff1.nxv4i8( %pg, i8* %a) %res = zext %load to ret %res } define @ldff1b_s_reg( %pg, i8* %a, i64 %offset) { ; CHECK-LABEL: ldff1b_s_reg: ; CHECK: ldff1b { z0.s }, p0/z, [x0, x1] ; CHECK-NEXT: ret %base = getelementptr i8, i8* %a, i64 %offset %load = call @llvm.aarch64.sve.ldff1.nxv4i8( %pg, i8* %base) %res = zext %load to ret %res } define @ldff1b_d( %pg, i8* %a) { ; CHECK-LABEL: ldff1b_d: ; CHECK: ldff1b { z0.d }, p0/z, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ldff1.nxv2i8( %pg, i8* %a) %res = zext %load to ret %res } define @ldff1b_d_reg( %pg, i8* %a, i64 %offset) { ; CHECK-LABEL: ldff1b_d_reg: ; CHECK: ldff1b { z0.d }, p0/z, [x0, x1] ; CHECK-NEXT: ret %base = getelementptr i8, i8* %a, i64 %offset %load = call @llvm.aarch64.sve.ldff1.nxv2i8( %pg, i8* %base) %res = zext %load to ret %res } ; ; LDFF1SB ; define @ldff1sb_h( %pg, i8* %a) { ; CHECK-LABEL: ldff1sb_h: ; CHECK: ldff1sb { z0.h }, p0/z, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ldff1.nxv8i8( %pg, i8* %a) %res = sext %load to ret %res } define @ldff1sb_h_reg( %pg, i8* %a, i64 %offset) { ; CHECK-LABEL: ldff1sb_h_reg: ; CHECK: ldff1sb { z0.h }, p0/z, [x0, x1] ; CHECK-NEXT: ret %base = getelementptr i8, i8* %a, i64 %offset %load = call @llvm.aarch64.sve.ldff1.nxv8i8( %pg, i8* %base) %res = sext %load to ret %res } define @ldff1sb_s( %pg, i8* %a) { ; CHECK-LABEL: ldff1sb_s: ; CHECK: ldff1sb { z0.s }, p0/z, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ldff1.nxv4i8( %pg, i8* %a) %res = sext %load to ret %res } define @ldff1sb_s_reg( %pg, i8* %a, i64 %offset) { ; CHECK-LABEL: ldff1sb_s_reg: ; CHECK: ldff1sb { z0.s }, p0/z, [x0, x1] ; CHECK-NEXT: ret %base = getelementptr i8, i8* %a, i64 %offset %load = call @llvm.aarch64.sve.ldff1.nxv4i8( %pg, i8* %base) %res = sext %load to ret %res } define @ldff1sb_d( %pg, i8* %a) { ; CHECK-LABEL: ldff1sb_d: ; CHECK: ldff1sb { z0.d }, p0/z, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ldff1.nxv2i8( %pg, i8* %a) %res = sext %load to ret %res } define @ldff1sb_d_reg( %pg, i8* %a, i64 %offset) { ; CHECK-LABEL: ldff1sb_d_reg: ; CHECK: ldff1sb { z0.d }, p0/z, [x0, x1] ; CHECK-NEXT: ret %base = getelementptr i8, i8* %a, i64 %offset %load = call @llvm.aarch64.sve.ldff1.nxv2i8( %pg, i8* %base) %res = sext %load to ret %res } ; ; LDFF1H ; define @ldff1h( %pg, i16* %a) { ; CHECK-LABEL: ldff1h: ; CHECK: ldff1h { z0.h }, p0/z, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ldff1.nxv8i16( %pg, i16* %a) ret %load } define @ldff1h_reg( %pg, i16* %a, i64 %offset) { ; CHECK-LABEL: ldff1h_reg: ; CHECK: ldff1h { z0.h }, p0/z, [x0, x1, lsl #1] ; CHECK-NEXT: ret %base = getelementptr i16, i16* %a, i64 %offset %load = call @llvm.aarch64.sve.ldff1.nxv8i16( %pg, i16* %base) ret %load } define @ldff1h_s( %pg, i16* %a) { ; CHECK-LABEL: ldff1h_s: ; CHECK: ldff1h { z0.s }, p0/z, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ldff1.nxv4i16( %pg, i16* %a) %res = zext %load to ret %res } define @ldff1h_s_reg( %pg, i16* %a, i64 %offset) { ; CHECK-LABEL: ldff1h_s_reg: ; CHECK: ldff1h { z0.s }, p0/z, [x0, x1, lsl #1] ; CHECK-NEXT: ret %base = getelementptr i16, i16* %a, i64 %offset %load = call @llvm.aarch64.sve.ldff1.nxv4i16( %pg, i16* %base) %res = zext %load to ret %res } define @ldff1h_d( %pg, i16* %a) { ; CHECK-LABEL: ldff1h_d: ; CHECK: ldff1h { z0.d }, p0/z, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ldff1.nxv2i16( %pg, i16* %a) %res = zext %load to ret %res } define @ldff1h_d_reg( %pg, i16* %a, i64 %offset) { ; CHECK-LABEL: ldff1h_d_reg: ; CHECK: ldff1h { z0.d }, p0/z, [x0, x1, lsl #1] ; CHECK-NEXT: ret %base = getelementptr i16, i16* %a, i64 %offset %load = call @llvm.aarch64.sve.ldff1.nxv2i16( %pg, i16* %base) %res = zext %load to ret %res } define @ldff1h_f16( %pg, half* %a) { ; CHECK-LABEL: ldff1h_f16: ; CHECK: ldff1h { z0.h }, p0/z, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ldff1.nxv8f16( %pg, half* %a) ret %load } define @ldff1h_bf16( %pg, bfloat* %a) #0 { ; CHECK-LABEL: ldff1h_bf16: ; CHECK: ldff1h { z0.h }, p0/z, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ldff1.nxv8bf16( %pg, bfloat* %a) ret %load } define @ldff1h_f16_reg( %pg, half* %a, i64 %offset) { ; CHECK-LABEL: ldff1h_f16_reg: ; CHECK: ldff1h { z0.h }, p0/z, [x0, x1, lsl #1] ; CHECK-NEXT: ret %base = getelementptr half, half* %a, i64 %offset %load = call @llvm.aarch64.sve.ldff1.nxv8f16( %pg, half* %base) ret %load } define @ldff1h_bf16_reg( %pg, bfloat* %a, i64 %offset) #0 { ; CHECK-LABEL: ldff1h_bf16_reg: ; CHECK: ldff1h { z0.h }, p0/z, [x0, x1, lsl #1] ; CHECK-NEXT: ret %base = getelementptr bfloat, bfloat* %a, i64 %offset %load = call @llvm.aarch64.sve.ldff1.nxv8bf16( %pg, bfloat* %base) ret %load } ; ; LDFF1SH ; define @ldff1sh_s( %pg, i16* %a) { ; CHECK-LABEL: ldff1sh_s: ; CHECK: ldff1sh { z0.s }, p0/z, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ldff1.nxv4i16( %pg, i16* %a) %res = sext %load to ret %res } define @ldff1sh_s_reg( %pg, i16* %a, i64 %offset) { ; CHECK-LABEL: ldff1sh_s_reg: ; CHECK: ldff1sh { z0.s }, p0/z, [x0, x1, lsl #1] ; CHECK-NEXT: ret %base = getelementptr i16, i16* %a, i64 %offset %load = call @llvm.aarch64.sve.ldff1.nxv4i16( %pg, i16* %base) %res = sext %load to ret %res } define @ldff1sh_d( %pg, i16* %a) { ; CHECK-LABEL: ldff1sh_d: ; CHECK: ldff1sh { z0.d }, p0/z, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ldff1.nxv2i16( %pg, i16* %a) %res = sext %load to ret %res } define @ldff1sh_d_reg( %pg, i16* %a, i64 %offset) { ; CHECK-LABEL: ldff1sh_d_reg: ; CHECK: ldff1sh { z0.d }, p0/z, [x0, x1, lsl #1] ; CHECK-NEXT: ret %base = getelementptr i16, i16* %a, i64 %offset %load = call @llvm.aarch64.sve.ldff1.nxv2i16( %pg, i16* %base) %res = sext %load to ret %res } ; ; LDFF1W ; define @ldff1w( %pg, i32* %a) { ; CHECK-LABEL: ldff1w: ; CHECK: ldff1w { z0.s }, p0/z, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ldff1.nxv4i32( %pg, i32* %a) ret %load } define @ldff1w_reg( %pg, i32* %a, i64 %offset) { ; CHECK-LABEL: ldff1w_reg: ; CHECK: ldff1w { z0.s }, p0/z, [x0, x1, lsl #2] ; CHECK-NEXT: ret %base = getelementptr i32, i32* %a, i64 %offset %load = call @llvm.aarch64.sve.ldff1.nxv4i32( %pg, i32* %base) ret %load } define @ldff1w_d( %pg, i32* %a) { ; CHECK-LABEL: ldff1w_d: ; CHECK: ldff1w { z0.d }, p0/z, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ldff1.nxv2i32( %pg, i32* %a) %res = zext %load to ret %res } define @ldff1w_d_reg( %pg, i32* %a, i64 %offset) { ; CHECK-LABEL: ldff1w_d_reg: ; CHECK: ldff1w { z0.d }, p0/z, [x0, x1, lsl #2] ; CHECK-NEXT: ret %base = getelementptr i32, i32* %a, i64 %offset %load = call @llvm.aarch64.sve.ldff1.nxv2i32( %pg, i32* %base) %res = zext %load to ret %res } define @ldff1w_f32( %pg, float* %a) { ; CHECK-LABEL: ldff1w_f32: ; CHECK: ldff1w { z0.s }, p0/z, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ldff1.nxv4f32( %pg, float* %a) ret %load } define @ldff1w_f32_reg( %pg, float* %a, i64 %offset) { ; CHECK-LABEL: ldff1w_f32_reg: ; CHECK: ldff1w { z0.s }, p0/z, [x0, x1, lsl #2] ; CHECK-NEXT: ret %base = getelementptr float, float* %a, i64 %offset %load = call @llvm.aarch64.sve.ldff1.nxv4f32( %pg, float* %base) ret %load } define @ldff1w_2f32( %pg, float* %a) { ; CHECK-LABEL: ldff1w_2f32: ; CHECK: ldff1w { z0.d }, p0/z, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ldff1.nxv2f32( %pg, float* %a) ret %load } define @ldff1w_2f32_reg( %pg, float* %a, i64 %offset) { ; CHECK-LABEL: ldff1w_2f32_reg: ; CHECK: ldff1w { z0.d }, p0/z, [x0, x1, lsl #2] ; CHECK-NEXT: ret %base = getelementptr float, float* %a, i64 %offset %load = call @llvm.aarch64.sve.ldff1.nxv2f32( %pg, float* %base) ret %load } ; ; LDFF1SW ; define @ldff1sw_d( %pg, i32* %a) { ; CHECK-LABEL: ldff1sw_d: ; CHECK: ldff1sw { z0.d }, p0/z, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ldff1.nxv2i32( %pg, i32* %a) %res = sext %load to ret %res } define @ldff1sw_d_reg( %pg, i32* %a, i64 %offset) { ; CHECK-LABEL: ldff1sw_d_reg: ; CHECK: ldff1sw { z0.d }, p0/z, [x0, x1, lsl #2] ; CHECK-NEXT: ret %base = getelementptr i32, i32* %a, i64 %offset %load = call @llvm.aarch64.sve.ldff1.nxv2i32( %pg, i32* %base) %res = sext %load to ret %res } ; ; LDFF1D ; define @ldff1d( %pg, i64* %a) { ; CHECK-LABEL: ldff1d: ; CHECK: ldff1d { z0.d }, p0/z, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ldff1.nxv2i64( %pg, i64* %a) ret %load } define @ldff1d_reg( %pg, i64* %a, i64 %offset) { ; CHECK-LABEL: ldff1d_reg: ; CHECK: ldff1d { z0.d }, p0/z, [x0, x1, lsl #3] ; CHECK-NEXT: ret %base = getelementptr i64, i64* %a, i64 %offset %load = call @llvm.aarch64.sve.ldff1.nxv2i64( %pg, i64* %base) ret %load } define @ldff1d_f64( %pg, double* %a) { ; CHECK-LABEL: ldff1d_f64: ; CHECK: ldff1d { z0.d }, p0/z, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ldff1.nxv2f64( %pg, double* %a) ret %load } define @ldff1d_f64_reg( %pg, double* %a, i64 %offset) { ; CHECK-LABEL: ldff1d_f64_reg: ; CHECK: ldff1d { z0.d }, p0/z, [x0, x1, lsl #3] ; CHECK-NEXT: ret %base = getelementptr double, double* %a, i64 %offset %load = call @llvm.aarch64.sve.ldff1.nxv2f64( %pg, double* %base) ret %load } declare @llvm.aarch64.sve.ldff1.nxv16i8(, i8*) declare @llvm.aarch64.sve.ldff1.nxv8i8(, i8*) declare @llvm.aarch64.sve.ldff1.nxv8i16(, i16*) declare @llvm.aarch64.sve.ldff1.nxv8f16(, half*) declare @llvm.aarch64.sve.ldff1.nxv8bf16(, bfloat*) declare @llvm.aarch64.sve.ldff1.nxv4i8(, i8*) declare @llvm.aarch64.sve.ldff1.nxv4i16(, i16*) declare @llvm.aarch64.sve.ldff1.nxv4i32(, i32*) declare @llvm.aarch64.sve.ldff1.nxv2f32(, float*) declare @llvm.aarch64.sve.ldff1.nxv4f32(, float*) declare @llvm.aarch64.sve.ldff1.nxv2i8(, i8*) declare @llvm.aarch64.sve.ldff1.nxv2i16(, i16*) declare @llvm.aarch64.sve.ldff1.nxv2i32(, i32*) declare @llvm.aarch64.sve.ldff1.nxv2i64(, i64*) declare @llvm.aarch64.sve.ldff1.nxv2f64(, double*) ; +bf16 is required for the bfloat version. attributes #0 = { "target-features"="+sve,+bf16" }