1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve,+bf16 < %s | FileCheck %s
6 define <vscale x 16 x i8> @ld1_nxv16i8(ptr %addr, i64 %off) {
7 ; CHECK-LABEL: ld1_nxv16i8:
9 ; CHECK-NEXT: ptrue p0.b
10 ; CHECK-NEXT: ld1b { z0.b }, p0/z, [x0, x1]
12 %ptr = getelementptr inbounds i8, ptr %addr, i64 %off
13 %val = load volatile <vscale x 16 x i8>, ptr %ptr
14 ret <vscale x 16 x i8> %val
17 define <vscale x 8 x i16> @ld1_nxv16i8_bitcast_to_i16(ptr %addr, i64 %off) {
18 ; CHECK-LABEL: ld1_nxv16i8_bitcast_to_i16:
20 ; CHECK-NEXT: ptrue p0.b
21 ; CHECK-NEXT: ld1b { z0.b }, p0/z, [x0, x1]
23 %ptr = getelementptr inbounds i8, ptr %addr, i64 %off
24 %val = load volatile <vscale x 8 x i16>, ptr %ptr
25 ret <vscale x 8 x i16> %val
28 define <vscale x 4 x i32> @ld1_nxv16i8_bitcast_to_i32(ptr %addr, i64 %off) {
29 ; CHECK-LABEL: ld1_nxv16i8_bitcast_to_i32:
31 ; CHECK-NEXT: ptrue p0.b
32 ; CHECK-NEXT: ld1b { z0.b }, p0/z, [x0, x1]
34 %ptr = getelementptr inbounds i8, ptr %addr, i64 %off
35 %val = load volatile <vscale x 4 x i32>, ptr %ptr
36 ret <vscale x 4 x i32> %val
39 define <vscale x 2 x i64> @ld1_nxv16i8_bitcast_to_i64(ptr %addr, i64 %off) {
40 ; CHECK-LABEL: ld1_nxv16i8_bitcast_to_i64:
42 ; CHECK-NEXT: ptrue p0.b
43 ; CHECK-NEXT: ld1b { z0.b }, p0/z, [x0, x1]
45 %ptr = getelementptr inbounds i8, ptr %addr, i64 %off
46 %val = load volatile <vscale x 2 x i64>, ptr %ptr
47 ret <vscale x 2 x i64> %val
50 define <vscale x 8 x i16> @ld1_nxv8i16_zext8(ptr %addr, i64 %off) {
51 ; CHECK-LABEL: ld1_nxv8i16_zext8:
53 ; CHECK-NEXT: ptrue p0.h
54 ; CHECK-NEXT: ld1b { z0.h }, p0/z, [x0, x1]
56 %ptr = getelementptr inbounds i8, ptr %addr, i64 %off
57 %val = load volatile <vscale x 8 x i8>, ptr %ptr
58 %zext = zext <vscale x 8 x i8> %val to <vscale x 8 x i16>
59 ret <vscale x 8 x i16> %zext
62 define <vscale x 4 x i32> @ld1_nxv4i32_zext8(ptr %addr, i64 %off) {
63 ; CHECK-LABEL: ld1_nxv4i32_zext8:
65 ; CHECK-NEXT: ptrue p0.s
66 ; CHECK-NEXT: ld1b { z0.s }, p0/z, [x0, x1]
68 %ptr = getelementptr inbounds i8, ptr %addr, i64 %off
69 %val = load volatile <vscale x 4 x i8>, ptr %ptr
70 %zext = zext <vscale x 4 x i8> %val to <vscale x 4 x i32>
71 ret <vscale x 4 x i32> %zext
74 define <vscale x 2 x i64> @ld1_nxv2i64_zext8(ptr %addr, i64 %off) {
75 ; CHECK-LABEL: ld1_nxv2i64_zext8:
77 ; CHECK-NEXT: ptrue p0.d
78 ; CHECK-NEXT: ld1b { z0.d }, p0/z, [x0, x1]
80 %ptr = getelementptr inbounds i8, ptr %addr, i64 %off
81 %val = load volatile <vscale x 2 x i8>, ptr %ptr
82 %zext = zext <vscale x 2 x i8> %val to <vscale x 2 x i64>
83 ret <vscale x 2 x i64> %zext
86 define <vscale x 8 x i16> @ld1_nxv8i16_sext8(ptr %addr, i64 %off) {
87 ; CHECK-LABEL: ld1_nxv8i16_sext8:
89 ; CHECK-NEXT: ptrue p0.h
90 ; CHECK-NEXT: ld1sb { z0.h }, p0/z, [x0, x1]
92 %ptr = getelementptr inbounds i8, ptr %addr, i64 %off
93 %val = load volatile <vscale x 8 x i8>, ptr %ptr
94 %sext = sext <vscale x 8 x i8> %val to <vscale x 8 x i16>
95 ret <vscale x 8 x i16> %sext
98 define <vscale x 4 x i32> @ld1_nxv4i32_sext8(ptr %addr, i64 %off) {
99 ; CHECK-LABEL: ld1_nxv4i32_sext8:
101 ; CHECK-NEXT: ptrue p0.s
102 ; CHECK-NEXT: ld1sb { z0.s }, p0/z, [x0, x1]
104 %ptr = getelementptr inbounds i8, ptr %addr, i64 %off
105 %val = load volatile <vscale x 4 x i8>, ptr %ptr
106 %sext = sext <vscale x 4 x i8> %val to <vscale x 4 x i32>
107 ret <vscale x 4 x i32> %sext
110 define <vscale x 2 x i64> @ld1_nxv2i64_sext8(ptr %addr, i64 %off) {
111 ; CHECK-LABEL: ld1_nxv2i64_sext8:
113 ; CHECK-NEXT: ptrue p0.d
114 ; CHECK-NEXT: ld1sb { z0.d }, p0/z, [x0, x1]
116 %ptr = getelementptr inbounds i8, ptr %addr, i64 %off
117 %val = load volatile <vscale x 2 x i8>, ptr %ptr
118 %sext = sext <vscale x 2 x i8> %val to <vscale x 2 x i64>
119 ret <vscale x 2 x i64> %sext
124 define <vscale x 8 x i16> @ld1_nxv8i16(ptr %addr, i64 %off) {
125 ; CHECK-LABEL: ld1_nxv8i16:
127 ; CHECK-NEXT: ptrue p0.h
128 ; CHECK-NEXT: ld1h { z0.h }, p0/z, [x0, x1, lsl #1]
130 %ptr = getelementptr inbounds i16, ptr %addr, i64 %off
131 %val = load volatile <vscale x 8 x i16>, ptr %ptr
132 ret <vscale x 8 x i16> %val
135 define <vscale x 4 x i32> @ld1_nxv4i32_zext16(ptr %addr, i64 %off) {
136 ; CHECK-LABEL: ld1_nxv4i32_zext16:
138 ; CHECK-NEXT: ptrue p0.s
139 ; CHECK-NEXT: ld1h { z0.s }, p0/z, [x0, x1, lsl #1]
141 %ptr = getelementptr inbounds i16, ptr %addr, i64 %off
142 %val = load volatile <vscale x 4 x i16>, ptr %ptr
143 %zext = zext <vscale x 4 x i16> %val to <vscale x 4 x i32>
144 ret <vscale x 4 x i32> %zext
147 define <vscale x 2 x i64> @ld1_nxv2i64_zext16(ptr %addr, i64 %off) {
148 ; CHECK-LABEL: ld1_nxv2i64_zext16:
150 ; CHECK-NEXT: ptrue p0.d
151 ; CHECK-NEXT: ld1h { z0.d }, p0/z, [x0, x1, lsl #1]
153 %ptr = getelementptr inbounds i16, ptr %addr, i64 %off
154 %val = load volatile <vscale x 2 x i16>, ptr %ptr
155 %zext = zext <vscale x 2 x i16> %val to <vscale x 2 x i64>
156 ret <vscale x 2 x i64> %zext
159 define <vscale x 4 x i32> @ld1_nxv4i32_sext16(ptr %addr, i64 %off) {
160 ; CHECK-LABEL: ld1_nxv4i32_sext16:
162 ; CHECK-NEXT: ptrue p0.s
163 ; CHECK-NEXT: ld1sh { z0.s }, p0/z, [x0, x1, lsl #1]
165 %ptr = getelementptr inbounds i16, ptr %addr, i64 %off
166 %val = load volatile <vscale x 4 x i16>, ptr %ptr
167 %sext = sext <vscale x 4 x i16> %val to <vscale x 4 x i32>
168 ret <vscale x 4 x i32> %sext
171 define <vscale x 2 x i64> @ld1_nxv2i64_sext16(ptr %addr, i64 %off) {
172 ; CHECK-LABEL: ld1_nxv2i64_sext16:
174 ; CHECK-NEXT: ptrue p0.d
175 ; CHECK-NEXT: ld1sh { z0.d }, p0/z, [x0, x1, lsl #1]
177 %ptr = getelementptr inbounds i16, ptr %addr, i64 %off
178 %val = load volatile <vscale x 2 x i16>, ptr %ptr
179 %sext = sext <vscale x 2 x i16> %val to <vscale x 2 x i64>
180 ret <vscale x 2 x i64> %sext
183 define <vscale x 8 x half> @ld1_nxv8f16(ptr %addr, i64 %off) {
184 ; CHECK-LABEL: ld1_nxv8f16:
186 ; CHECK-NEXT: ptrue p0.h
187 ; CHECK-NEXT: ld1h { z0.h }, p0/z, [x0, x1, lsl #1]
189 %ptr = getelementptr inbounds half, ptr %addr, i64 %off
190 %val = load volatile <vscale x 8 x half>, ptr %ptr
191 ret <vscale x 8 x half> %val
194 define <vscale x 8 x bfloat> @ld1_nxv8bf16(ptr %addr, i64 %off) {
195 ; CHECK-LABEL: ld1_nxv8bf16:
197 ; CHECK-NEXT: ptrue p0.h
198 ; CHECK-NEXT: ld1h { z0.h }, p0/z, [x0, x1, lsl #1]
200 %ptr = getelementptr inbounds bfloat, ptr %addr, i64 %off
201 %val = load volatile <vscale x 8 x bfloat>, ptr %ptr
202 ret <vscale x 8 x bfloat> %val
205 define <vscale x 4 x half> @ld1_nxv4f16(ptr %addr, i64 %off) {
206 ; CHECK-LABEL: ld1_nxv4f16:
208 ; CHECK-NEXT: ptrue p0.s
209 ; CHECK-NEXT: ld1h { z0.s }, p0/z, [x0, x1, lsl #1]
211 %ptr = getelementptr inbounds half, ptr %addr, i64 %off
212 %val = load volatile <vscale x 4 x half>, ptr %ptr
213 ret <vscale x 4 x half> %val
216 define <vscale x 4 x bfloat> @ld1_nxv4bf16(ptr %addr, i64 %off) {
217 ; CHECK-LABEL: ld1_nxv4bf16:
219 ; CHECK-NEXT: ptrue p0.s
220 ; CHECK-NEXT: ld1h { z0.s }, p0/z, [x0, x1, lsl #1]
222 %ptr = getelementptr inbounds bfloat, ptr %addr, i64 %off
223 %val = load volatile <vscale x 4 x bfloat>, ptr %ptr
224 ret <vscale x 4 x bfloat> %val
227 define <vscale x 2 x half> @ld1_nxv2f16(ptr %addr, i64 %off) {
228 ; CHECK-LABEL: ld1_nxv2f16:
230 ; CHECK-NEXT: ptrue p0.d
231 ; CHECK-NEXT: ld1h { z0.d }, p0/z, [x0, x1, lsl #1]
233 %ptr = getelementptr inbounds half, ptr %addr, i64 %off
234 %val = load volatile <vscale x 2 x half>, ptr %ptr
235 ret <vscale x 2 x half> %val
238 define <vscale x 2 x bfloat> @ld1_nxv2bf16(ptr %addr, i64 %off) {
239 ; CHECK-LABEL: ld1_nxv2bf16:
241 ; CHECK-NEXT: ptrue p0.d
242 ; CHECK-NEXT: ld1h { z0.d }, p0/z, [x0, x1, lsl #1]
244 %ptr = getelementptr inbounds bfloat, ptr %addr, i64 %off
245 %val = load volatile <vscale x 2 x bfloat>, ptr %ptr
246 ret <vscale x 2 x bfloat> %val
251 define <vscale x 4 x i32> @ld1_nxv4i32(ptr %addr, i64 %off) {
252 ; CHECK-LABEL: ld1_nxv4i32:
254 ; CHECK-NEXT: ptrue p0.s
255 ; CHECK-NEXT: ld1w { z0.s }, p0/z, [x0, x1, lsl #2]
257 %ptr = getelementptr inbounds i32, ptr %addr, i64 %off
258 %val = load volatile <vscale x 4 x i32>, ptr %ptr
259 ret <vscale x 4 x i32> %val
262 define <vscale x 2 x i64> @ld1_nxv2i64_zext32(ptr %addr, i64 %off) {
263 ; CHECK-LABEL: ld1_nxv2i64_zext32:
265 ; CHECK-NEXT: ptrue p0.d
266 ; CHECK-NEXT: ld1w { z0.d }, p0/z, [x0, x1, lsl #2]
268 %ptr = getelementptr inbounds i32, ptr %addr, i64 %off
269 %val = load volatile <vscale x 2 x i32>, ptr %ptr
270 %zext = zext <vscale x 2 x i32> %val to <vscale x 2 x i64>
271 ret <vscale x 2 x i64> %zext
274 define <vscale x 2 x i64> @ld1_nxv2i64_sext32(ptr %addr, i64 %off) {
275 ; CHECK-LABEL: ld1_nxv2i64_sext32:
277 ; CHECK-NEXT: ptrue p0.d
278 ; CHECK-NEXT: ld1sw { z0.d }, p0/z, [x0, x1, lsl #2]
280 %ptr = getelementptr inbounds i32, ptr %addr, i64 %off
281 %val = load volatile <vscale x 2 x i32>, ptr %ptr
282 %sext = sext <vscale x 2 x i32> %val to <vscale x 2 x i64>
283 ret <vscale x 2 x i64> %sext
286 define <vscale x 4 x float> @ld1_nxv4f32(ptr %addr, i64 %off) {
287 ; CHECK-LABEL: ld1_nxv4f32:
289 ; CHECK-NEXT: ptrue p0.s
290 ; CHECK-NEXT: ld1w { z0.s }, p0/z, [x0, x1, lsl #2]
292 %ptr = getelementptr inbounds float, ptr %addr, i64 %off
293 %val = load volatile <vscale x 4 x float>, ptr %ptr
294 ret <vscale x 4 x float> %val
297 define <vscale x 2 x float> @ld1_nxv2f32(ptr %addr, i64 %off) {
298 ; CHECK-LABEL: ld1_nxv2f32:
300 ; CHECK-NEXT: ptrue p0.d
301 ; CHECK-NEXT: ld1w { z0.d }, p0/z, [x0, x1, lsl #2]
303 %ptr = getelementptr inbounds float, ptr %addr, i64 %off
304 %val = load volatile <vscale x 2 x float>, ptr %ptr
305 ret <vscale x 2 x float> %val
310 define <vscale x 2 x i64> @ld1_nxv2i64(ptr %addr, i64 %off) {
311 ; CHECK-LABEL: ld1_nxv2i64:
313 ; CHECK-NEXT: ptrue p0.d
314 ; CHECK-NEXT: ld1d { z0.d }, p0/z, [x0, x1, lsl #3]
316 %ptr = getelementptr inbounds i64, ptr %addr, i64 %off
317 %val = load volatile <vscale x 2 x i64>, ptr %ptr
318 ret <vscale x 2 x i64> %val
321 define <vscale x 2 x double> @ld1_nxv2f64(ptr %addr, i64 %off) {
322 ; CHECK-LABEL: ld1_nxv2f64:
324 ; CHECK-NEXT: ptrue p0.d
325 ; CHECK-NEXT: ld1d { z0.d }, p0/z, [x0, x1, lsl #3]
327 %ptr = getelementptr inbounds double, ptr %addr, i64 %off
328 %val = load volatile <vscale x 2 x double>, ptr %ptr
329 ret <vscale x 2 x double> %val