1 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve < %s | FileCheck %s
7 define void @st1b_i8(<vscale x 16 x i8> %data, <vscale x 16 x i1> %pred, i8* %a, i64 %index) {
8 ; CHECK-LABEL: st1b_i8:
9 ; CHECK: st1b { z0.b }, p0, [x0, x1]
11 %base = getelementptr i8, i8* %a, i64 %index
12 call void @llvm.aarch64.sve.st1.nxv16i8(<vscale x 16 x i8> %data,
13 <vscale x 16 x i1> %pred,
20 define void @st1b_h(<vscale x 8 x i16> %data, <vscale x 8 x i1> %pred, i8* %a, i64 %index) {
21 ; CHECK-LABEL: st1b_h:
22 ; CHECK: st1b { z0.h }, p0, [x0, x1]
24 %base = getelementptr i8, i8* %a, i64 %index
25 %trunc = trunc <vscale x 8 x i16> %data to <vscale x 8 x i8>
26 call void @llvm.aarch64.sve.st1.nxv8i8(<vscale x 8 x i8> %trunc,
27 <vscale x 8 x i1> %pred,
32 define void @st1b_s(<vscale x 4 x i32> %data, <vscale x 4 x i1> %pred, i8* %a, i64 %index) {
33 ; CHECK-LABEL: st1b_s:
34 ; CHECK: st1b { z0.s }, p0, [x0, x1]
36 %base = getelementptr i8, i8* %a, i64 %index
37 %trunc = trunc <vscale x 4 x i32> %data to <vscale x 4 x i8>
38 call void @llvm.aarch64.sve.st1.nxv4i8(<vscale x 4 x i8> %trunc,
39 <vscale x 4 x i1> %pred,
44 define void @st1b_d(<vscale x 2 x i64> %data, <vscale x 2 x i1> %pred, i8* %a, i64 %index) {
45 ; CHECK-LABEL: st1b_d:
46 ; CHECK: st1b { z0.d }, p0, [x0, x1]
48 %base = getelementptr i8, i8* %a, i64 %index
49 %trunc = trunc <vscale x 2 x i64> %data to <vscale x 2 x i8>
50 call void @llvm.aarch64.sve.st1.nxv2i8(<vscale x 2 x i8> %trunc,
51 <vscale x 2 x i1> %pred,
60 define void @st1h_i16(<vscale x 8 x i16> %data, <vscale x 8 x i1> %pred, i16* %a, i64 %index) {
61 ; CHECK-LABEL: st1h_i16:
62 ; CHECK: st1h { z0.h }, p0, [x0, x1, lsl #1]
64 %base = getelementptr i16, i16* %a, i64 %index
65 call void @llvm.aarch64.sve.st1.nxv8i16(<vscale x 8 x i16> %data,
66 <vscale x 8 x i1> %pred,
71 define void @st1h_f16(<vscale x 8 x half> %data, <vscale x 8 x i1> %pred, half* %a, i64 %index) {
72 ; CHECK-LABEL: st1h_f16:
73 ; CHECK: st1h { z0.h }, p0, [x0, x1, lsl #1]
75 %base = getelementptr half, half* %a, i64 %index
76 call void @llvm.aarch64.sve.st1.nxv8f16(<vscale x 8 x half> %data,
77 <vscale x 8 x i1> %pred,
82 define void @st1h_bf16(<vscale x 8 x bfloat> %data, <vscale x 8 x i1> %pred, bfloat* %a, i64 %index) #0 {
83 ; CHECK-LABEL: st1h_bf16:
84 ; CHECK: st1h { z0.h }, p0, [x0, x1, lsl #1]
86 %base = getelementptr bfloat, bfloat* %a, i64 %index
87 call void @llvm.aarch64.sve.st1.nxv8bf16(<vscale x 8 x bfloat> %data,
88 <vscale x 8 x i1> %pred,
93 define void @st1h_s(<vscale x 4 x i32> %data, <vscale x 4 x i1> %pred, i16* %addr) {
94 ; CHECK-LABEL: st1h_s:
95 ; CHECK: st1h { z0.s }, p0, [x0]
97 %trunc = trunc <vscale x 4 x i32> %data to <vscale x 4 x i16>
98 call void @llvm.aarch64.sve.st1.nxv4i16(<vscale x 4 x i16> %trunc,
99 <vscale x 4 x i1> %pred,
104 define void @st1h_d(<vscale x 2 x i64> %data, <vscale x 2 x i1> %pred, i16* %a, i64 %index) {
105 ; CHECK-LABEL: st1h_d:
106 ; CHECK: st1h { z0.d }, p0, [x0, x1, lsl #1]
108 %base = getelementptr i16, i16* %a, i64 %index
109 %trunc = trunc <vscale x 2 x i64> %data to <vscale x 2 x i16>
110 call void @llvm.aarch64.sve.st1.nxv2i16(<vscale x 2 x i16> %trunc,
111 <vscale x 2 x i1> %pred,
120 define void @st1w_i32(<vscale x 4 x i32> %data, <vscale x 4 x i1> %pred, i32* %a, i64 %index) {
121 ; CHECK-LABEL: st1w_i32:
122 ; CHECK: st1w { z0.s }, p0, [x0, x1, lsl #2]
124 %base = getelementptr i32, i32* %a, i64 %index
125 call void @llvm.aarch64.sve.st1.nxv4i32(<vscale x 4 x i32> %data,
126 <vscale x 4 x i1> %pred,
131 define void @st1w_f32(<vscale x 4 x float> %data, <vscale x 4 x i1> %pred, float* %a, i64 %index) {
132 ; CHECK-LABEL: st1w_f32:
133 ; CHECK: st1w { z0.s }, p0, [x0, x1, lsl #2]
135 %base = getelementptr float, float* %a, i64 %index
136 call void @llvm.aarch64.sve.st1.nxv4f32(<vscale x 4 x float> %data,
137 <vscale x 4 x i1> %pred,
142 define void @st1w_d(<vscale x 2 x i64> %data, <vscale x 2 x i1> %pred, i32* %a, i64 %index) {
143 ; CHECK-LABEL: st1w_d:
144 ; CHECK: st1w { z0.d }, p0, [x0, x1, lsl #2]
146 %base = getelementptr i32, i32* %a, i64 %index
147 %trunc = trunc <vscale x 2 x i64> %data to <vscale x 2 x i32>
148 call void @llvm.aarch64.sve.st1.nxv2i32(<vscale x 2 x i32> %trunc,
149 <vscale x 2 x i1> %pred,
158 define void @st1d_i64(<vscale x 2 x i64> %data, <vscale x 2 x i1> %pred, i64* %a, i64 %index) {
159 ; CHECK-LABEL: st1d_i64:
160 ; CHECK: st1d { z0.d }, p0, [x0, x1, lsl #3]
162 %base = getelementptr i64, i64* %a, i64 %index
163 call void @llvm.aarch64.sve.st1.nxv2i64(<vscale x 2 x i64> %data,
164 <vscale x 2 x i1> %pred,
169 define void @st1d_f64(<vscale x 2 x double> %data, <vscale x 2 x i1> %pred, double* %a, i64 %index) {
170 ; CHECK-LABEL: st1d_f64:
171 ; CHECK: st1d { z0.d }, p0, [x0, x1, lsl #3]
173 %base = getelementptr double, double* %a, i64 %index
174 call void @llvm.aarch64.sve.st1.nxv2f64(<vscale x 2 x double> %data,
175 <vscale x 2 x i1> %pred,
180 declare void @llvm.aarch64.sve.st1.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i1>, i8*)
182 declare void @llvm.aarch64.sve.st1.nxv8i8(<vscale x 8 x i8>, <vscale x 8 x i1>, i8*)
183 declare void @llvm.aarch64.sve.st1.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i1>, i16*)
184 declare void @llvm.aarch64.sve.st1.nxv8f16(<vscale x 8 x half>, <vscale x 8 x i1>, half*)
185 declare void @llvm.aarch64.sve.st1.nxv8bf16(<vscale x 8 x bfloat>, <vscale x 8 x i1>, bfloat*)
187 declare void @llvm.aarch64.sve.st1.nxv4i8(<vscale x 4 x i8>, <vscale x 4 x i1>, i8*)
188 declare void @llvm.aarch64.sve.st1.nxv4i16(<vscale x 4 x i16>, <vscale x 4 x i1>, i16*)
189 declare void @llvm.aarch64.sve.st1.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i1>, i32*)
190 declare void @llvm.aarch64.sve.st1.nxv4f32(<vscale x 4 x float>, <vscale x 4 x i1>, float*)
192 declare void @llvm.aarch64.sve.st1.nxv2i8(<vscale x 2 x i8>, <vscale x 2 x i1>, i8*)
193 declare void @llvm.aarch64.sve.st1.nxv2i16(<vscale x 2 x i16>, <vscale x 2 x i1>, i16*)
194 declare void @llvm.aarch64.sve.st1.nxv2i32(<vscale x 2 x i32>, <vscale x 2 x i1>, i32*)
195 declare void @llvm.aarch64.sve.st1.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i1>, i64*)
196 declare void @llvm.aarch64.sve.st1.nxv2f64(<vscale x 2 x double>, <vscale x 2 x i1>, double*)
198 ; +bf16 is required for the bfloat version.
199 attributes #0 = { "target-features"="+sve,+bf16" }