; 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_i8( %data, %pred, i8* %a, i64 %index) { ; CHECK-LABEL: st1b_i8: ; CHECK: st1b { z0.b }, p0, [x0, x1] ; CHECK-NEXT: ret %base = getelementptr i8, i8* %a, i64 %index call void @llvm.aarch64.sve.st1.nxv16i8( %data, %pred, i8* %base) ret void } define void @st1b_h( %data, %pred, i8* %a, i64 %index) { ; CHECK-LABEL: st1b_h: ; CHECK: st1b { z0.h }, p0, [x0, x1] ; CHECK-NEXT: ret %base = getelementptr i8, i8* %a, i64 %index %trunc = trunc %data to call void @llvm.aarch64.sve.st1.nxv8i8( %trunc, %pred, i8* %base) ret void } define void @st1b_s( %data, %pred, i8* %a, i64 %index) { ; CHECK-LABEL: st1b_s: ; CHECK: st1b { z0.s }, p0, [x0, x1] ; CHECK-NEXT: ret %base = getelementptr i8, i8* %a, i64 %index %trunc = trunc %data to call void @llvm.aarch64.sve.st1.nxv4i8( %trunc, %pred, i8* %base) ret void } define void @st1b_d( %data, %pred, i8* %a, i64 %index) { ; CHECK-LABEL: st1b_d: ; CHECK: st1b { z0.d }, p0, [x0, x1] ; CHECK-NEXT: ret %base = getelementptr i8, i8* %a, i64 %index %trunc = trunc %data to call void @llvm.aarch64.sve.st1.nxv2i8( %trunc, %pred, i8* %base) ret void } ; ; ST1H ; define void @st1h_i16( %data, %pred, i16* %a, i64 %index) { ; CHECK-LABEL: st1h_i16: ; CHECK: st1h { z0.h }, p0, [x0, x1, lsl #1] ; CHECK-NEXT: ret %base = getelementptr i16, i16* %a, i64 %index call void @llvm.aarch64.sve.st1.nxv8i16( %data, %pred, i16* %base) ret void } define void @st1h_f16( %data, %pred, half* %a, i64 %index) { ; CHECK-LABEL: st1h_f16: ; CHECK: st1h { z0.h }, p0, [x0, x1, lsl #1] ; CHECK-NEXT: ret %base = getelementptr half, half* %a, i64 %index call void @llvm.aarch64.sve.st1.nxv8f16( %data, %pred, half* %base) ret void } define void @st1h_bf16( %data, %pred, bfloat* %a, i64 %index) #0 { ; CHECK-LABEL: st1h_bf16: ; CHECK: st1h { z0.h }, p0, [x0, x1, lsl #1] ; CHECK-NEXT: ret %base = getelementptr bfloat, bfloat* %a, i64 %index call void @llvm.aarch64.sve.st1.nxv8bf16( %data, %pred, bfloat* %base) ret void } define void @st1h_s( %data, %pred, i16* %addr) { ; CHECK-LABEL: st1h_s: ; CHECK: st1h { z0.s }, p0, [x0] ; CHECK-NEXT: ret %trunc = trunc %data to call void @llvm.aarch64.sve.st1.nxv4i16( %trunc, %pred, i16* %addr) ret void } define void @st1h_d( %data, %pred, i16* %a, i64 %index) { ; CHECK-LABEL: st1h_d: ; CHECK: st1h { z0.d }, p0, [x0, x1, lsl #1] ; CHECK-NEXT: ret %base = getelementptr i16, i16* %a, i64 %index %trunc = trunc %data to call void @llvm.aarch64.sve.st1.nxv2i16( %trunc, %pred, i16* %base) ret void } ; ; ST1W ; define void @st1w_i32( %data, %pred, i32* %a, i64 %index) { ; CHECK-LABEL: st1w_i32: ; CHECK: st1w { z0.s }, p0, [x0, x1, lsl #2] ; CHECK-NEXT: ret %base = getelementptr i32, i32* %a, i64 %index call void @llvm.aarch64.sve.st1.nxv4i32( %data, %pred, i32* %base) ret void } define void @st1w_f32( %data, %pred, float* %a, i64 %index) { ; CHECK-LABEL: st1w_f32: ; CHECK: st1w { z0.s }, p0, [x0, x1, lsl #2] ; CHECK-NEXT: ret %base = getelementptr float, float* %a, i64 %index call void @llvm.aarch64.sve.st1.nxv4f32( %data, %pred, float* %base) ret void } define void @st1w_d( %data, %pred, i32* %a, i64 %index) { ; CHECK-LABEL: st1w_d: ; CHECK: st1w { z0.d }, p0, [x0, x1, lsl #2] ; CHECK-NEXT: ret %base = getelementptr i32, i32* %a, i64 %index %trunc = trunc %data to call void @llvm.aarch64.sve.st1.nxv2i32( %trunc, %pred, i32* %base) ret void } ; ; ST1D ; define void @st1d_i64( %data, %pred, i64* %a, i64 %index) { ; CHECK-LABEL: st1d_i64: ; CHECK: st1d { z0.d }, p0, [x0, x1, lsl #3] ; CHECK-NEXT: ret %base = getelementptr i64, i64* %a, i64 %index call void @llvm.aarch64.sve.st1.nxv2i64( %data, %pred, i64* %base) ret void } define void @st1d_f64( %data, %pred, double* %a, i64 %index) { ; CHECK-LABEL: st1d_f64: ; CHECK: st1d { z0.d }, p0, [x0, x1, lsl #3] ; CHECK-NEXT: ret %base = getelementptr double, double* %a, i64 %index call void @llvm.aarch64.sve.st1.nxv2f64( %data, %pred, double* %base) 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" }