; 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 ; ; ST1B ; define void @st1b_upper_bound( %data, %pg, i8* %a) { ; CHECK-LABEL: st1b_upper_bound: ; CHECK: st1b { z0.b }, p0, [x0, #7, mul vl] ; CHECK-NEXT: ret %base_scalable = bitcast i8* %a to * %base = getelementptr , * %base_scalable, i64 7 %base_scalar = bitcast * %base to i8* call void @llvm.aarch64.sve.st1.nxv16i8( %data, %pg, i8* %base_scalar) ret void } define void @st1b_inbound( %data, %pg, i8* %a) { ; CHECK-LABEL: st1b_inbound: ; CHECK: st1b { z0.b }, p0, [x0, #1, mul vl] ; CHECK-NEXT: ret %base_scalable = bitcast i8* %a to * %base = getelementptr , * %base_scalable, i64 1 %base_scalar = bitcast * %base to i8* call void @llvm.aarch64.sve.st1.nxv16i8( %data, %pg, i8* %base_scalar) ret void } define void @st1b_lower_bound( %data, %pg, i8* %a) { ; CHECK-LABEL: st1b_lower_bound: ; CHECK: st1b { z0.b }, p0, [x0, #-8, mul vl] ; CHECK-NEXT: ret %base_scalable = bitcast i8* %a to * %base = getelementptr , * %base_scalable, i64 -8 %base_scalar = bitcast * %base to i8* call void @llvm.aarch64.sve.st1.nxv16i8( %data, %pg, i8* %base_scalar) ret void } define void @st1b_out_of_upper_bound( %data, %pg, i8* %a) { ; CHECK-LABEL: st1b_out_of_upper_bound: ; CHECK: rdvl x[[OFFSET:[0-9]+]], #8 ; CHECK: st1b { z0.b }, p0, [x0, x[[OFFSET]]] ; CHECK-NEXT: ret %base_scalable = bitcast i8* %a to * %base = getelementptr , * %base_scalable, i64 8 %base_scalar = bitcast * %base to i8* call void @llvm.aarch64.sve.st1.nxv16i8( %data, %pg, i8* %base_scalar) ret void } define void @st1b_out_of_lower_bound( %data, %pg, i8* %a) { ; CHECK-LABEL: st1b_out_of_lower_bound: ; CHECK: rdvl x[[OFFSET:[0-9]+]], #-9 ; CHECK: st1b { z0.b }, p0, [x0, x[[OFFSET]]] ; CHECK-NEXT: ret %base_scalable = bitcast i8* %a to * %base = getelementptr , * %base_scalable, i64 -9 %base_scalar = bitcast * %base to i8* call void @llvm.aarch64.sve.st1.nxv16i8( %data, %pg, i8* %base_scalar) ret void } define void @st1b_s_inbound( %data, %pg, i8* %a) { ; CHECK-LABEL: st1b_s_inbound: ; CHECK: st1b { z0.s }, p0, [x0, #7, mul vl] ; CHECK-NEXT: ret %base_scalable = bitcast i8* %a to * %base = getelementptr , * %base_scalable, i64 7 %base_scalar = bitcast * %base to i8* %trunc = trunc %data to call void @llvm.aarch64.sve.st1.nxv4i8( %trunc, %pg, i8* %base_scalar) ret void } define void @st1b_h_inbound( %data, %pg, i8* %a) { ; CHECK-LABEL: st1b_h_inbound: ; CHECK: st1b { z0.h }, p0, [x0, #1, mul vl] ; CHECK-NEXT: ret %base_scalable = bitcast i8* %a to * %base = getelementptr , * %base_scalable, i64 1 %base_scalar = bitcast * %base to i8* %trunc = trunc %data to call void @llvm.aarch64.sve.st1.nxv8i8( %trunc, %pg, i8* %base_scalar) ret void } define void @st1b_d_inbound( %data, %pg, i8* %a) { ; CHECK-LABEL: st1b_d_inbound: ; CHECK: st1b { z0.d }, p0, [x0, #-7, mul vl] ; CHECK-NEXT: ret %base_scalable = bitcast i8* %a to * %base = getelementptr , * %base_scalable, i64 -7 %base_scalar = bitcast * %base to i8* %trunc = trunc %data to call void @llvm.aarch64.sve.st1.nxv2i8( %trunc, %pg, i8* %base_scalar) ret void } ; ; ST1H ; define void @st1h_inbound( %data, %pg, i16* %a) { ; CHECK-LABEL: st1h_inbound: ; CHECK: st1h { z0.h }, p0, [x0, #-1, mul vl] ; CHECK-NEXT: ret %base_scalable = bitcast i16* %a to * %base = getelementptr , * %base_scalable, i64 -1 %base_scalar = bitcast * %base to i16* call void @llvm.aarch64.sve.st1.nxv8i16( %data, %pg, i16* %base_scalar) ret void } define void @st1h_f16_inbound( %data, %pg, half* %a) { ; CHECK-LABEL: st1h_f16_inbound: ; CHECK: st1h { z0.h }, p0, [x0, #-5, mul vl] ; CHECK-NEXT: ret %base_scalable = bitcast half* %a to * %base = getelementptr , * %base_scalable, i64 -5 %base_scalar = bitcast * %base to half* call void @llvm.aarch64.sve.st1.nxv8f16( %data, %pg, half* %base_scalar) ret void } define void @st1h_bf16_inbound( %data, %pg, bfloat* %a) #0 { ; CHECK-LABEL: st1h_bf16_inbound: ; CHECK: st1h { z0.h }, p0, [x0, #-5, mul vl] ; CHECK-NEXT: ret %base_scalable = bitcast bfloat* %a to * %base = getelementptr , * %base_scalable, i64 -5 %base_scalar = bitcast * %base to bfloat* call void @llvm.aarch64.sve.st1.nxv8bf16( %data, %pg, bfloat* %base_scalar) ret void } define void @st1h_s_inbound( %data, %pg, i16* %a) { ; CHECK-LABEL: st1h_s_inbound: ; CHECK: st1h { z0.s }, p0, [x0, #2, mul vl] ; CHECK-NEXT: ret %base_scalable = bitcast i16* %a to * %base = getelementptr , * %base_scalable, i64 2 %base_scalar = bitcast * %base to i16* %trunc = trunc %data to call void @llvm.aarch64.sve.st1.nxv4i16( %trunc, %pg, i16* %base_scalar) ret void } define void @st1h_d_inbound( %data, %pg, i16* %a) { ; CHECK-LABEL: st1h_d_inbound: ; CHECK: st1h { z0.d }, p0, [x0, #-4, mul vl] ; CHECK-NEXT: ret %base_scalable = bitcast i16* %a to * %base = getelementptr , * %base_scalable, i64 -4 %base_scalar = bitcast * %base to i16* %trunc = trunc %data to call void @llvm.aarch64.sve.st1.nxv2i16( %trunc, %pg, i16* %base_scalar) ret void } ; ; ST1W ; define void @st1w_inbound( %data, %pg, i32* %a) { ; CHECK-LABEL: st1w_inbound: ; CHECK: st1w { z0.s }, p0, [x0, #6, mul vl] ; CHECK-NEXT: ret %base_scalable = bitcast i32* %a to * %base = getelementptr , * %base_scalable, i64 6 %base_scalar = bitcast * %base to i32* call void @llvm.aarch64.sve.st1.nxv4i32( %data, %pg, i32* %base_scalar) ret void } define void @st1w_f32_inbound( %data, %pg, float* %a) { ; CHECK-LABEL: st1w_f32_inbound: ; CHECK: st1w { z0.s }, p0, [x0, #-1, mul vl] ; CHECK-NEXT: ret %base_scalable = bitcast float* %a to * %base = getelementptr , * %base_scalable, i64 -1 %base_scalar = bitcast * %base to float* call void @llvm.aarch64.sve.st1.nxv4f32( %data, %pg, float* %base_scalar) ret void } define void @st1w_d_inbound( %data, %pg, i32* %a) { ; CHECK-LABEL: st1w_d_inbound: ; CHECK: st1w { z0.d }, p0, [x0, #1, mul vl] ; CHECK-NEXT: ret %base_scalable = bitcast i32* %a to * %base = getelementptr , * %base_scalable, i64 1 %base_scalar = bitcast * %base to i32* %trunc = trunc %data to call void @llvm.aarch64.sve.st1.nxv2i32( %trunc, %pg, i32* %base_scalar) ret void } ; ; ST1D ; define void @st1d_inbound( %data, %pg, i64* %a) { ; CHECK-LABEL: st1d_inbound: ; CHECK: st1d { z0.d }, p0, [x0, #5, mul vl] ; CHECK-NEXT: ret %base_scalable = bitcast i64* %a to * %base = getelementptr , * %base_scalable, i64 5 %base_scalar = bitcast * %base to i64* call void @llvm.aarch64.sve.st1.nxv2i64( %data, %pg, i64* %base_scalar) ret void } define void @st1d_f64_inbound( %data, %pg, double* %a) { ; CHECK-LABEL: st1d_f64_inbound: ; CHECK: st1d { z0.d }, p0, [x0, #-8, mul vl] ; CHECK-NEXT: ret %base_scalable = bitcast double* %a to * %base = getelementptr , * %base_scalable, i64 -8 %base_scalar = bitcast * %base to double* call void @llvm.aarch64.sve.st1.nxv2f64( %data, %pg, double* %base_scalar) ret void } declare void @llvm.aarch64.sve.st1.nxv16i8(, , i8*) declare void @llvm.aarch64.sve.st1.nxv8i8(, , i8*) declare void @llvm.aarch64.sve.st1.nxv8i16(, , i16*) declare void @llvm.aarch64.sve.st1.nxv8f16(, , half*) declare void @llvm.aarch64.sve.st1.nxv8bf16(, , bfloat*) declare void @llvm.aarch64.sve.st1.nxv4i8(, , i8*) declare void @llvm.aarch64.sve.st1.nxv4i16(, , i16*) declare void @llvm.aarch64.sve.st1.nxv4i32(, , i32*) declare void @llvm.aarch64.sve.st1.nxv4f32(, , float*) declare void @llvm.aarch64.sve.st1.nxv2i8(, , i8*) declare void @llvm.aarch64.sve.st1.nxv2i16(, , i16*) declare void @llvm.aarch64.sve.st1.nxv2i32(, , i32*) declare void @llvm.aarch64.sve.st1.nxv2i64(, , i64*) declare void @llvm.aarch64.sve.st1.nxv2f64(, , double*) ; +bf16 is required for the bfloat version. attributes #0 = { "target-features"="+sve,+bf16" }