1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64-linux-gnu < %s | FileCheck %s
3 ; RUN: llc -mtriple=aarch64_be < %s | FileCheck %s --check-prefix=CHECK_BE
9 define <vscale x 16 x i8> @bitcast_nxv8i16_to_nxv16i8(<vscale x 8 x i16> %v) #0 {
10 ; CHECK-LABEL: bitcast_nxv8i16_to_nxv16i8:
14 ; CHECK_BE-LABEL: bitcast_nxv8i16_to_nxv16i8:
16 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
17 ; CHECK_BE-NEXT: addvl sp, sp, #-1
18 ; CHECK_BE-NEXT: ptrue p0.h
19 ; CHECK_BE-NEXT: ptrue p1.b
20 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp]
21 ; CHECK_BE-NEXT: ld1b { z0.b }, p1/z, [sp]
22 ; CHECK_BE-NEXT: addvl sp, sp, #1
23 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
25 %bc = bitcast <vscale x 8 x i16> %v to <vscale x 16 x i8>
26 ret <vscale x 16 x i8> %bc
29 define <vscale x 16 x i8> @bitcast_nxv4i32_to_nxv16i8(<vscale x 4 x i32> %v) #0 {
30 ; CHECK-LABEL: bitcast_nxv4i32_to_nxv16i8:
34 ; CHECK_BE-LABEL: bitcast_nxv4i32_to_nxv16i8:
36 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
37 ; CHECK_BE-NEXT: addvl sp, sp, #-1
38 ; CHECK_BE-NEXT: ptrue p0.s
39 ; CHECK_BE-NEXT: ptrue p1.b
40 ; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp]
41 ; CHECK_BE-NEXT: ld1b { z0.b }, p1/z, [sp]
42 ; CHECK_BE-NEXT: addvl sp, sp, #1
43 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
45 %bc = bitcast <vscale x 4 x i32> %v to <vscale x 16 x i8>
46 ret <vscale x 16 x i8> %bc
49 define <vscale x 16 x i8> @bitcast_nxv2i64_to_nxv16i8(<vscale x 2 x i64> %v) #0 {
50 ; CHECK-LABEL: bitcast_nxv2i64_to_nxv16i8:
54 ; CHECK_BE-LABEL: bitcast_nxv2i64_to_nxv16i8:
56 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
57 ; CHECK_BE-NEXT: addvl sp, sp, #-1
58 ; CHECK_BE-NEXT: ptrue p0.d
59 ; CHECK_BE-NEXT: ptrue p1.b
60 ; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp]
61 ; CHECK_BE-NEXT: ld1b { z0.b }, p1/z, [sp]
62 ; CHECK_BE-NEXT: addvl sp, sp, #1
63 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
65 %bc = bitcast <vscale x 2 x i64> %v to <vscale x 16 x i8>
66 ret <vscale x 16 x i8> %bc
69 define <vscale x 16 x i8> @bitcast_nxv8f16_to_nxv16i8(<vscale x 8 x half> %v) #0 {
70 ; CHECK-LABEL: bitcast_nxv8f16_to_nxv16i8:
74 ; CHECK_BE-LABEL: bitcast_nxv8f16_to_nxv16i8:
76 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
77 ; CHECK_BE-NEXT: addvl sp, sp, #-1
78 ; CHECK_BE-NEXT: ptrue p0.h
79 ; CHECK_BE-NEXT: ptrue p1.b
80 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp]
81 ; CHECK_BE-NEXT: ld1b { z0.b }, p1/z, [sp]
82 ; CHECK_BE-NEXT: addvl sp, sp, #1
83 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
85 %bc = bitcast <vscale x 8 x half> %v to <vscale x 16 x i8>
86 ret <vscale x 16 x i8> %bc
89 define <vscale x 16 x i8> @bitcast_nxv4f32_to_nxv16i8(<vscale x 4 x float> %v) #0 {
90 ; CHECK-LABEL: bitcast_nxv4f32_to_nxv16i8:
94 ; CHECK_BE-LABEL: bitcast_nxv4f32_to_nxv16i8:
96 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
97 ; CHECK_BE-NEXT: addvl sp, sp, #-1
98 ; CHECK_BE-NEXT: ptrue p0.s
99 ; CHECK_BE-NEXT: ptrue p1.b
100 ; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp]
101 ; CHECK_BE-NEXT: ld1b { z0.b }, p1/z, [sp]
102 ; CHECK_BE-NEXT: addvl sp, sp, #1
103 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
105 %bc = bitcast <vscale x 4 x float> %v to <vscale x 16 x i8>
106 ret <vscale x 16 x i8> %bc
109 define <vscale x 16 x i8> @bitcast_nxv2f64_to_nxv16i8(<vscale x 2 x double> %v) #0 {
110 ; CHECK-LABEL: bitcast_nxv2f64_to_nxv16i8:
114 ; CHECK_BE-LABEL: bitcast_nxv2f64_to_nxv16i8:
115 ; CHECK_BE: // %bb.0:
116 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
117 ; CHECK_BE-NEXT: addvl sp, sp, #-1
118 ; CHECK_BE-NEXT: ptrue p0.d
119 ; CHECK_BE-NEXT: ptrue p1.b
120 ; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp]
121 ; CHECK_BE-NEXT: ld1b { z0.b }, p1/z, [sp]
122 ; CHECK_BE-NEXT: addvl sp, sp, #1
123 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
125 %bc = bitcast <vscale x 2 x double> %v to <vscale x 16 x i8>
126 ret <vscale x 16 x i8> %bc
129 define <vscale x 16 x i8> @bitcast_nxv8bf16_to_nxv16i8(<vscale x 8 x bfloat> %v) #0 {
130 ; CHECK-LABEL: bitcast_nxv8bf16_to_nxv16i8:
134 ; CHECK_BE-LABEL: bitcast_nxv8bf16_to_nxv16i8:
135 ; CHECK_BE: // %bb.0:
136 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
137 ; CHECK_BE-NEXT: addvl sp, sp, #-1
138 ; CHECK_BE-NEXT: ptrue p0.h
139 ; CHECK_BE-NEXT: ptrue p1.b
140 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp]
141 ; CHECK_BE-NEXT: ld1b { z0.b }, p1/z, [sp]
142 ; CHECK_BE-NEXT: addvl sp, sp, #1
143 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
145 %bc = bitcast <vscale x 8 x bfloat> %v to <vscale x 16 x i8>
146 ret <vscale x 16 x i8> %bc
153 define <vscale x 8 x i16> @bitcast_nxv16i8_to_nxv8i16(<vscale x 16 x i8> %v) #0 {
154 ; CHECK-LABEL: bitcast_nxv16i8_to_nxv8i16:
158 ; CHECK_BE-LABEL: bitcast_nxv16i8_to_nxv8i16:
159 ; CHECK_BE: // %bb.0:
160 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
161 ; CHECK_BE-NEXT: addvl sp, sp, #-1
162 ; CHECK_BE-NEXT: ptrue p0.b
163 ; CHECK_BE-NEXT: ptrue p1.h
164 ; CHECK_BE-NEXT: st1b { z0.b }, p0, [sp]
165 ; CHECK_BE-NEXT: ld1h { z0.h }, p1/z, [sp]
166 ; CHECK_BE-NEXT: addvl sp, sp, #1
167 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
169 %bc = bitcast <vscale x 16 x i8> %v to <vscale x 8 x i16>
170 ret <vscale x 8 x i16> %bc
173 define <vscale x 8 x i16> @bitcast_nxv4i32_to_nxv8i16(<vscale x 4 x i32> %v) #0 {
174 ; CHECK-LABEL: bitcast_nxv4i32_to_nxv8i16:
178 ; CHECK_BE-LABEL: bitcast_nxv4i32_to_nxv8i16:
179 ; CHECK_BE: // %bb.0:
180 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
181 ; CHECK_BE-NEXT: addvl sp, sp, #-1
182 ; CHECK_BE-NEXT: ptrue p0.s
183 ; CHECK_BE-NEXT: ptrue p1.h
184 ; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp]
185 ; CHECK_BE-NEXT: ld1h { z0.h }, p1/z, [sp]
186 ; CHECK_BE-NEXT: addvl sp, sp, #1
187 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
189 %bc = bitcast <vscale x 4 x i32> %v to <vscale x 8 x i16>
190 ret <vscale x 8 x i16> %bc
193 define <vscale x 8 x i16> @bitcast_nxv2i64_to_nxv8i16(<vscale x 2 x i64> %v) #0 {
194 ; CHECK-LABEL: bitcast_nxv2i64_to_nxv8i16:
198 ; CHECK_BE-LABEL: bitcast_nxv2i64_to_nxv8i16:
199 ; CHECK_BE: // %bb.0:
200 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
201 ; CHECK_BE-NEXT: addvl sp, sp, #-1
202 ; CHECK_BE-NEXT: ptrue p0.d
203 ; CHECK_BE-NEXT: ptrue p1.h
204 ; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp]
205 ; CHECK_BE-NEXT: ld1h { z0.h }, p1/z, [sp]
206 ; CHECK_BE-NEXT: addvl sp, sp, #1
207 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
209 %bc = bitcast <vscale x 2 x i64> %v to <vscale x 8 x i16>
210 ret <vscale x 8 x i16> %bc
213 define <vscale x 8 x i16> @bitcast_nxv8f16_to_nxv8i16(<vscale x 8 x half> %v) #0 {
214 ; CHECK-LABEL: bitcast_nxv8f16_to_nxv8i16:
218 ; CHECK_BE-LABEL: bitcast_nxv8f16_to_nxv8i16:
219 ; CHECK_BE: // %bb.0:
220 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
221 ; CHECK_BE-NEXT: addvl sp, sp, #-1
222 ; CHECK_BE-NEXT: ptrue p0.h
223 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp]
224 ; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp]
225 ; CHECK_BE-NEXT: addvl sp, sp, #1
226 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
228 %bc = bitcast <vscale x 8 x half> %v to <vscale x 8 x i16>
229 ret <vscale x 8 x i16> %bc
232 define <vscale x 8 x i16> @bitcast_nxv4f32_to_nxv8i16(<vscale x 4 x float> %v) #0 {
233 ; CHECK-LABEL: bitcast_nxv4f32_to_nxv8i16:
237 ; CHECK_BE-LABEL: bitcast_nxv4f32_to_nxv8i16:
238 ; CHECK_BE: // %bb.0:
239 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
240 ; CHECK_BE-NEXT: addvl sp, sp, #-1
241 ; CHECK_BE-NEXT: ptrue p0.s
242 ; CHECK_BE-NEXT: ptrue p1.h
243 ; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp]
244 ; CHECK_BE-NEXT: ld1h { z0.h }, p1/z, [sp]
245 ; CHECK_BE-NEXT: addvl sp, sp, #1
246 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
248 %bc = bitcast <vscale x 4 x float> %v to <vscale x 8 x i16>
249 ret <vscale x 8 x i16> %bc
252 define <vscale x 8 x i16> @bitcast_nxv2f64_to_nxv8i16(<vscale x 2 x double> %v) #0 {
253 ; CHECK-LABEL: bitcast_nxv2f64_to_nxv8i16:
257 ; CHECK_BE-LABEL: bitcast_nxv2f64_to_nxv8i16:
258 ; CHECK_BE: // %bb.0:
259 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
260 ; CHECK_BE-NEXT: addvl sp, sp, #-1
261 ; CHECK_BE-NEXT: ptrue p0.d
262 ; CHECK_BE-NEXT: ptrue p1.h
263 ; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp]
264 ; CHECK_BE-NEXT: ld1h { z0.h }, p1/z, [sp]
265 ; CHECK_BE-NEXT: addvl sp, sp, #1
266 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
268 %bc = bitcast <vscale x 2 x double> %v to <vscale x 8 x i16>
269 ret <vscale x 8 x i16> %bc
272 define <vscale x 8 x i16> @bitcast_nxv8bf16_to_nxv8i16(<vscale x 8 x bfloat> %v) #0 {
273 ; CHECK-LABEL: bitcast_nxv8bf16_to_nxv8i16:
277 ; CHECK_BE-LABEL: bitcast_nxv8bf16_to_nxv8i16:
278 ; CHECK_BE: // %bb.0:
279 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
280 ; CHECK_BE-NEXT: addvl sp, sp, #-1
281 ; CHECK_BE-NEXT: ptrue p0.h
282 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp]
283 ; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp]
284 ; CHECK_BE-NEXT: addvl sp, sp, #1
285 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
287 %bc = bitcast <vscale x 8 x bfloat> %v to <vscale x 8 x i16>
288 ret <vscale x 8 x i16> %bc
295 define <vscale x 4 x i32> @bitcast_nxv16i8_to_nxv4i32(<vscale x 16 x i8> %v) #0 {
296 ; CHECK-LABEL: bitcast_nxv16i8_to_nxv4i32:
300 ; CHECK_BE-LABEL: bitcast_nxv16i8_to_nxv4i32:
301 ; CHECK_BE: // %bb.0:
302 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
303 ; CHECK_BE-NEXT: addvl sp, sp, #-1
304 ; CHECK_BE-NEXT: ptrue p0.b
305 ; CHECK_BE-NEXT: ptrue p1.s
306 ; CHECK_BE-NEXT: st1b { z0.b }, p0, [sp]
307 ; CHECK_BE-NEXT: ld1w { z0.s }, p1/z, [sp]
308 ; CHECK_BE-NEXT: addvl sp, sp, #1
309 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
311 %bc = bitcast <vscale x 16 x i8> %v to <vscale x 4 x i32>
312 ret <vscale x 4 x i32> %bc
315 define <vscale x 4 x i32> @bitcast_nxv8i16_to_nxv4i32(<vscale x 8 x i16> %v) #0 {
316 ; CHECK-LABEL: bitcast_nxv8i16_to_nxv4i32:
320 ; CHECK_BE-LABEL: bitcast_nxv8i16_to_nxv4i32:
321 ; CHECK_BE: // %bb.0:
322 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
323 ; CHECK_BE-NEXT: addvl sp, sp, #-1
324 ; CHECK_BE-NEXT: ptrue p0.h
325 ; CHECK_BE-NEXT: ptrue p1.s
326 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp]
327 ; CHECK_BE-NEXT: ld1w { z0.s }, p1/z, [sp]
328 ; CHECK_BE-NEXT: addvl sp, sp, #1
329 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
331 %bc = bitcast <vscale x 8 x i16> %v to <vscale x 4 x i32>
332 ret <vscale x 4 x i32> %bc
335 define <vscale x 4 x i32> @bitcast_nxv2i64_to_nxv4i32(<vscale x 2 x i64> %v) #0 {
336 ; CHECK-LABEL: bitcast_nxv2i64_to_nxv4i32:
340 ; CHECK_BE-LABEL: bitcast_nxv2i64_to_nxv4i32:
341 ; CHECK_BE: // %bb.0:
342 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
343 ; CHECK_BE-NEXT: addvl sp, sp, #-1
344 ; CHECK_BE-NEXT: ptrue p0.d
345 ; CHECK_BE-NEXT: ptrue p1.s
346 ; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp]
347 ; CHECK_BE-NEXT: ld1w { z0.s }, p1/z, [sp]
348 ; CHECK_BE-NEXT: addvl sp, sp, #1
349 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
351 %bc = bitcast <vscale x 2 x i64> %v to <vscale x 4 x i32>
352 ret <vscale x 4 x i32> %bc
355 define <vscale x 4 x i32> @bitcast_nxv8f16_to_nxv4i32(<vscale x 8 x half> %v) #0 {
356 ; CHECK-LABEL: bitcast_nxv8f16_to_nxv4i32:
360 ; CHECK_BE-LABEL: bitcast_nxv8f16_to_nxv4i32:
361 ; CHECK_BE: // %bb.0:
362 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
363 ; CHECK_BE-NEXT: addvl sp, sp, #-1
364 ; CHECK_BE-NEXT: ptrue p0.h
365 ; CHECK_BE-NEXT: ptrue p1.s
366 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp]
367 ; CHECK_BE-NEXT: ld1w { z0.s }, p1/z, [sp]
368 ; CHECK_BE-NEXT: addvl sp, sp, #1
369 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
371 %bc = bitcast <vscale x 8 x half> %v to <vscale x 4 x i32>
372 ret <vscale x 4 x i32> %bc
375 define <vscale x 4 x i32> @bitcast_nxv4f32_to_nxv4i32(<vscale x 4 x float> %v) #0 {
376 ; CHECK-LABEL: bitcast_nxv4f32_to_nxv4i32:
380 ; CHECK_BE-LABEL: bitcast_nxv4f32_to_nxv4i32:
381 ; CHECK_BE: // %bb.0:
382 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
383 ; CHECK_BE-NEXT: addvl sp, sp, #-1
384 ; CHECK_BE-NEXT: ptrue p0.s
385 ; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp]
386 ; CHECK_BE-NEXT: ld1w { z0.s }, p0/z, [sp]
387 ; CHECK_BE-NEXT: addvl sp, sp, #1
388 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
390 %bc = bitcast <vscale x 4 x float> %v to <vscale x 4 x i32>
391 ret <vscale x 4 x i32> %bc
394 define <vscale x 4 x i32> @bitcast_nxv2f64_to_nxv4i32(<vscale x 2 x double> %v) #0 {
395 ; CHECK-LABEL: bitcast_nxv2f64_to_nxv4i32:
399 ; CHECK_BE-LABEL: bitcast_nxv2f64_to_nxv4i32:
400 ; CHECK_BE: // %bb.0:
401 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
402 ; CHECK_BE-NEXT: addvl sp, sp, #-1
403 ; CHECK_BE-NEXT: ptrue p0.d
404 ; CHECK_BE-NEXT: ptrue p1.s
405 ; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp]
406 ; CHECK_BE-NEXT: ld1w { z0.s }, p1/z, [sp]
407 ; CHECK_BE-NEXT: addvl sp, sp, #1
408 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
410 %bc = bitcast <vscale x 2 x double> %v to <vscale x 4 x i32>
411 ret <vscale x 4 x i32> %bc
414 define <vscale x 4 x i32> @bitcast_nxv8bf16_to_nxv4i32(<vscale x 8 x bfloat> %v) #0 {
415 ; CHECK-LABEL: bitcast_nxv8bf16_to_nxv4i32:
419 ; CHECK_BE-LABEL: bitcast_nxv8bf16_to_nxv4i32:
420 ; CHECK_BE: // %bb.0:
421 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
422 ; CHECK_BE-NEXT: addvl sp, sp, #-1
423 ; CHECK_BE-NEXT: ptrue p0.h
424 ; CHECK_BE-NEXT: ptrue p1.s
425 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp]
426 ; CHECK_BE-NEXT: ld1w { z0.s }, p1/z, [sp]
427 ; CHECK_BE-NEXT: addvl sp, sp, #1
428 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
430 %bc = bitcast <vscale x 8 x bfloat> %v to <vscale x 4 x i32>
431 ret <vscale x 4 x i32> %bc
438 define <vscale x 2 x i64> @bitcast_nxv16i8_to_nxv2i64(<vscale x 16 x i8> %v) #0 {
439 ; CHECK-LABEL: bitcast_nxv16i8_to_nxv2i64:
443 ; CHECK_BE-LABEL: bitcast_nxv16i8_to_nxv2i64:
444 ; CHECK_BE: // %bb.0:
445 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
446 ; CHECK_BE-NEXT: addvl sp, sp, #-1
447 ; CHECK_BE-NEXT: ptrue p0.b
448 ; CHECK_BE-NEXT: ptrue p1.d
449 ; CHECK_BE-NEXT: st1b { z0.b }, p0, [sp]
450 ; CHECK_BE-NEXT: ld1d { z0.d }, p1/z, [sp]
451 ; CHECK_BE-NEXT: addvl sp, sp, #1
452 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
454 %bc = bitcast <vscale x 16 x i8> %v to <vscale x 2 x i64>
455 ret <vscale x 2 x i64> %bc
458 define <vscale x 2 x i64> @bitcast_nxv8i16_to_nxv2i64(<vscale x 8 x i16> %v) #0 {
459 ; CHECK-LABEL: bitcast_nxv8i16_to_nxv2i64:
463 ; CHECK_BE-LABEL: bitcast_nxv8i16_to_nxv2i64:
464 ; CHECK_BE: // %bb.0:
465 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
466 ; CHECK_BE-NEXT: addvl sp, sp, #-1
467 ; CHECK_BE-NEXT: ptrue p0.h
468 ; CHECK_BE-NEXT: ptrue p1.d
469 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp]
470 ; CHECK_BE-NEXT: ld1d { z0.d }, p1/z, [sp]
471 ; CHECK_BE-NEXT: addvl sp, sp, #1
472 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
474 %bc = bitcast <vscale x 8 x i16> %v to <vscale x 2 x i64>
475 ret <vscale x 2 x i64> %bc
478 define <vscale x 2 x i64> @bitcast_nxv4i32_to_nxv2i64(<vscale x 4 x i32> %v) #0 {
479 ; CHECK-LABEL: bitcast_nxv4i32_to_nxv2i64:
483 ; CHECK_BE-LABEL: bitcast_nxv4i32_to_nxv2i64:
484 ; CHECK_BE: // %bb.0:
485 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
486 ; CHECK_BE-NEXT: addvl sp, sp, #-1
487 ; CHECK_BE-NEXT: ptrue p0.s
488 ; CHECK_BE-NEXT: ptrue p1.d
489 ; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp]
490 ; CHECK_BE-NEXT: ld1d { z0.d }, p1/z, [sp]
491 ; CHECK_BE-NEXT: addvl sp, sp, #1
492 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
494 %bc = bitcast <vscale x 4 x i32> %v to <vscale x 2 x i64>
495 ret <vscale x 2 x i64> %bc
498 define <vscale x 2 x i64> @bitcast_nxv8f16_to_nxv2i64(<vscale x 8 x half> %v) #0 {
499 ; CHECK-LABEL: bitcast_nxv8f16_to_nxv2i64:
503 ; CHECK_BE-LABEL: bitcast_nxv8f16_to_nxv2i64:
504 ; CHECK_BE: // %bb.0:
505 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
506 ; CHECK_BE-NEXT: addvl sp, sp, #-1
507 ; CHECK_BE-NEXT: ptrue p0.h
508 ; CHECK_BE-NEXT: ptrue p1.d
509 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp]
510 ; CHECK_BE-NEXT: ld1d { z0.d }, p1/z, [sp]
511 ; CHECK_BE-NEXT: addvl sp, sp, #1
512 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
514 %bc = bitcast <vscale x 8 x half> %v to <vscale x 2 x i64>
515 ret <vscale x 2 x i64> %bc
518 define <vscale x 2 x i64> @bitcast_nxv4f32_to_nxv2i64(<vscale x 4 x float> %v) #0 {
519 ; CHECK-LABEL: bitcast_nxv4f32_to_nxv2i64:
523 ; CHECK_BE-LABEL: bitcast_nxv4f32_to_nxv2i64:
524 ; CHECK_BE: // %bb.0:
525 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
526 ; CHECK_BE-NEXT: addvl sp, sp, #-1
527 ; CHECK_BE-NEXT: ptrue p0.s
528 ; CHECK_BE-NEXT: ptrue p1.d
529 ; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp]
530 ; CHECK_BE-NEXT: ld1d { z0.d }, p1/z, [sp]
531 ; CHECK_BE-NEXT: addvl sp, sp, #1
532 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
534 %bc = bitcast <vscale x 4 x float> %v to <vscale x 2 x i64>
535 ret <vscale x 2 x i64> %bc
538 define <vscale x 2 x i64> @bitcast_nxv2f64_to_nxv2i64(<vscale x 2 x double> %v) #0 {
539 ; CHECK-LABEL: bitcast_nxv2f64_to_nxv2i64:
543 ; CHECK_BE-LABEL: bitcast_nxv2f64_to_nxv2i64:
544 ; CHECK_BE: // %bb.0:
545 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
546 ; CHECK_BE-NEXT: addvl sp, sp, #-1
547 ; CHECK_BE-NEXT: ptrue p0.d
548 ; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp]
549 ; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp]
550 ; CHECK_BE-NEXT: addvl sp, sp, #1
551 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
553 %bc = bitcast <vscale x 2 x double> %v to <vscale x 2 x i64>
554 ret <vscale x 2 x i64> %bc
557 define <vscale x 2 x i64> @bitcast_nxv8bf16_to_nxv2i64(<vscale x 8 x bfloat> %v) #0 {
558 ; CHECK-LABEL: bitcast_nxv8bf16_to_nxv2i64:
562 ; CHECK_BE-LABEL: bitcast_nxv8bf16_to_nxv2i64:
563 ; CHECK_BE: // %bb.0:
564 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
565 ; CHECK_BE-NEXT: addvl sp, sp, #-1
566 ; CHECK_BE-NEXT: ptrue p0.h
567 ; CHECK_BE-NEXT: ptrue p1.d
568 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp]
569 ; CHECK_BE-NEXT: ld1d { z0.d }, p1/z, [sp]
570 ; CHECK_BE-NEXT: addvl sp, sp, #1
571 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
573 %bc = bitcast <vscale x 8 x bfloat> %v to <vscale x 2 x i64>
574 ret <vscale x 2 x i64> %bc
581 define <vscale x 8 x half> @bitcast_nxv16i8_to_nxv8f16(<vscale x 16 x i8> %v) #0 {
582 ; CHECK-LABEL: bitcast_nxv16i8_to_nxv8f16:
586 ; CHECK_BE-LABEL: bitcast_nxv16i8_to_nxv8f16:
587 ; CHECK_BE: // %bb.0:
588 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
589 ; CHECK_BE-NEXT: addvl sp, sp, #-1
590 ; CHECK_BE-NEXT: ptrue p0.b
591 ; CHECK_BE-NEXT: ptrue p1.h
592 ; CHECK_BE-NEXT: st1b { z0.b }, p0, [sp]
593 ; CHECK_BE-NEXT: ld1h { z0.h }, p1/z, [sp]
594 ; CHECK_BE-NEXT: addvl sp, sp, #1
595 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
597 %bc = bitcast <vscale x 16 x i8> %v to <vscale x 8 x half>
598 ret <vscale x 8 x half> %bc
601 define <vscale x 8 x half> @bitcast_nxv8i16_to_nxv8f16(<vscale x 8 x i16> %v) #0 {
602 ; CHECK-LABEL: bitcast_nxv8i16_to_nxv8f16:
606 ; CHECK_BE-LABEL: bitcast_nxv8i16_to_nxv8f16:
607 ; CHECK_BE: // %bb.0:
608 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
609 ; CHECK_BE-NEXT: addvl sp, sp, #-1
610 ; CHECK_BE-NEXT: ptrue p0.h
611 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp]
612 ; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp]
613 ; CHECK_BE-NEXT: addvl sp, sp, #1
614 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
616 %bc = bitcast <vscale x 8 x i16> %v to <vscale x 8 x half>
617 ret <vscale x 8 x half> %bc
620 define <vscale x 8 x half> @bitcast_nxv4i32_to_nxv8f16(<vscale x 4 x i32> %v) #0 {
621 ; CHECK-LABEL: bitcast_nxv4i32_to_nxv8f16:
625 ; CHECK_BE-LABEL: bitcast_nxv4i32_to_nxv8f16:
626 ; CHECK_BE: // %bb.0:
627 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
628 ; CHECK_BE-NEXT: addvl sp, sp, #-1
629 ; CHECK_BE-NEXT: ptrue p0.s
630 ; CHECK_BE-NEXT: ptrue p1.h
631 ; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp]
632 ; CHECK_BE-NEXT: ld1h { z0.h }, p1/z, [sp]
633 ; CHECK_BE-NEXT: addvl sp, sp, #1
634 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
636 %bc = bitcast <vscale x 4 x i32> %v to <vscale x 8 x half>
637 ret <vscale x 8 x half> %bc
640 define <vscale x 8 x half> @bitcast_nxv2i64_to_nxv8f16(<vscale x 2 x i64> %v) #0 {
641 ; CHECK-LABEL: bitcast_nxv2i64_to_nxv8f16:
645 ; CHECK_BE-LABEL: bitcast_nxv2i64_to_nxv8f16:
646 ; CHECK_BE: // %bb.0:
647 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
648 ; CHECK_BE-NEXT: addvl sp, sp, #-1
649 ; CHECK_BE-NEXT: ptrue p0.d
650 ; CHECK_BE-NEXT: ptrue p1.h
651 ; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp]
652 ; CHECK_BE-NEXT: ld1h { z0.h }, p1/z, [sp]
653 ; CHECK_BE-NEXT: addvl sp, sp, #1
654 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
656 %bc = bitcast <vscale x 2 x i64> %v to <vscale x 8 x half>
657 ret <vscale x 8 x half> %bc
660 define <vscale x 8 x half> @bitcast_nxv4f32_to_nxv8f16(<vscale x 4 x float> %v) #0 {
661 ; CHECK-LABEL: bitcast_nxv4f32_to_nxv8f16:
665 ; CHECK_BE-LABEL: bitcast_nxv4f32_to_nxv8f16:
666 ; CHECK_BE: // %bb.0:
667 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
668 ; CHECK_BE-NEXT: addvl sp, sp, #-1
669 ; CHECK_BE-NEXT: ptrue p0.s
670 ; CHECK_BE-NEXT: ptrue p1.h
671 ; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp]
672 ; CHECK_BE-NEXT: ld1h { z0.h }, p1/z, [sp]
673 ; CHECK_BE-NEXT: addvl sp, sp, #1
674 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
676 %bc = bitcast <vscale x 4 x float> %v to <vscale x 8 x half>
677 ret <vscale x 8 x half> %bc
680 define <vscale x 8 x half> @bitcast_nxv2f64_to_nxv8f16(<vscale x 2 x double> %v) #0 {
681 ; CHECK-LABEL: bitcast_nxv2f64_to_nxv8f16:
685 ; CHECK_BE-LABEL: bitcast_nxv2f64_to_nxv8f16:
686 ; CHECK_BE: // %bb.0:
687 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
688 ; CHECK_BE-NEXT: addvl sp, sp, #-1
689 ; CHECK_BE-NEXT: ptrue p0.d
690 ; CHECK_BE-NEXT: ptrue p1.h
691 ; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp]
692 ; CHECK_BE-NEXT: ld1h { z0.h }, p1/z, [sp]
693 ; CHECK_BE-NEXT: addvl sp, sp, #1
694 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
696 %bc = bitcast <vscale x 2 x double> %v to <vscale x 8 x half>
697 ret <vscale x 8 x half> %bc
700 define <vscale x 8 x half> @bitcast_nxv8bf16_to_nxv8f16(<vscale x 8 x bfloat> %v) #0 {
701 ; CHECK-LABEL: bitcast_nxv8bf16_to_nxv8f16:
705 ; CHECK_BE-LABEL: bitcast_nxv8bf16_to_nxv8f16:
706 ; CHECK_BE: // %bb.0:
707 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
708 ; CHECK_BE-NEXT: addvl sp, sp, #-1
709 ; CHECK_BE-NEXT: ptrue p0.h
710 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp]
711 ; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp]
712 ; CHECK_BE-NEXT: addvl sp, sp, #1
713 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
715 %bc = bitcast <vscale x 8 x bfloat> %v to <vscale x 8 x half>
716 ret <vscale x 8 x half> %bc
723 define <vscale x 4 x float> @bitcast_nxv16i8_to_nxv4f32(<vscale x 16 x i8> %v) #0 {
724 ; CHECK-LABEL: bitcast_nxv16i8_to_nxv4f32:
728 ; CHECK_BE-LABEL: bitcast_nxv16i8_to_nxv4f32:
729 ; CHECK_BE: // %bb.0:
730 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
731 ; CHECK_BE-NEXT: addvl sp, sp, #-1
732 ; CHECK_BE-NEXT: ptrue p0.b
733 ; CHECK_BE-NEXT: ptrue p1.s
734 ; CHECK_BE-NEXT: st1b { z0.b }, p0, [sp]
735 ; CHECK_BE-NEXT: ld1w { z0.s }, p1/z, [sp]
736 ; CHECK_BE-NEXT: addvl sp, sp, #1
737 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
739 %bc = bitcast <vscale x 16 x i8> %v to <vscale x 4 x float>
740 ret <vscale x 4 x float> %bc
743 define <vscale x 4 x float> @bitcast_nxv8i16_to_nxv4f32(<vscale x 8 x i16> %v) #0 {
744 ; CHECK-LABEL: bitcast_nxv8i16_to_nxv4f32:
748 ; CHECK_BE-LABEL: bitcast_nxv8i16_to_nxv4f32:
749 ; CHECK_BE: // %bb.0:
750 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
751 ; CHECK_BE-NEXT: addvl sp, sp, #-1
752 ; CHECK_BE-NEXT: ptrue p0.h
753 ; CHECK_BE-NEXT: ptrue p1.s
754 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp]
755 ; CHECK_BE-NEXT: ld1w { z0.s }, p1/z, [sp]
756 ; CHECK_BE-NEXT: addvl sp, sp, #1
757 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
759 %bc = bitcast <vscale x 8 x i16> %v to <vscale x 4 x float>
760 ret <vscale x 4 x float> %bc
763 define <vscale x 4 x float> @bitcast_nxv4i32_to_nxv4f32(<vscale x 4 x i32> %v) #0 {
764 ; CHECK-LABEL: bitcast_nxv4i32_to_nxv4f32:
768 ; CHECK_BE-LABEL: bitcast_nxv4i32_to_nxv4f32:
769 ; CHECK_BE: // %bb.0:
770 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
771 ; CHECK_BE-NEXT: addvl sp, sp, #-1
772 ; CHECK_BE-NEXT: ptrue p0.s
773 ; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp]
774 ; CHECK_BE-NEXT: ld1w { z0.s }, p0/z, [sp]
775 ; CHECK_BE-NEXT: addvl sp, sp, #1
776 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
778 %bc = bitcast <vscale x 4 x i32> %v to <vscale x 4 x float>
779 ret <vscale x 4 x float> %bc
782 define <vscale x 4 x float> @bitcast_nxv2i64_to_nxv4f32(<vscale x 2 x i64> %v) #0 {
783 ; CHECK-LABEL: bitcast_nxv2i64_to_nxv4f32:
787 ; CHECK_BE-LABEL: bitcast_nxv2i64_to_nxv4f32:
788 ; CHECK_BE: // %bb.0:
789 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
790 ; CHECK_BE-NEXT: addvl sp, sp, #-1
791 ; CHECK_BE-NEXT: ptrue p0.d
792 ; CHECK_BE-NEXT: ptrue p1.s
793 ; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp]
794 ; CHECK_BE-NEXT: ld1w { z0.s }, p1/z, [sp]
795 ; CHECK_BE-NEXT: addvl sp, sp, #1
796 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
798 %bc = bitcast <vscale x 2 x i64> %v to <vscale x 4 x float>
799 ret <vscale x 4 x float> %bc
802 define <vscale x 4 x float> @bitcast_nxv8f16_to_nxv4f32(<vscale x 8 x half> %v) #0 {
803 ; CHECK-LABEL: bitcast_nxv8f16_to_nxv4f32:
807 ; CHECK_BE-LABEL: bitcast_nxv8f16_to_nxv4f32:
808 ; CHECK_BE: // %bb.0:
809 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
810 ; CHECK_BE-NEXT: addvl sp, sp, #-1
811 ; CHECK_BE-NEXT: ptrue p0.h
812 ; CHECK_BE-NEXT: ptrue p1.s
813 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp]
814 ; CHECK_BE-NEXT: ld1w { z0.s }, p1/z, [sp]
815 ; CHECK_BE-NEXT: addvl sp, sp, #1
816 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
818 %bc = bitcast <vscale x 8 x half> %v to <vscale x 4 x float>
819 ret <vscale x 4 x float> %bc
822 define <vscale x 4 x float> @bitcast_nxv2f64_to_nxv4f32(<vscale x 2 x double> %v) #0 {
823 ; CHECK-LABEL: bitcast_nxv2f64_to_nxv4f32:
827 ; CHECK_BE-LABEL: bitcast_nxv2f64_to_nxv4f32:
828 ; CHECK_BE: // %bb.0:
829 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
830 ; CHECK_BE-NEXT: addvl sp, sp, #-1
831 ; CHECK_BE-NEXT: ptrue p0.d
832 ; CHECK_BE-NEXT: ptrue p1.s
833 ; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp]
834 ; CHECK_BE-NEXT: ld1w { z0.s }, p1/z, [sp]
835 ; CHECK_BE-NEXT: addvl sp, sp, #1
836 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
838 %bc = bitcast <vscale x 2 x double> %v to <vscale x 4 x float>
839 ret <vscale x 4 x float> %bc
842 define <vscale x 4 x float> @bitcast_nxv8bf16_to_nxv4f32(<vscale x 8 x bfloat> %v) #0 {
843 ; CHECK-LABEL: bitcast_nxv8bf16_to_nxv4f32:
847 ; CHECK_BE-LABEL: bitcast_nxv8bf16_to_nxv4f32:
848 ; CHECK_BE: // %bb.0:
849 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
850 ; CHECK_BE-NEXT: addvl sp, sp, #-1
851 ; CHECK_BE-NEXT: ptrue p0.h
852 ; CHECK_BE-NEXT: ptrue p1.s
853 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp]
854 ; CHECK_BE-NEXT: ld1w { z0.s }, p1/z, [sp]
855 ; CHECK_BE-NEXT: addvl sp, sp, #1
856 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
858 %bc = bitcast <vscale x 8 x bfloat> %v to <vscale x 4 x float>
859 ret <vscale x 4 x float> %bc
866 define <vscale x 2 x double> @bitcast_nxv16i8_to_nxv2f64(<vscale x 16 x i8> %v) #0 {
867 ; CHECK-LABEL: bitcast_nxv16i8_to_nxv2f64:
871 ; CHECK_BE-LABEL: bitcast_nxv16i8_to_nxv2f64:
872 ; CHECK_BE: // %bb.0:
873 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
874 ; CHECK_BE-NEXT: addvl sp, sp, #-1
875 ; CHECK_BE-NEXT: ptrue p0.b
876 ; CHECK_BE-NEXT: ptrue p1.d
877 ; CHECK_BE-NEXT: st1b { z0.b }, p0, [sp]
878 ; CHECK_BE-NEXT: ld1d { z0.d }, p1/z, [sp]
879 ; CHECK_BE-NEXT: addvl sp, sp, #1
880 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
882 %bc = bitcast <vscale x 16 x i8> %v to <vscale x 2 x double>
883 ret <vscale x 2 x double> %bc
886 define <vscale x 2 x double> @bitcast_nxv8i16_to_nxv2f64(<vscale x 8 x i16> %v) #0 {
887 ; CHECK-LABEL: bitcast_nxv8i16_to_nxv2f64:
891 ; CHECK_BE-LABEL: bitcast_nxv8i16_to_nxv2f64:
892 ; CHECK_BE: // %bb.0:
893 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
894 ; CHECK_BE-NEXT: addvl sp, sp, #-1
895 ; CHECK_BE-NEXT: ptrue p0.h
896 ; CHECK_BE-NEXT: ptrue p1.d
897 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp]
898 ; CHECK_BE-NEXT: ld1d { z0.d }, p1/z, [sp]
899 ; CHECK_BE-NEXT: addvl sp, sp, #1
900 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
902 %bc = bitcast <vscale x 8 x i16> %v to <vscale x 2 x double>
903 ret <vscale x 2 x double> %bc
906 define <vscale x 2 x double> @bitcast_nxv4i32_to_nxv2f64(<vscale x 4 x i32> %v) #0 {
907 ; CHECK-LABEL: bitcast_nxv4i32_to_nxv2f64:
911 ; CHECK_BE-LABEL: bitcast_nxv4i32_to_nxv2f64:
912 ; CHECK_BE: // %bb.0:
913 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
914 ; CHECK_BE-NEXT: addvl sp, sp, #-1
915 ; CHECK_BE-NEXT: ptrue p0.s
916 ; CHECK_BE-NEXT: ptrue p1.d
917 ; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp]
918 ; CHECK_BE-NEXT: ld1d { z0.d }, p1/z, [sp]
919 ; CHECK_BE-NEXT: addvl sp, sp, #1
920 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
922 %bc = bitcast <vscale x 4 x i32> %v to <vscale x 2 x double>
923 ret <vscale x 2 x double> %bc
926 define <vscale x 2 x double> @bitcast_nxv2i64_to_nxv2f64(<vscale x 2 x i64> %v) #0 {
927 ; CHECK-LABEL: bitcast_nxv2i64_to_nxv2f64:
931 ; CHECK_BE-LABEL: bitcast_nxv2i64_to_nxv2f64:
932 ; CHECK_BE: // %bb.0:
933 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
934 ; CHECK_BE-NEXT: addvl sp, sp, #-1
935 ; CHECK_BE-NEXT: ptrue p0.d
936 ; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp]
937 ; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp]
938 ; CHECK_BE-NEXT: addvl sp, sp, #1
939 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
941 %bc = bitcast <vscale x 2 x i64> %v to <vscale x 2 x double>
942 ret <vscale x 2 x double> %bc
945 define <vscale x 2 x double> @bitcast_nxv8f16_to_nxv2f64(<vscale x 8 x half> %v) #0 {
946 ; CHECK-LABEL: bitcast_nxv8f16_to_nxv2f64:
950 ; CHECK_BE-LABEL: bitcast_nxv8f16_to_nxv2f64:
951 ; CHECK_BE: // %bb.0:
952 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
953 ; CHECK_BE-NEXT: addvl sp, sp, #-1
954 ; CHECK_BE-NEXT: ptrue p0.h
955 ; CHECK_BE-NEXT: ptrue p1.d
956 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp]
957 ; CHECK_BE-NEXT: ld1d { z0.d }, p1/z, [sp]
958 ; CHECK_BE-NEXT: addvl sp, sp, #1
959 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
961 %bc = bitcast <vscale x 8 x half> %v to <vscale x 2 x double>
962 ret <vscale x 2 x double> %bc
965 define <vscale x 2 x double> @bitcast_nxv4f32_to_nxv2f64(<vscale x 4 x float> %v) #0 {
966 ; CHECK-LABEL: bitcast_nxv4f32_to_nxv2f64:
970 ; CHECK_BE-LABEL: bitcast_nxv4f32_to_nxv2f64:
971 ; CHECK_BE: // %bb.0:
972 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
973 ; CHECK_BE-NEXT: addvl sp, sp, #-1
974 ; CHECK_BE-NEXT: ptrue p0.s
975 ; CHECK_BE-NEXT: ptrue p1.d
976 ; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp]
977 ; CHECK_BE-NEXT: ld1d { z0.d }, p1/z, [sp]
978 ; CHECK_BE-NEXT: addvl sp, sp, #1
979 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
981 %bc = bitcast <vscale x 4 x float> %v to <vscale x 2 x double>
982 ret <vscale x 2 x double> %bc
985 define <vscale x 2 x double> @bitcast_nxv8bf16_to_nxv2f64(<vscale x 8 x bfloat> %v) #0 {
986 ; CHECK-LABEL: bitcast_nxv8bf16_to_nxv2f64:
990 ; CHECK_BE-LABEL: bitcast_nxv8bf16_to_nxv2f64:
991 ; CHECK_BE: // %bb.0:
992 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
993 ; CHECK_BE-NEXT: addvl sp, sp, #-1
994 ; CHECK_BE-NEXT: ptrue p0.h
995 ; CHECK_BE-NEXT: ptrue p1.d
996 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp]
997 ; CHECK_BE-NEXT: ld1d { z0.d }, p1/z, [sp]
998 ; CHECK_BE-NEXT: addvl sp, sp, #1
999 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1000 ; CHECK_BE-NEXT: ret
1001 %bc = bitcast <vscale x 8 x bfloat> %v to <vscale x 2 x double>
1002 ret <vscale x 2 x double> %bc
1006 ; bitcast to nxv8bf16
1009 define <vscale x 8 x bfloat> @bitcast_nxv16i8_to_nxv8bf16(<vscale x 16 x i8> %v) #0 {
1010 ; CHECK-LABEL: bitcast_nxv16i8_to_nxv8bf16:
1014 ; CHECK_BE-LABEL: bitcast_nxv16i8_to_nxv8bf16:
1015 ; CHECK_BE: // %bb.0:
1016 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1017 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1018 ; CHECK_BE-NEXT: ptrue p0.b
1019 ; CHECK_BE-NEXT: ptrue p1.h
1020 ; CHECK_BE-NEXT: st1b { z0.b }, p0, [sp]
1021 ; CHECK_BE-NEXT: ld1h { z0.h }, p1/z, [sp]
1022 ; CHECK_BE-NEXT: addvl sp, sp, #1
1023 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1024 ; CHECK_BE-NEXT: ret
1025 %bc = bitcast <vscale x 16 x i8> %v to <vscale x 8 x bfloat>
1026 ret <vscale x 8 x bfloat> %bc
1029 define <vscale x 8 x bfloat> @bitcast_nxv8i16_to_nxv8bf16(<vscale x 8 x i16> %v) #0 {
1030 ; CHECK-LABEL: bitcast_nxv8i16_to_nxv8bf16:
1034 ; CHECK_BE-LABEL: bitcast_nxv8i16_to_nxv8bf16:
1035 ; CHECK_BE: // %bb.0:
1036 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1037 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1038 ; CHECK_BE-NEXT: ptrue p0.h
1039 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp]
1040 ; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp]
1041 ; CHECK_BE-NEXT: addvl sp, sp, #1
1042 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1043 ; CHECK_BE-NEXT: ret
1044 %bc = bitcast <vscale x 8 x i16> %v to <vscale x 8 x bfloat>
1045 ret <vscale x 8 x bfloat> %bc
1048 define <vscale x 8 x bfloat> @bitcast_nxv4i32_to_nxv8bf16(<vscale x 4 x i32> %v) #0 {
1049 ; CHECK-LABEL: bitcast_nxv4i32_to_nxv8bf16:
1053 ; CHECK_BE-LABEL: bitcast_nxv4i32_to_nxv8bf16:
1054 ; CHECK_BE: // %bb.0:
1055 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1056 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1057 ; CHECK_BE-NEXT: ptrue p0.s
1058 ; CHECK_BE-NEXT: ptrue p1.h
1059 ; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp]
1060 ; CHECK_BE-NEXT: ld1h { z0.h }, p1/z, [sp]
1061 ; CHECK_BE-NEXT: addvl sp, sp, #1
1062 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1063 ; CHECK_BE-NEXT: ret
1064 %bc = bitcast <vscale x 4 x i32> %v to <vscale x 8 x bfloat>
1065 ret <vscale x 8 x bfloat> %bc
1068 define <vscale x 8 x bfloat> @bitcast_nxv2i64_to_nxv8bf16(<vscale x 2 x i64> %v) #0 {
1069 ; CHECK-LABEL: bitcast_nxv2i64_to_nxv8bf16:
1073 ; CHECK_BE-LABEL: bitcast_nxv2i64_to_nxv8bf16:
1074 ; CHECK_BE: // %bb.0:
1075 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1076 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1077 ; CHECK_BE-NEXT: ptrue p0.d
1078 ; CHECK_BE-NEXT: ptrue p1.h
1079 ; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp]
1080 ; CHECK_BE-NEXT: ld1h { z0.h }, p1/z, [sp]
1081 ; CHECK_BE-NEXT: addvl sp, sp, #1
1082 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1083 ; CHECK_BE-NEXT: ret
1084 %bc = bitcast <vscale x 2 x i64> %v to <vscale x 8 x bfloat>
1085 ret <vscale x 8 x bfloat> %bc
1088 define <vscale x 8 x bfloat> @bitcast_nxv8f16_to_nxv8bf16(<vscale x 8 x half> %v) #0 {
1089 ; CHECK-LABEL: bitcast_nxv8f16_to_nxv8bf16:
1093 ; CHECK_BE-LABEL: bitcast_nxv8f16_to_nxv8bf16:
1094 ; CHECK_BE: // %bb.0:
1095 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1096 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1097 ; CHECK_BE-NEXT: ptrue p0.h
1098 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp]
1099 ; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp]
1100 ; CHECK_BE-NEXT: addvl sp, sp, #1
1101 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1102 ; CHECK_BE-NEXT: ret
1103 %bc = bitcast <vscale x 8 x half> %v to <vscale x 8 x bfloat>
1104 ret <vscale x 8 x bfloat> %bc
1107 define <vscale x 8 x bfloat> @bitcast_nxv4f32_to_nxv8bf16(<vscale x 4 x float> %v) #0 {
1108 ; CHECK-LABEL: bitcast_nxv4f32_to_nxv8bf16:
1112 ; CHECK_BE-LABEL: bitcast_nxv4f32_to_nxv8bf16:
1113 ; CHECK_BE: // %bb.0:
1114 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1115 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1116 ; CHECK_BE-NEXT: ptrue p0.s
1117 ; CHECK_BE-NEXT: ptrue p1.h
1118 ; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp]
1119 ; CHECK_BE-NEXT: ld1h { z0.h }, p1/z, [sp]
1120 ; CHECK_BE-NEXT: addvl sp, sp, #1
1121 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1122 ; CHECK_BE-NEXT: ret
1123 %bc = bitcast <vscale x 4 x float> %v to <vscale x 8 x bfloat>
1124 ret <vscale x 8 x bfloat> %bc
1127 define <vscale x 8 x bfloat> @bitcast_nxv2f64_to_nxv8bf16(<vscale x 2 x double> %v) #0 {
1128 ; CHECK-LABEL: bitcast_nxv2f64_to_nxv8bf16:
1132 ; CHECK_BE-LABEL: bitcast_nxv2f64_to_nxv8bf16:
1133 ; CHECK_BE: // %bb.0:
1134 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1135 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1136 ; CHECK_BE-NEXT: ptrue p0.d
1137 ; CHECK_BE-NEXT: ptrue p1.h
1138 ; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp]
1139 ; CHECK_BE-NEXT: ld1h { z0.h }, p1/z, [sp]
1140 ; CHECK_BE-NEXT: addvl sp, sp, #1
1141 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1142 ; CHECK_BE-NEXT: ret
1143 %bc = bitcast <vscale x 2 x double> %v to <vscale x 8 x bfloat>
1144 ret <vscale x 8 x bfloat> %bc
1151 define <vscale x 8 x i8> @bitcast_nxv4i16_to_nxv8i8(<vscale x 4 x i16> %v) #0 {
1152 ; CHECK-LABEL: bitcast_nxv4i16_to_nxv8i8:
1154 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1155 ; CHECK-NEXT: addvl sp, sp, #-1
1156 ; CHECK-NEXT: ptrue p0.s
1157 ; CHECK-NEXT: ptrue p1.h
1158 ; CHECK-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl]
1159 ; CHECK-NEXT: ld1b { z0.h }, p1/z, [sp, #1, mul vl]
1160 ; CHECK-NEXT: addvl sp, sp, #1
1161 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1164 ; CHECK_BE-LABEL: bitcast_nxv4i16_to_nxv8i8:
1165 ; CHECK_BE: // %bb.0:
1166 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1167 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1168 ; CHECK_BE-NEXT: ptrue p0.s
1169 ; CHECK_BE-NEXT: ptrue p1.h
1170 ; CHECK_BE-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl]
1171 ; CHECK_BE-NEXT: ld1b { z0.h }, p1/z, [sp, #1, mul vl]
1172 ; CHECK_BE-NEXT: addvl sp, sp, #1
1173 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1174 ; CHECK_BE-NEXT: ret
1175 %bc = bitcast <vscale x 4 x i16> %v to <vscale x 8 x i8>
1176 ret <vscale x 8 x i8> %bc
1179 define <vscale x 8 x i8> @bitcast_nxv2i32_to_nxv8i8(<vscale x 2 x i32> %v) #0 {
1180 ; CHECK-LABEL: bitcast_nxv2i32_to_nxv8i8:
1182 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1183 ; CHECK-NEXT: addvl sp, sp, #-1
1184 ; CHECK-NEXT: ptrue p0.d
1185 ; CHECK-NEXT: ptrue p1.h
1186 ; CHECK-NEXT: st1w { z0.d }, p0, [sp, #1, mul vl]
1187 ; CHECK-NEXT: ld1b { z0.h }, p1/z, [sp, #1, mul vl]
1188 ; CHECK-NEXT: addvl sp, sp, #1
1189 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1192 ; CHECK_BE-LABEL: bitcast_nxv2i32_to_nxv8i8:
1193 ; CHECK_BE: // %bb.0:
1194 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1195 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1196 ; CHECK_BE-NEXT: ptrue p0.d
1197 ; CHECK_BE-NEXT: ptrue p1.h
1198 ; CHECK_BE-NEXT: st1w { z0.d }, p0, [sp, #1, mul vl]
1199 ; CHECK_BE-NEXT: ld1b { z0.h }, p1/z, [sp, #1, mul vl]
1200 ; CHECK_BE-NEXT: addvl sp, sp, #1
1201 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1202 ; CHECK_BE-NEXT: ret
1203 %bc = bitcast <vscale x 2 x i32> %v to <vscale x 8 x i8>
1204 ret <vscale x 8 x i8> %bc
1207 define <vscale x 8 x i8> @bitcast_nxv1i64_to_nxv8i8(<vscale x 1 x i64> %v) #0 {
1208 ; CHECK-LABEL: bitcast_nxv1i64_to_nxv8i8:
1210 ; CHECK-NEXT: uunpklo z0.h, z0.b
1213 ; CHECK_BE-LABEL: bitcast_nxv1i64_to_nxv8i8:
1214 ; CHECK_BE: // %bb.0:
1215 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1216 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1217 ; CHECK_BE-NEXT: ptrue p0.d
1218 ; CHECK_BE-NEXT: ptrue p1.b
1219 ; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp]
1220 ; CHECK_BE-NEXT: ld1b { z0.b }, p1/z, [sp]
1221 ; CHECK_BE-NEXT: uunpklo z0.h, z0.b
1222 ; CHECK_BE-NEXT: addvl sp, sp, #1
1223 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1224 ; CHECK_BE-NEXT: ret
1225 %bc = bitcast <vscale x 1 x i64> %v to <vscale x 8 x i8>
1226 ret <vscale x 8 x i8> %bc
1229 define <vscale x 8 x i8> @bitcast_nxv4f16_to_nxv8i8(<vscale x 4 x half> %v) #0 {
1230 ; CHECK-LABEL: bitcast_nxv4f16_to_nxv8i8:
1232 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1233 ; CHECK-NEXT: addvl sp, sp, #-1
1234 ; CHECK-NEXT: ptrue p0.s
1235 ; CHECK-NEXT: ptrue p1.h
1236 ; CHECK-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl]
1237 ; CHECK-NEXT: ld1b { z0.h }, p1/z, [sp, #1, mul vl]
1238 ; CHECK-NEXT: addvl sp, sp, #1
1239 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1242 ; CHECK_BE-LABEL: bitcast_nxv4f16_to_nxv8i8:
1243 ; CHECK_BE: // %bb.0:
1244 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1245 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1246 ; CHECK_BE-NEXT: ptrue p0.s
1247 ; CHECK_BE-NEXT: ptrue p1.h
1248 ; CHECK_BE-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl]
1249 ; CHECK_BE-NEXT: ld1b { z0.h }, p1/z, [sp, #1, mul vl]
1250 ; CHECK_BE-NEXT: addvl sp, sp, #1
1251 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1252 ; CHECK_BE-NEXT: ret
1253 %bc = bitcast <vscale x 4 x half> %v to <vscale x 8 x i8>
1254 ret <vscale x 8 x i8> %bc
1257 define <vscale x 8 x i8> @bitcast_nxv2f32_to_nxv8i8(<vscale x 2 x float> %v) #0 {
1258 ; CHECK-LABEL: bitcast_nxv2f32_to_nxv8i8:
1260 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1261 ; CHECK-NEXT: addvl sp, sp, #-1
1262 ; CHECK-NEXT: ptrue p0.d
1263 ; CHECK-NEXT: ptrue p1.h
1264 ; CHECK-NEXT: st1w { z0.d }, p0, [sp, #1, mul vl]
1265 ; CHECK-NEXT: ld1b { z0.h }, p1/z, [sp, #1, mul vl]
1266 ; CHECK-NEXT: addvl sp, sp, #1
1267 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1270 ; CHECK_BE-LABEL: bitcast_nxv2f32_to_nxv8i8:
1271 ; CHECK_BE: // %bb.0:
1272 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1273 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1274 ; CHECK_BE-NEXT: ptrue p0.d
1275 ; CHECK_BE-NEXT: ptrue p1.h
1276 ; CHECK_BE-NEXT: st1w { z0.d }, p0, [sp, #1, mul vl]
1277 ; CHECK_BE-NEXT: ld1b { z0.h }, p1/z, [sp, #1, mul vl]
1278 ; CHECK_BE-NEXT: addvl sp, sp, #1
1279 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1280 ; CHECK_BE-NEXT: ret
1281 %bc = bitcast <vscale x 2 x float> %v to <vscale x 8 x i8>
1282 ret <vscale x 8 x i8> %bc
1285 define <vscale x 8 x i8> @bitcast_nxv1f64_to_nxv8i8(<vscale x 1 x double> %v) #0 {
1286 ; CHECK-LABEL: bitcast_nxv1f64_to_nxv8i8:
1288 ; CHECK-NEXT: uunpklo z0.h, z0.b
1291 ; CHECK_BE-LABEL: bitcast_nxv1f64_to_nxv8i8:
1292 ; CHECK_BE: // %bb.0:
1293 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1294 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1295 ; CHECK_BE-NEXT: ptrue p0.d
1296 ; CHECK_BE-NEXT: ptrue p1.b
1297 ; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp]
1298 ; CHECK_BE-NEXT: ld1b { z0.b }, p1/z, [sp]
1299 ; CHECK_BE-NEXT: uunpklo z0.h, z0.b
1300 ; CHECK_BE-NEXT: addvl sp, sp, #1
1301 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1302 ; CHECK_BE-NEXT: ret
1303 %bc = bitcast <vscale x 1 x double> %v to <vscale x 8 x i8>
1304 ret <vscale x 8 x i8> %bc
1307 define <vscale x 8 x i8> @bitcast_nxv4bf16_to_nxv8i8(<vscale x 4 x bfloat> %v) #0 {
1308 ; CHECK-LABEL: bitcast_nxv4bf16_to_nxv8i8:
1310 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1311 ; CHECK-NEXT: addvl sp, sp, #-1
1312 ; CHECK-NEXT: ptrue p0.s
1313 ; CHECK-NEXT: ptrue p1.h
1314 ; CHECK-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl]
1315 ; CHECK-NEXT: ld1b { z0.h }, p1/z, [sp, #1, mul vl]
1316 ; CHECK-NEXT: addvl sp, sp, #1
1317 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1320 ; CHECK_BE-LABEL: bitcast_nxv4bf16_to_nxv8i8:
1321 ; CHECK_BE: // %bb.0:
1322 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1323 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1324 ; CHECK_BE-NEXT: ptrue p0.s
1325 ; CHECK_BE-NEXT: ptrue p1.h
1326 ; CHECK_BE-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl]
1327 ; CHECK_BE-NEXT: ld1b { z0.h }, p1/z, [sp, #1, mul vl]
1328 ; CHECK_BE-NEXT: addvl sp, sp, #1
1329 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1330 ; CHECK_BE-NEXT: ret
1331 %bc = bitcast <vscale x 4 x bfloat> %v to <vscale x 8 x i8>
1332 ret <vscale x 8 x i8> %bc
1336 ; bitcast to nxv4i16
1339 define <vscale x 4 x i16> @bitcast_nxv8i8_to_nxv4i16(<vscale x 8 x i8> %v) #0 {
1340 ; CHECK-LABEL: bitcast_nxv8i8_to_nxv4i16:
1342 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1343 ; CHECK-NEXT: addvl sp, sp, #-1
1344 ; CHECK-NEXT: ptrue p0.h
1345 ; CHECK-NEXT: ptrue p1.s
1346 ; CHECK-NEXT: st1b { z0.h }, p0, [sp, #1, mul vl]
1347 ; CHECK-NEXT: ld1h { z0.s }, p1/z, [sp, #1, mul vl]
1348 ; CHECK-NEXT: addvl sp, sp, #1
1349 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1352 ; CHECK_BE-LABEL: bitcast_nxv8i8_to_nxv4i16:
1353 ; CHECK_BE: // %bb.0:
1354 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1355 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1356 ; CHECK_BE-NEXT: ptrue p0.h
1357 ; CHECK_BE-NEXT: ptrue p1.s
1358 ; CHECK_BE-NEXT: st1b { z0.h }, p0, [sp, #1, mul vl]
1359 ; CHECK_BE-NEXT: ld1h { z0.s }, p1/z, [sp, #1, mul vl]
1360 ; CHECK_BE-NEXT: addvl sp, sp, #1
1361 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1362 ; CHECK_BE-NEXT: ret
1363 %bc = bitcast <vscale x 8 x i8> %v to <vscale x 4 x i16>
1364 ret <vscale x 4 x i16> %bc
1367 define <vscale x 4 x i16> @bitcast_nxv2i32_to_nxv4i16(<vscale x 2 x i32> %v) #0 {
1368 ; CHECK-LABEL: bitcast_nxv2i32_to_nxv4i16:
1370 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1371 ; CHECK-NEXT: addvl sp, sp, #-1
1372 ; CHECK-NEXT: ptrue p0.d
1373 ; CHECK-NEXT: ptrue p1.s
1374 ; CHECK-NEXT: st1w { z0.d }, p0, [sp, #1, mul vl]
1375 ; CHECK-NEXT: ld1h { z0.s }, p1/z, [sp, #1, mul vl]
1376 ; CHECK-NEXT: addvl sp, sp, #1
1377 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1380 ; CHECK_BE-LABEL: bitcast_nxv2i32_to_nxv4i16:
1381 ; CHECK_BE: // %bb.0:
1382 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1383 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1384 ; CHECK_BE-NEXT: ptrue p0.d
1385 ; CHECK_BE-NEXT: ptrue p1.s
1386 ; CHECK_BE-NEXT: st1w { z0.d }, p0, [sp, #1, mul vl]
1387 ; CHECK_BE-NEXT: ld1h { z0.s }, p1/z, [sp, #1, mul vl]
1388 ; CHECK_BE-NEXT: addvl sp, sp, #1
1389 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1390 ; CHECK_BE-NEXT: ret
1391 %bc = bitcast <vscale x 2 x i32> %v to <vscale x 4 x i16>
1392 ret <vscale x 4 x i16> %bc
1395 define <vscale x 4 x i16> @bitcast_nxv1i64_to_nxv4i16(<vscale x 1 x i64> %v) #0 {
1396 ; CHECK-LABEL: bitcast_nxv1i64_to_nxv4i16:
1398 ; CHECK-NEXT: uunpklo z0.s, z0.h
1401 ; CHECK_BE-LABEL: bitcast_nxv1i64_to_nxv4i16:
1402 ; CHECK_BE: // %bb.0:
1403 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1404 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1405 ; CHECK_BE-NEXT: ptrue p0.d
1406 ; CHECK_BE-NEXT: ptrue p1.h
1407 ; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp]
1408 ; CHECK_BE-NEXT: ld1h { z0.h }, p1/z, [sp]
1409 ; CHECK_BE-NEXT: uunpklo z0.s, z0.h
1410 ; CHECK_BE-NEXT: addvl sp, sp, #1
1411 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1412 ; CHECK_BE-NEXT: ret
1413 %bc = bitcast <vscale x 1 x i64> %v to <vscale x 4 x i16>
1414 ret <vscale x 4 x i16> %bc
1417 define <vscale x 4 x i16> @bitcast_nxv4f16_to_nxv4i16(<vscale x 4 x half> %v) #0 {
1418 ; CHECK-LABEL: bitcast_nxv4f16_to_nxv4i16:
1422 ; CHECK_BE-LABEL: bitcast_nxv4f16_to_nxv4i16:
1423 ; CHECK_BE: // %bb.0:
1424 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1425 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1426 ; CHECK_BE-NEXT: ptrue p0.h
1427 ; CHECK_BE-NEXT: ptrue p1.s
1428 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp]
1429 ; CHECK_BE-NEXT: ld1w { z0.s }, p1/z, [sp]
1430 ; CHECK_BE-NEXT: addvl sp, sp, #1
1431 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1432 ; CHECK_BE-NEXT: ret
1433 %bc = bitcast <vscale x 4 x half> %v to <vscale x 4 x i16>
1434 ret <vscale x 4 x i16> %bc
1437 define <vscale x 4 x i16> @bitcast_nxv2f32_to_nxv4i16(<vscale x 2 x float> %v) #0 {
1438 ; CHECK-LABEL: bitcast_nxv2f32_to_nxv4i16:
1440 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1441 ; CHECK-NEXT: addvl sp, sp, #-1
1442 ; CHECK-NEXT: ptrue p0.d
1443 ; CHECK-NEXT: ptrue p1.s
1444 ; CHECK-NEXT: st1w { z0.d }, p0, [sp, #1, mul vl]
1445 ; CHECK-NEXT: ld1h { z0.s }, p1/z, [sp, #1, mul vl]
1446 ; CHECK-NEXT: addvl sp, sp, #1
1447 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1450 ; CHECK_BE-LABEL: bitcast_nxv2f32_to_nxv4i16:
1451 ; CHECK_BE: // %bb.0:
1452 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1453 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1454 ; CHECK_BE-NEXT: ptrue p0.d
1455 ; CHECK_BE-NEXT: ptrue p1.s
1456 ; CHECK_BE-NEXT: st1w { z0.d }, p0, [sp, #1, mul vl]
1457 ; CHECK_BE-NEXT: ld1h { z0.s }, p1/z, [sp, #1, mul vl]
1458 ; CHECK_BE-NEXT: addvl sp, sp, #1
1459 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1460 ; CHECK_BE-NEXT: ret
1461 %bc = bitcast <vscale x 2 x float> %v to <vscale x 4 x i16>
1462 ret <vscale x 4 x i16> %bc
1465 define <vscale x 4 x i16> @bitcast_nxv1f64_to_nxv4i16(<vscale x 1 x double> %v) #0 {
1466 ; CHECK-LABEL: bitcast_nxv1f64_to_nxv4i16:
1468 ; CHECK-NEXT: uunpklo z0.s, z0.h
1471 ; CHECK_BE-LABEL: bitcast_nxv1f64_to_nxv4i16:
1472 ; CHECK_BE: // %bb.0:
1473 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1474 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1475 ; CHECK_BE-NEXT: ptrue p0.d
1476 ; CHECK_BE-NEXT: ptrue p1.h
1477 ; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp]
1478 ; CHECK_BE-NEXT: ld1h { z0.h }, p1/z, [sp]
1479 ; CHECK_BE-NEXT: uunpklo z0.s, z0.h
1480 ; CHECK_BE-NEXT: addvl sp, sp, #1
1481 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1482 ; CHECK_BE-NEXT: ret
1483 %bc = bitcast <vscale x 1 x double> %v to <vscale x 4 x i16>
1484 ret <vscale x 4 x i16> %bc
1487 define <vscale x 4 x i16> @bitcast_nxv4bf16_to_nxv4i16(<vscale x 4 x bfloat> %v) #0 {
1488 ; CHECK-LABEL: bitcast_nxv4bf16_to_nxv4i16:
1492 ; CHECK_BE-LABEL: bitcast_nxv4bf16_to_nxv4i16:
1493 ; CHECK_BE: // %bb.0:
1494 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1495 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1496 ; CHECK_BE-NEXT: ptrue p0.h
1497 ; CHECK_BE-NEXT: ptrue p1.s
1498 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp]
1499 ; CHECK_BE-NEXT: ld1w { z0.s }, p1/z, [sp]
1500 ; CHECK_BE-NEXT: addvl sp, sp, #1
1501 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1502 ; CHECK_BE-NEXT: ret
1503 %bc = bitcast <vscale x 4 x bfloat> %v to <vscale x 4 x i16>
1504 ret <vscale x 4 x i16> %bc
1508 ; bitcast to nxv2i32
1511 define <vscale x 2 x i32> @bitcast_nxv8i8_to_nxv2i32(<vscale x 8 x i8> %v) #0 {
1512 ; CHECK-LABEL: bitcast_nxv8i8_to_nxv2i32:
1514 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1515 ; CHECK-NEXT: addvl sp, sp, #-1
1516 ; CHECK-NEXT: ptrue p0.h
1517 ; CHECK-NEXT: ptrue p1.d
1518 ; CHECK-NEXT: st1b { z0.h }, p0, [sp, #1, mul vl]
1519 ; CHECK-NEXT: ld1w { z0.d }, p1/z, [sp, #1, mul vl]
1520 ; CHECK-NEXT: addvl sp, sp, #1
1521 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1524 ; CHECK_BE-LABEL: bitcast_nxv8i8_to_nxv2i32:
1525 ; CHECK_BE: // %bb.0:
1526 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1527 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1528 ; CHECK_BE-NEXT: ptrue p0.h
1529 ; CHECK_BE-NEXT: ptrue p1.d
1530 ; CHECK_BE-NEXT: st1b { z0.h }, p0, [sp, #1, mul vl]
1531 ; CHECK_BE-NEXT: ld1w { z0.d }, p1/z, [sp, #1, mul vl]
1532 ; CHECK_BE-NEXT: addvl sp, sp, #1
1533 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1534 ; CHECK_BE-NEXT: ret
1535 %bc = bitcast <vscale x 8 x i8> %v to <vscale x 2 x i32>
1536 ret <vscale x 2 x i32> %bc
1539 define <vscale x 2 x i32> @bitcast_nxv4i16_to_nxv2i32(<vscale x 4 x i16> %v) #0 {
1540 ; CHECK-LABEL: bitcast_nxv4i16_to_nxv2i32:
1542 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1543 ; CHECK-NEXT: addvl sp, sp, #-1
1544 ; CHECK-NEXT: ptrue p0.s
1545 ; CHECK-NEXT: ptrue p1.d
1546 ; CHECK-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl]
1547 ; CHECK-NEXT: ld1w { z0.d }, p1/z, [sp, #1, mul vl]
1548 ; CHECK-NEXT: addvl sp, sp, #1
1549 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1552 ; CHECK_BE-LABEL: bitcast_nxv4i16_to_nxv2i32:
1553 ; CHECK_BE: // %bb.0:
1554 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1555 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1556 ; CHECK_BE-NEXT: ptrue p0.s
1557 ; CHECK_BE-NEXT: ptrue p1.d
1558 ; CHECK_BE-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl]
1559 ; CHECK_BE-NEXT: ld1w { z0.d }, p1/z, [sp, #1, mul vl]
1560 ; CHECK_BE-NEXT: addvl sp, sp, #1
1561 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1562 ; CHECK_BE-NEXT: ret
1563 %bc = bitcast <vscale x 4 x i16> %v to <vscale x 2 x i32>
1564 ret <vscale x 2 x i32> %bc
1567 define <vscale x 2 x i32> @bitcast_nxv1i64_to_nxv2i32(<vscale x 1 x i64> %v) #0 {
1568 ; CHECK-LABEL: bitcast_nxv1i64_to_nxv2i32:
1570 ; CHECK-NEXT: uunpklo z0.d, z0.s
1573 ; CHECK_BE-LABEL: bitcast_nxv1i64_to_nxv2i32:
1574 ; CHECK_BE: // %bb.0:
1575 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1576 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1577 ; CHECK_BE-NEXT: ptrue p0.d
1578 ; CHECK_BE-NEXT: ptrue p1.s
1579 ; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp]
1580 ; CHECK_BE-NEXT: ld1w { z0.s }, p1/z, [sp]
1581 ; CHECK_BE-NEXT: uunpklo z0.d, z0.s
1582 ; CHECK_BE-NEXT: addvl sp, sp, #1
1583 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1584 ; CHECK_BE-NEXT: ret
1585 %bc = bitcast <vscale x 1 x i64> %v to <vscale x 2 x i32>
1586 ret <vscale x 2 x i32> %bc
1589 define <vscale x 2 x i32> @bitcast_nxv4f16_to_nxv2i32(<vscale x 4 x half> %v) #0 {
1590 ; CHECK-LABEL: bitcast_nxv4f16_to_nxv2i32:
1592 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1593 ; CHECK-NEXT: addvl sp, sp, #-1
1594 ; CHECK-NEXT: ptrue p0.s
1595 ; CHECK-NEXT: ptrue p1.d
1596 ; CHECK-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl]
1597 ; CHECK-NEXT: ld1w { z0.d }, p1/z, [sp, #1, mul vl]
1598 ; CHECK-NEXT: addvl sp, sp, #1
1599 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1602 ; CHECK_BE-LABEL: bitcast_nxv4f16_to_nxv2i32:
1603 ; CHECK_BE: // %bb.0:
1604 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1605 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1606 ; CHECK_BE-NEXT: ptrue p0.s
1607 ; CHECK_BE-NEXT: ptrue p1.d
1608 ; CHECK_BE-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl]
1609 ; CHECK_BE-NEXT: ld1w { z0.d }, p1/z, [sp, #1, mul vl]
1610 ; CHECK_BE-NEXT: addvl sp, sp, #1
1611 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1612 ; CHECK_BE-NEXT: ret
1613 %bc = bitcast <vscale x 4 x half> %v to <vscale x 2 x i32>
1614 ret <vscale x 2 x i32> %bc
1617 define <vscale x 2 x i32> @bitcast_nxv2f32_to_nxv2i32(<vscale x 2 x float> %v) #0 {
1618 ; CHECK-LABEL: bitcast_nxv2f32_to_nxv2i32:
1622 ; CHECK_BE-LABEL: bitcast_nxv2f32_to_nxv2i32:
1623 ; CHECK_BE: // %bb.0:
1624 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1625 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1626 ; CHECK_BE-NEXT: ptrue p0.s
1627 ; CHECK_BE-NEXT: ptrue p1.d
1628 ; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp]
1629 ; CHECK_BE-NEXT: ld1d { z0.d }, p1/z, [sp]
1630 ; CHECK_BE-NEXT: addvl sp, sp, #1
1631 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1632 ; CHECK_BE-NEXT: ret
1633 %bc = bitcast <vscale x 2 x float> %v to <vscale x 2 x i32>
1634 ret <vscale x 2 x i32> %bc
1637 define <vscale x 2 x i32> @bitcast_nxv1f64_to_nxv2i32(<vscale x 1 x double> %v) #0 {
1638 ; CHECK-LABEL: bitcast_nxv1f64_to_nxv2i32:
1640 ; CHECK-NEXT: uunpklo z0.d, z0.s
1643 ; CHECK_BE-LABEL: bitcast_nxv1f64_to_nxv2i32:
1644 ; CHECK_BE: // %bb.0:
1645 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1646 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1647 ; CHECK_BE-NEXT: ptrue p0.d
1648 ; CHECK_BE-NEXT: ptrue p1.s
1649 ; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp]
1650 ; CHECK_BE-NEXT: ld1w { z0.s }, p1/z, [sp]
1651 ; CHECK_BE-NEXT: uunpklo z0.d, z0.s
1652 ; CHECK_BE-NEXT: addvl sp, sp, #1
1653 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1654 ; CHECK_BE-NEXT: ret
1655 %bc = bitcast <vscale x 1 x double> %v to <vscale x 2 x i32>
1656 ret <vscale x 2 x i32> %bc
1659 define <vscale x 2 x i32> @bitcast_nxv4bf16_to_nxv2i32(<vscale x 4 x bfloat> %v) #0 {
1660 ; CHECK-LABEL: bitcast_nxv4bf16_to_nxv2i32:
1662 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1663 ; CHECK-NEXT: addvl sp, sp, #-1
1664 ; CHECK-NEXT: ptrue p0.s
1665 ; CHECK-NEXT: ptrue p1.d
1666 ; CHECK-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl]
1667 ; CHECK-NEXT: ld1w { z0.d }, p1/z, [sp, #1, mul vl]
1668 ; CHECK-NEXT: addvl sp, sp, #1
1669 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1672 ; CHECK_BE-LABEL: bitcast_nxv4bf16_to_nxv2i32:
1673 ; CHECK_BE: // %bb.0:
1674 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1675 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1676 ; CHECK_BE-NEXT: ptrue p0.s
1677 ; CHECK_BE-NEXT: ptrue p1.d
1678 ; CHECK_BE-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl]
1679 ; CHECK_BE-NEXT: ld1w { z0.d }, p1/z, [sp, #1, mul vl]
1680 ; CHECK_BE-NEXT: addvl sp, sp, #1
1681 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1682 ; CHECK_BE-NEXT: ret
1683 %bc = bitcast <vscale x 4 x bfloat> %v to <vscale x 2 x i32>
1684 ret <vscale x 2 x i32> %bc
1688 ; bitcast to nxv1i64
1691 define <vscale x 1 x i64> @bitcast_nxv8i8_to_nxv1i64(<vscale x 8 x i8> %v) #0 {
1692 ; CHECK-LABEL: bitcast_nxv8i8_to_nxv1i64:
1694 ; CHECK-NEXT: uzp1 z0.b, z0.b, z0.b
1697 ; CHECK_BE-LABEL: bitcast_nxv8i8_to_nxv1i64:
1698 ; CHECK_BE: // %bb.0:
1699 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1700 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1701 ; CHECK_BE-NEXT: uzp1 z0.b, z0.b, z0.b
1702 ; CHECK_BE-NEXT: ptrue p0.b
1703 ; CHECK_BE-NEXT: ptrue p1.d
1704 ; CHECK_BE-NEXT: st1b { z0.b }, p0, [sp]
1705 ; CHECK_BE-NEXT: ld1d { z0.d }, p1/z, [sp]
1706 ; CHECK_BE-NEXT: addvl sp, sp, #1
1707 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1708 ; CHECK_BE-NEXT: ret
1709 %bc = bitcast <vscale x 8 x i8> %v to <vscale x 1 x i64>
1710 ret <vscale x 1 x i64> %bc
1713 define <vscale x 1 x i64> @bitcast_nxv4i16_to_nxv1i64(<vscale x 4 x i16> %v) #0 {
1714 ; CHECK-LABEL: bitcast_nxv4i16_to_nxv1i64:
1716 ; CHECK-NEXT: uzp1 z0.h, z0.h, z0.h
1719 ; CHECK_BE-LABEL: bitcast_nxv4i16_to_nxv1i64:
1720 ; CHECK_BE: // %bb.0:
1721 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1722 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1723 ; CHECK_BE-NEXT: uzp1 z0.h, z0.h, z0.h
1724 ; CHECK_BE-NEXT: ptrue p0.h
1725 ; CHECK_BE-NEXT: ptrue p1.d
1726 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp]
1727 ; CHECK_BE-NEXT: ld1d { z0.d }, p1/z, [sp]
1728 ; CHECK_BE-NEXT: addvl sp, sp, #1
1729 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1730 ; CHECK_BE-NEXT: ret
1731 %bc = bitcast <vscale x 4 x i16> %v to <vscale x 1 x i64>
1732 ret <vscale x 1 x i64> %bc
1735 define <vscale x 1 x i64> @bitcast_nxv2i32_to_nxv1i64(<vscale x 2 x i32> %v) #0 {
1736 ; CHECK-LABEL: bitcast_nxv2i32_to_nxv1i64:
1738 ; CHECK-NEXT: uzp1 z0.s, z0.s, z0.s
1741 ; CHECK_BE-LABEL: bitcast_nxv2i32_to_nxv1i64:
1742 ; CHECK_BE: // %bb.0:
1743 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1744 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1745 ; CHECK_BE-NEXT: uzp1 z0.s, z0.s, z0.s
1746 ; CHECK_BE-NEXT: ptrue p0.s
1747 ; CHECK_BE-NEXT: ptrue p1.d
1748 ; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp]
1749 ; CHECK_BE-NEXT: ld1d { z0.d }, p1/z, [sp]
1750 ; CHECK_BE-NEXT: addvl sp, sp, #1
1751 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1752 ; CHECK_BE-NEXT: ret
1753 %bc = bitcast <vscale x 2 x i32> %v to <vscale x 1 x i64>
1754 ret <vscale x 1 x i64> %bc
1757 define <vscale x 1 x i64> @bitcast_nxv4f16_to_nxv1i64(<vscale x 4 x half> %v) #0 {
1758 ; CHECK-LABEL: bitcast_nxv4f16_to_nxv1i64:
1760 ; CHECK-NEXT: uzp1 z0.h, z0.h, z0.h
1763 ; CHECK_BE-LABEL: bitcast_nxv4f16_to_nxv1i64:
1764 ; CHECK_BE: // %bb.0:
1765 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1766 ; CHECK_BE-NEXT: addvl sp, sp, #-3
1767 ; CHECK_BE-NEXT: ptrue p0.h
1768 ; CHECK_BE-NEXT: ptrue p1.s
1769 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp]
1770 ; CHECK_BE-NEXT: ld1w { z0.s }, p1/z, [sp]
1771 ; CHECK_BE-NEXT: ptrue p1.d
1772 ; CHECK_BE-NEXT: uzp1 z0.h, z0.h, z0.h
1773 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp, #1, mul vl]
1774 ; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp, #1, mul vl]
1775 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp, #2, mul vl]
1776 ; CHECK_BE-NEXT: ld1d { z0.d }, p1/z, [sp, #2, mul vl]
1777 ; CHECK_BE-NEXT: addvl sp, sp, #3
1778 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1779 ; CHECK_BE-NEXT: ret
1780 %bc = bitcast <vscale x 4 x half> %v to <vscale x 1 x i64>
1781 ret <vscale x 1 x i64> %bc
1784 define <vscale x 1 x i64> @bitcast_nxv2f32_to_nxv1i64(<vscale x 2 x float> %v) #0 {
1785 ; CHECK-LABEL: bitcast_nxv2f32_to_nxv1i64:
1787 ; CHECK-NEXT: uzp1 z0.s, z0.s, z0.s
1790 ; CHECK_BE-LABEL: bitcast_nxv2f32_to_nxv1i64:
1791 ; CHECK_BE: // %bb.0:
1792 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1793 ; CHECK_BE-NEXT: addvl sp, sp, #-3
1794 ; CHECK_BE-NEXT: ptrue p0.s
1795 ; CHECK_BE-NEXT: ptrue p1.d
1796 ; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp]
1797 ; CHECK_BE-NEXT: ld1d { z0.d }, p1/z, [sp]
1798 ; CHECK_BE-NEXT: uzp1 z0.s, z0.s, z0.s
1799 ; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp, #1, mul vl]
1800 ; CHECK_BE-NEXT: ld1w { z0.s }, p0/z, [sp, #1, mul vl]
1801 ; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp, #2, mul vl]
1802 ; CHECK_BE-NEXT: ld1d { z0.d }, p1/z, [sp, #2, mul vl]
1803 ; CHECK_BE-NEXT: addvl sp, sp, #3
1804 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1805 ; CHECK_BE-NEXT: ret
1806 %bc = bitcast <vscale x 2 x float> %v to <vscale x 1 x i64>
1807 ret <vscale x 1 x i64> %bc
1810 define <vscale x 1 x i64> @bitcast_nxv1f64_to_nxv1i64(<vscale x 1 x double> %v) #0 {
1811 ; CHECK-LABEL: bitcast_nxv1f64_to_nxv1i64:
1815 ; CHECK_BE-LABEL: bitcast_nxv1f64_to_nxv1i64:
1816 ; CHECK_BE: // %bb.0:
1817 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1818 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1819 ; CHECK_BE-NEXT: ptrue p0.d
1820 ; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp]
1821 ; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp]
1822 ; CHECK_BE-NEXT: addvl sp, sp, #1
1823 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1824 ; CHECK_BE-NEXT: ret
1825 %bc = bitcast <vscale x 1 x double> %v to <vscale x 1 x i64>
1826 ret <vscale x 1 x i64> %bc
1829 define <vscale x 1 x i64> @bitcast_nxv4bf16_to_nxv1i64(<vscale x 4 x bfloat> %v) #0 {
1830 ; CHECK-LABEL: bitcast_nxv4bf16_to_nxv1i64:
1832 ; CHECK-NEXT: uzp1 z0.h, z0.h, z0.h
1835 ; CHECK_BE-LABEL: bitcast_nxv4bf16_to_nxv1i64:
1836 ; CHECK_BE: // %bb.0:
1837 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1838 ; CHECK_BE-NEXT: addvl sp, sp, #-3
1839 ; CHECK_BE-NEXT: ptrue p0.h
1840 ; CHECK_BE-NEXT: ptrue p1.s
1841 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp]
1842 ; CHECK_BE-NEXT: ld1w { z0.s }, p1/z, [sp]
1843 ; CHECK_BE-NEXT: ptrue p1.d
1844 ; CHECK_BE-NEXT: uzp1 z0.h, z0.h, z0.h
1845 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp, #1, mul vl]
1846 ; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp, #1, mul vl]
1847 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp, #2, mul vl]
1848 ; CHECK_BE-NEXT: ld1d { z0.d }, p1/z, [sp, #2, mul vl]
1849 ; CHECK_BE-NEXT: addvl sp, sp, #3
1850 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1851 ; CHECK_BE-NEXT: ret
1852 %bc = bitcast <vscale x 4 x bfloat> %v to <vscale x 1 x i64>
1853 ret <vscale x 1 x i64> %bc
1857 ; bitcast to nxv4f16
1860 define <vscale x 4 x half> @bitcast_nxv8i8_to_nxv4f16(<vscale x 8 x i8> %v) #0 {
1861 ; CHECK-LABEL: bitcast_nxv8i8_to_nxv4f16:
1863 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1864 ; CHECK-NEXT: addvl sp, sp, #-1
1865 ; CHECK-NEXT: ptrue p0.h
1866 ; CHECK-NEXT: ptrue p1.s
1867 ; CHECK-NEXT: st1b { z0.h }, p0, [sp, #1, mul vl]
1868 ; CHECK-NEXT: ld1h { z0.s }, p1/z, [sp, #1, mul vl]
1869 ; CHECK-NEXT: addvl sp, sp, #1
1870 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1873 ; CHECK_BE-LABEL: bitcast_nxv8i8_to_nxv4f16:
1874 ; CHECK_BE: // %bb.0:
1875 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1876 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1877 ; CHECK_BE-NEXT: ptrue p0.h
1878 ; CHECK_BE-NEXT: ptrue p1.s
1879 ; CHECK_BE-NEXT: st1b { z0.h }, p0, [sp, #1, mul vl]
1880 ; CHECK_BE-NEXT: ld1h { z0.s }, p1/z, [sp, #1, mul vl]
1881 ; CHECK_BE-NEXT: addvl sp, sp, #1
1882 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1883 ; CHECK_BE-NEXT: ret
1884 %bc = bitcast <vscale x 8 x i8> %v to <vscale x 4 x half>
1885 ret <vscale x 4 x half> %bc
1888 define <vscale x 4 x half> @bitcast_nxv4i16_to_nxv4f16(<vscale x 4 x i16> %v) #0 {
1889 ; CHECK-LABEL: bitcast_nxv4i16_to_nxv4f16:
1893 ; CHECK_BE-LABEL: bitcast_nxv4i16_to_nxv4f16:
1894 ; CHECK_BE: // %bb.0:
1895 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1896 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1897 ; CHECK_BE-NEXT: ptrue p0.s
1898 ; CHECK_BE-NEXT: ptrue p1.h
1899 ; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp]
1900 ; CHECK_BE-NEXT: ld1h { z0.h }, p1/z, [sp]
1901 ; CHECK_BE-NEXT: addvl sp, sp, #1
1902 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1903 ; CHECK_BE-NEXT: ret
1904 %bc = bitcast <vscale x 4 x i16> %v to <vscale x 4 x half>
1905 ret <vscale x 4 x half> %bc
1908 define <vscale x 4 x half> @bitcast_nxv2i32_to_nxv4f16(<vscale x 2 x i32> %v) #0 {
1909 ; CHECK-LABEL: bitcast_nxv2i32_to_nxv4f16:
1911 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1912 ; CHECK-NEXT: addvl sp, sp, #-1
1913 ; CHECK-NEXT: ptrue p0.d
1914 ; CHECK-NEXT: ptrue p1.s
1915 ; CHECK-NEXT: st1w { z0.d }, p0, [sp, #1, mul vl]
1916 ; CHECK-NEXT: ld1h { z0.s }, p1/z, [sp, #1, mul vl]
1917 ; CHECK-NEXT: addvl sp, sp, #1
1918 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1921 ; CHECK_BE-LABEL: bitcast_nxv2i32_to_nxv4f16:
1922 ; CHECK_BE: // %bb.0:
1923 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1924 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1925 ; CHECK_BE-NEXT: ptrue p0.d
1926 ; CHECK_BE-NEXT: ptrue p1.s
1927 ; CHECK_BE-NEXT: st1w { z0.d }, p0, [sp, #1, mul vl]
1928 ; CHECK_BE-NEXT: ld1h { z0.s }, p1/z, [sp, #1, mul vl]
1929 ; CHECK_BE-NEXT: addvl sp, sp, #1
1930 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1931 ; CHECK_BE-NEXT: ret
1932 %bc = bitcast <vscale x 2 x i32> %v to <vscale x 4 x half>
1933 ret <vscale x 4 x half> %bc
1936 define <vscale x 4 x half> @bitcast_nxv1i64_to_nxv4f16(<vscale x 1 x i64> %v) #0 {
1937 ; CHECK-LABEL: bitcast_nxv1i64_to_nxv4f16:
1939 ; CHECK-NEXT: uunpklo z0.s, z0.h
1942 ; CHECK_BE-LABEL: bitcast_nxv1i64_to_nxv4f16:
1943 ; CHECK_BE: // %bb.0:
1944 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1945 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1946 ; CHECK_BE-NEXT: ptrue p0.d
1947 ; CHECK_BE-NEXT: ptrue p1.h
1948 ; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp]
1949 ; CHECK_BE-NEXT: ld1h { z0.h }, p1/z, [sp]
1950 ; CHECK_BE-NEXT: uunpklo z0.s, z0.h
1951 ; CHECK_BE-NEXT: addvl sp, sp, #1
1952 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1953 ; CHECK_BE-NEXT: ret
1954 %bc = bitcast <vscale x 1 x i64> %v to <vscale x 4 x half>
1955 ret <vscale x 4 x half> %bc
1958 define <vscale x 4 x half> @bitcast_nxv2f32_to_nxv4f16(<vscale x 2 x float> %v) #0 {
1959 ; CHECK-LABEL: bitcast_nxv2f32_to_nxv4f16:
1961 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1962 ; CHECK-NEXT: addvl sp, sp, #-1
1963 ; CHECK-NEXT: ptrue p0.d
1964 ; CHECK-NEXT: ptrue p1.s
1965 ; CHECK-NEXT: st1w { z0.d }, p0, [sp, #1, mul vl]
1966 ; CHECK-NEXT: ld1h { z0.s }, p1/z, [sp, #1, mul vl]
1967 ; CHECK-NEXT: addvl sp, sp, #1
1968 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1971 ; CHECK_BE-LABEL: bitcast_nxv2f32_to_nxv4f16:
1972 ; CHECK_BE: // %bb.0:
1973 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1974 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1975 ; CHECK_BE-NEXT: ptrue p0.d
1976 ; CHECK_BE-NEXT: ptrue p1.s
1977 ; CHECK_BE-NEXT: st1w { z0.d }, p0, [sp, #1, mul vl]
1978 ; CHECK_BE-NEXT: ld1h { z0.s }, p1/z, [sp, #1, mul vl]
1979 ; CHECK_BE-NEXT: addvl sp, sp, #1
1980 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
1981 ; CHECK_BE-NEXT: ret
1982 %bc = bitcast <vscale x 2 x float> %v to <vscale x 4 x half>
1983 ret <vscale x 4 x half> %bc
1986 define <vscale x 4 x half> @bitcast_nxv1f64_to_nxv4f16(<vscale x 1 x double> %v) #0 {
1987 ; CHECK-LABEL: bitcast_nxv1f64_to_nxv4f16:
1989 ; CHECK-NEXT: uunpklo z0.s, z0.h
1992 ; CHECK_BE-LABEL: bitcast_nxv1f64_to_nxv4f16:
1993 ; CHECK_BE: // %bb.0:
1994 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
1995 ; CHECK_BE-NEXT: addvl sp, sp, #-1
1996 ; CHECK_BE-NEXT: ptrue p0.d
1997 ; CHECK_BE-NEXT: ptrue p1.h
1998 ; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp]
1999 ; CHECK_BE-NEXT: ld1h { z0.h }, p1/z, [sp]
2000 ; CHECK_BE-NEXT: uunpklo z0.s, z0.h
2001 ; CHECK_BE-NEXT: addvl sp, sp, #1
2002 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2003 ; CHECK_BE-NEXT: ret
2004 %bc = bitcast <vscale x 1 x double> %v to <vscale x 4 x half>
2005 ret <vscale x 4 x half> %bc
2008 define <vscale x 4 x half> @bitcast_nxv4bf16_to_nxv4f16(<vscale x 4 x bfloat> %v) #0 {
2009 ; CHECK-LABEL: bitcast_nxv4bf16_to_nxv4f16:
2013 ; CHECK_BE-LABEL: bitcast_nxv4bf16_to_nxv4f16:
2014 ; CHECK_BE: // %bb.0:
2015 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2016 ; CHECK_BE-NEXT: addvl sp, sp, #-1
2017 ; CHECK_BE-NEXT: ptrue p0.s
2018 ; CHECK_BE-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl]
2019 ; CHECK_BE-NEXT: ld1h { z0.s }, p0/z, [sp, #1, mul vl]
2020 ; CHECK_BE-NEXT: addvl sp, sp, #1
2021 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2022 ; CHECK_BE-NEXT: ret
2023 %bc = bitcast <vscale x 4 x bfloat> %v to <vscale x 4 x half>
2024 ret <vscale x 4 x half> %bc
2028 ; bitcast to nxv2f32
2031 define <vscale x 2 x float> @bitcast_nxv8i8_to_nxv2f32(<vscale x 8 x i8> %v) #0 {
2032 ; CHECK-LABEL: bitcast_nxv8i8_to_nxv2f32:
2034 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2035 ; CHECK-NEXT: addvl sp, sp, #-1
2036 ; CHECK-NEXT: ptrue p0.h
2037 ; CHECK-NEXT: ptrue p1.d
2038 ; CHECK-NEXT: st1b { z0.h }, p0, [sp, #1, mul vl]
2039 ; CHECK-NEXT: ld1w { z0.d }, p1/z, [sp, #1, mul vl]
2040 ; CHECK-NEXT: addvl sp, sp, #1
2041 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2044 ; CHECK_BE-LABEL: bitcast_nxv8i8_to_nxv2f32:
2045 ; CHECK_BE: // %bb.0:
2046 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2047 ; CHECK_BE-NEXT: addvl sp, sp, #-1
2048 ; CHECK_BE-NEXT: ptrue p0.h
2049 ; CHECK_BE-NEXT: ptrue p1.d
2050 ; CHECK_BE-NEXT: st1b { z0.h }, p0, [sp, #1, mul vl]
2051 ; CHECK_BE-NEXT: ld1w { z0.d }, p1/z, [sp, #1, mul vl]
2052 ; CHECK_BE-NEXT: addvl sp, sp, #1
2053 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2054 ; CHECK_BE-NEXT: ret
2055 %bc = bitcast <vscale x 8 x i8> %v to <vscale x 2 x float>
2056 ret <vscale x 2 x float> %bc
2059 define <vscale x 2 x float> @bitcast_nxv4i16_to_nxv2f32(<vscale x 4 x i16> %v) #0 {
2060 ; CHECK-LABEL: bitcast_nxv4i16_to_nxv2f32:
2062 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2063 ; CHECK-NEXT: addvl sp, sp, #-1
2064 ; CHECK-NEXT: ptrue p0.s
2065 ; CHECK-NEXT: ptrue p1.d
2066 ; CHECK-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl]
2067 ; CHECK-NEXT: ld1w { z0.d }, p1/z, [sp, #1, mul vl]
2068 ; CHECK-NEXT: addvl sp, sp, #1
2069 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2072 ; CHECK_BE-LABEL: bitcast_nxv4i16_to_nxv2f32:
2073 ; CHECK_BE: // %bb.0:
2074 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2075 ; CHECK_BE-NEXT: addvl sp, sp, #-1
2076 ; CHECK_BE-NEXT: ptrue p0.s
2077 ; CHECK_BE-NEXT: ptrue p1.d
2078 ; CHECK_BE-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl]
2079 ; CHECK_BE-NEXT: ld1w { z0.d }, p1/z, [sp, #1, mul vl]
2080 ; CHECK_BE-NEXT: addvl sp, sp, #1
2081 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2082 ; CHECK_BE-NEXT: ret
2083 %bc = bitcast <vscale x 4 x i16> %v to <vscale x 2 x float>
2084 ret <vscale x 2 x float> %bc
2087 define <vscale x 2 x float> @bitcast_nxv2i32_to_nxv2f32(<vscale x 2 x i32> %v) #0 {
2088 ; CHECK-LABEL: bitcast_nxv2i32_to_nxv2f32:
2092 ; CHECK_BE-LABEL: bitcast_nxv2i32_to_nxv2f32:
2093 ; CHECK_BE: // %bb.0:
2094 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2095 ; CHECK_BE-NEXT: addvl sp, sp, #-1
2096 ; CHECK_BE-NEXT: ptrue p0.d
2097 ; CHECK_BE-NEXT: ptrue p1.s
2098 ; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp]
2099 ; CHECK_BE-NEXT: ld1w { z0.s }, p1/z, [sp]
2100 ; CHECK_BE-NEXT: addvl sp, sp, #1
2101 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2102 ; CHECK_BE-NEXT: ret
2103 %bc = bitcast <vscale x 2 x i32> %v to <vscale x 2 x float>
2104 ret <vscale x 2 x float> %bc
2107 define <vscale x 2 x float> @bitcast_nxv1i64_to_nxv2f32(<vscale x 1 x i64> %v) #0 {
2108 ; CHECK-LABEL: bitcast_nxv1i64_to_nxv2f32:
2110 ; CHECK-NEXT: uunpklo z0.d, z0.s
2113 ; CHECK_BE-LABEL: bitcast_nxv1i64_to_nxv2f32:
2114 ; CHECK_BE: // %bb.0:
2115 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2116 ; CHECK_BE-NEXT: addvl sp, sp, #-1
2117 ; CHECK_BE-NEXT: ptrue p0.d
2118 ; CHECK_BE-NEXT: ptrue p1.s
2119 ; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp]
2120 ; CHECK_BE-NEXT: ld1w { z0.s }, p1/z, [sp]
2121 ; CHECK_BE-NEXT: uunpklo z0.d, z0.s
2122 ; CHECK_BE-NEXT: addvl sp, sp, #1
2123 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2124 ; CHECK_BE-NEXT: ret
2125 %bc = bitcast <vscale x 1 x i64> %v to <vscale x 2 x float>
2126 ret <vscale x 2 x float> %bc
2129 define <vscale x 2 x float> @bitcast_nxv4f16_to_nxv2f32(<vscale x 4 x half> %v) #0 {
2130 ; CHECK-LABEL: bitcast_nxv4f16_to_nxv2f32:
2132 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2133 ; CHECK-NEXT: addvl sp, sp, #-1
2134 ; CHECK-NEXT: ptrue p0.s
2135 ; CHECK-NEXT: ptrue p1.d
2136 ; CHECK-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl]
2137 ; CHECK-NEXT: ld1w { z0.d }, p1/z, [sp, #1, mul vl]
2138 ; CHECK-NEXT: addvl sp, sp, #1
2139 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2142 ; CHECK_BE-LABEL: bitcast_nxv4f16_to_nxv2f32:
2143 ; CHECK_BE: // %bb.0:
2144 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2145 ; CHECK_BE-NEXT: addvl sp, sp, #-1
2146 ; CHECK_BE-NEXT: ptrue p0.s
2147 ; CHECK_BE-NEXT: ptrue p1.d
2148 ; CHECK_BE-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl]
2149 ; CHECK_BE-NEXT: ld1w { z0.d }, p1/z, [sp, #1, mul vl]
2150 ; CHECK_BE-NEXT: addvl sp, sp, #1
2151 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2152 ; CHECK_BE-NEXT: ret
2153 %bc = bitcast <vscale x 4 x half> %v to <vscale x 2 x float>
2154 ret <vscale x 2 x float> %bc
2157 define <vscale x 2 x float> @bitcast_nxv1f64_to_nxv2f32(<vscale x 1 x double> %v) #0 {
2158 ; CHECK-LABEL: bitcast_nxv1f64_to_nxv2f32:
2160 ; CHECK-NEXT: uunpklo z0.d, z0.s
2163 ; CHECK_BE-LABEL: bitcast_nxv1f64_to_nxv2f32:
2164 ; CHECK_BE: // %bb.0:
2165 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2166 ; CHECK_BE-NEXT: addvl sp, sp, #-1
2167 ; CHECK_BE-NEXT: ptrue p0.d
2168 ; CHECK_BE-NEXT: ptrue p1.s
2169 ; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp]
2170 ; CHECK_BE-NEXT: ld1w { z0.s }, p1/z, [sp]
2171 ; CHECK_BE-NEXT: uunpklo z0.d, z0.s
2172 ; CHECK_BE-NEXT: addvl sp, sp, #1
2173 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2174 ; CHECK_BE-NEXT: ret
2175 %bc = bitcast <vscale x 1 x double> %v to <vscale x 2 x float>
2176 ret <vscale x 2 x float> %bc
2179 define <vscale x 2 x float> @bitcast_nxv4bf16_to_nxv2f32(<vscale x 4 x bfloat> %v) #0 {
2180 ; CHECK-LABEL: bitcast_nxv4bf16_to_nxv2f32:
2182 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2183 ; CHECK-NEXT: addvl sp, sp, #-1
2184 ; CHECK-NEXT: ptrue p0.s
2185 ; CHECK-NEXT: ptrue p1.d
2186 ; CHECK-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl]
2187 ; CHECK-NEXT: ld1w { z0.d }, p1/z, [sp, #1, mul vl]
2188 ; CHECK-NEXT: addvl sp, sp, #1
2189 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2192 ; CHECK_BE-LABEL: bitcast_nxv4bf16_to_nxv2f32:
2193 ; CHECK_BE: // %bb.0:
2194 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2195 ; CHECK_BE-NEXT: addvl sp, sp, #-1
2196 ; CHECK_BE-NEXT: ptrue p0.s
2197 ; CHECK_BE-NEXT: ptrue p1.d
2198 ; CHECK_BE-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl]
2199 ; CHECK_BE-NEXT: ld1w { z0.d }, p1/z, [sp, #1, mul vl]
2200 ; CHECK_BE-NEXT: addvl sp, sp, #1
2201 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2202 ; CHECK_BE-NEXT: ret
2203 %bc = bitcast <vscale x 4 x bfloat> %v to <vscale x 2 x float>
2204 ret <vscale x 2 x float> %bc
2208 ; bitcast to nxv1f64
2211 define <vscale x 1 x double> @bitcast_nxv8i8_to_nxv1f64(<vscale x 8 x i8> %v) #0 {
2212 ; CHECK-LABEL: bitcast_nxv8i8_to_nxv1f64:
2214 ; CHECK-NEXT: uzp1 z0.b, z0.b, z0.b
2217 ; CHECK_BE-LABEL: bitcast_nxv8i8_to_nxv1f64:
2218 ; CHECK_BE: // %bb.0:
2219 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2220 ; CHECK_BE-NEXT: addvl sp, sp, #-1
2221 ; CHECK_BE-NEXT: uzp1 z0.b, z0.b, z0.b
2222 ; CHECK_BE-NEXT: ptrue p0.b
2223 ; CHECK_BE-NEXT: ptrue p1.d
2224 ; CHECK_BE-NEXT: st1b { z0.b }, p0, [sp]
2225 ; CHECK_BE-NEXT: ld1d { z0.d }, p1/z, [sp]
2226 ; CHECK_BE-NEXT: addvl sp, sp, #1
2227 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2228 ; CHECK_BE-NEXT: ret
2229 %bc = bitcast <vscale x 8 x i8> %v to <vscale x 1 x double>
2230 ret <vscale x 1 x double> %bc
2233 define <vscale x 1 x double> @bitcast_nxv4i16_to_nxv1f64(<vscale x 4 x i16> %v) #0 {
2234 ; CHECK-LABEL: bitcast_nxv4i16_to_nxv1f64:
2236 ; CHECK-NEXT: uzp1 z0.h, z0.h, z0.h
2239 ; CHECK_BE-LABEL: bitcast_nxv4i16_to_nxv1f64:
2240 ; CHECK_BE: // %bb.0:
2241 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2242 ; CHECK_BE-NEXT: addvl sp, sp, #-1
2243 ; CHECK_BE-NEXT: uzp1 z0.h, z0.h, z0.h
2244 ; CHECK_BE-NEXT: ptrue p0.h
2245 ; CHECK_BE-NEXT: ptrue p1.d
2246 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp]
2247 ; CHECK_BE-NEXT: ld1d { z0.d }, p1/z, [sp]
2248 ; CHECK_BE-NEXT: addvl sp, sp, #1
2249 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2250 ; CHECK_BE-NEXT: ret
2251 %bc = bitcast <vscale x 4 x i16> %v to <vscale x 1 x double>
2252 ret <vscale x 1 x double> %bc
2255 define <vscale x 1 x double> @bitcast_nxv2i32_to_nxv1f64(<vscale x 2 x i32> %v) #0 {
2256 ; CHECK-LABEL: bitcast_nxv2i32_to_nxv1f64:
2258 ; CHECK-NEXT: uzp1 z0.s, z0.s, z0.s
2261 ; CHECK_BE-LABEL: bitcast_nxv2i32_to_nxv1f64:
2262 ; CHECK_BE: // %bb.0:
2263 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2264 ; CHECK_BE-NEXT: addvl sp, sp, #-1
2265 ; CHECK_BE-NEXT: uzp1 z0.s, z0.s, z0.s
2266 ; CHECK_BE-NEXT: ptrue p0.s
2267 ; CHECK_BE-NEXT: ptrue p1.d
2268 ; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp]
2269 ; CHECK_BE-NEXT: ld1d { z0.d }, p1/z, [sp]
2270 ; CHECK_BE-NEXT: addvl sp, sp, #1
2271 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2272 ; CHECK_BE-NEXT: ret
2273 %bc = bitcast <vscale x 2 x i32> %v to <vscale x 1 x double>
2274 ret <vscale x 1 x double> %bc
2277 define <vscale x 1 x double> @bitcast_nxv1i64_to_nxv1f64(<vscale x 1 x i64> %v) #0 {
2278 ; CHECK-LABEL: bitcast_nxv1i64_to_nxv1f64:
2282 ; CHECK_BE-LABEL: bitcast_nxv1i64_to_nxv1f64:
2283 ; CHECK_BE: // %bb.0:
2284 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2285 ; CHECK_BE-NEXT: addvl sp, sp, #-1
2286 ; CHECK_BE-NEXT: ptrue p0.d
2287 ; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp]
2288 ; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp]
2289 ; CHECK_BE-NEXT: addvl sp, sp, #1
2290 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2291 ; CHECK_BE-NEXT: ret
2292 %bc = bitcast <vscale x 1 x i64> %v to <vscale x 1 x double>
2293 ret <vscale x 1 x double> %bc
2296 define <vscale x 1 x double> @bitcast_nxv4f16_to_nxv1f64(<vscale x 4 x half> %v) #0 {
2297 ; CHECK-LABEL: bitcast_nxv4f16_to_nxv1f64:
2299 ; CHECK-NEXT: uzp1 z0.h, z0.h, z0.h
2302 ; CHECK_BE-LABEL: bitcast_nxv4f16_to_nxv1f64:
2303 ; CHECK_BE: // %bb.0:
2304 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2305 ; CHECK_BE-NEXT: addvl sp, sp, #-3
2306 ; CHECK_BE-NEXT: ptrue p0.h
2307 ; CHECK_BE-NEXT: ptrue p1.s
2308 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp]
2309 ; CHECK_BE-NEXT: ld1w { z0.s }, p1/z, [sp]
2310 ; CHECK_BE-NEXT: ptrue p1.d
2311 ; CHECK_BE-NEXT: uzp1 z0.h, z0.h, z0.h
2312 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp, #1, mul vl]
2313 ; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp, #1, mul vl]
2314 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp, #2, mul vl]
2315 ; CHECK_BE-NEXT: ld1d { z0.d }, p1/z, [sp, #2, mul vl]
2316 ; CHECK_BE-NEXT: addvl sp, sp, #3
2317 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2318 ; CHECK_BE-NEXT: ret
2319 %bc = bitcast <vscale x 4 x half> %v to <vscale x 1 x double>
2320 ret <vscale x 1 x double> %bc
2323 define <vscale x 1 x double> @bitcast_nxv2f32_to_nxv1f64(<vscale x 2 x float> %v) #0 {
2324 ; CHECK-LABEL: bitcast_nxv2f32_to_nxv1f64:
2326 ; CHECK-NEXT: uzp1 z0.s, z0.s, z0.s
2329 ; CHECK_BE-LABEL: bitcast_nxv2f32_to_nxv1f64:
2330 ; CHECK_BE: // %bb.0:
2331 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2332 ; CHECK_BE-NEXT: addvl sp, sp, #-3
2333 ; CHECK_BE-NEXT: ptrue p0.s
2334 ; CHECK_BE-NEXT: ptrue p1.d
2335 ; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp]
2336 ; CHECK_BE-NEXT: ld1d { z0.d }, p1/z, [sp]
2337 ; CHECK_BE-NEXT: uzp1 z0.s, z0.s, z0.s
2338 ; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp, #1, mul vl]
2339 ; CHECK_BE-NEXT: ld1w { z0.s }, p0/z, [sp, #1, mul vl]
2340 ; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp, #2, mul vl]
2341 ; CHECK_BE-NEXT: ld1d { z0.d }, p1/z, [sp, #2, mul vl]
2342 ; CHECK_BE-NEXT: addvl sp, sp, #3
2343 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2344 ; CHECK_BE-NEXT: ret
2345 %bc = bitcast <vscale x 2 x float> %v to <vscale x 1 x double>
2346 ret <vscale x 1 x double> %bc
2349 define <vscale x 1 x double> @bitcast_nxv4bf16_to_nxv1f64(<vscale x 4 x bfloat> %v) #0 {
2350 ; CHECK-LABEL: bitcast_nxv4bf16_to_nxv1f64:
2352 ; CHECK-NEXT: uzp1 z0.h, z0.h, z0.h
2355 ; CHECK_BE-LABEL: bitcast_nxv4bf16_to_nxv1f64:
2356 ; CHECK_BE: // %bb.0:
2357 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2358 ; CHECK_BE-NEXT: addvl sp, sp, #-3
2359 ; CHECK_BE-NEXT: ptrue p0.h
2360 ; CHECK_BE-NEXT: ptrue p1.s
2361 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp]
2362 ; CHECK_BE-NEXT: ld1w { z0.s }, p1/z, [sp]
2363 ; CHECK_BE-NEXT: ptrue p1.d
2364 ; CHECK_BE-NEXT: uzp1 z0.h, z0.h, z0.h
2365 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp, #1, mul vl]
2366 ; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp, #1, mul vl]
2367 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp, #2, mul vl]
2368 ; CHECK_BE-NEXT: ld1d { z0.d }, p1/z, [sp, #2, mul vl]
2369 ; CHECK_BE-NEXT: addvl sp, sp, #3
2370 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2371 ; CHECK_BE-NEXT: ret
2372 %bc = bitcast <vscale x 4 x bfloat> %v to <vscale x 1 x double>
2373 ret <vscale x 1 x double> %bc
2377 ; bitcast to nxv4bf16
2380 define <vscale x 4 x bfloat> @bitcast_nxv8i8_to_nxv4bf16(<vscale x 8 x i8> %v) #0 {
2381 ; CHECK-LABEL: bitcast_nxv8i8_to_nxv4bf16:
2383 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2384 ; CHECK-NEXT: addvl sp, sp, #-1
2385 ; CHECK-NEXT: ptrue p0.h
2386 ; CHECK-NEXT: ptrue p1.s
2387 ; CHECK-NEXT: st1b { z0.h }, p0, [sp, #1, mul vl]
2388 ; CHECK-NEXT: ld1h { z0.s }, p1/z, [sp, #1, mul vl]
2389 ; CHECK-NEXT: addvl sp, sp, #1
2390 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2393 ; CHECK_BE-LABEL: bitcast_nxv8i8_to_nxv4bf16:
2394 ; CHECK_BE: // %bb.0:
2395 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2396 ; CHECK_BE-NEXT: addvl sp, sp, #-1
2397 ; CHECK_BE-NEXT: ptrue p0.h
2398 ; CHECK_BE-NEXT: ptrue p1.s
2399 ; CHECK_BE-NEXT: st1b { z0.h }, p0, [sp, #1, mul vl]
2400 ; CHECK_BE-NEXT: ld1h { z0.s }, p1/z, [sp, #1, mul vl]
2401 ; CHECK_BE-NEXT: addvl sp, sp, #1
2402 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2403 ; CHECK_BE-NEXT: ret
2404 %bc = bitcast <vscale x 8 x i8> %v to <vscale x 4 x bfloat>
2405 ret <vscale x 4 x bfloat> %bc
2408 define <vscale x 4 x bfloat> @bitcast_nxv4i16_to_nxv4bf16(<vscale x 4 x i16> %v) #0 {
2409 ; CHECK-LABEL: bitcast_nxv4i16_to_nxv4bf16:
2413 ; CHECK_BE-LABEL: bitcast_nxv4i16_to_nxv4bf16:
2414 ; CHECK_BE: // %bb.0:
2415 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2416 ; CHECK_BE-NEXT: addvl sp, sp, #-1
2417 ; CHECK_BE-NEXT: ptrue p0.s
2418 ; CHECK_BE-NEXT: ptrue p1.h
2419 ; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp]
2420 ; CHECK_BE-NEXT: ld1h { z0.h }, p1/z, [sp]
2421 ; CHECK_BE-NEXT: addvl sp, sp, #1
2422 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2423 ; CHECK_BE-NEXT: ret
2424 %bc = bitcast <vscale x 4 x i16> %v to <vscale x 4 x bfloat>
2425 ret <vscale x 4 x bfloat> %bc
2428 define <vscale x 4 x bfloat> @bitcast_nxv2i32_to_nxv4bf16(<vscale x 2 x i32> %v) #0 {
2429 ; CHECK-LABEL: bitcast_nxv2i32_to_nxv4bf16:
2431 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2432 ; CHECK-NEXT: addvl sp, sp, #-1
2433 ; CHECK-NEXT: ptrue p0.d
2434 ; CHECK-NEXT: ptrue p1.s
2435 ; CHECK-NEXT: st1w { z0.d }, p0, [sp, #1, mul vl]
2436 ; CHECK-NEXT: ld1h { z0.s }, p1/z, [sp, #1, mul vl]
2437 ; CHECK-NEXT: addvl sp, sp, #1
2438 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2441 ; CHECK_BE-LABEL: bitcast_nxv2i32_to_nxv4bf16:
2442 ; CHECK_BE: // %bb.0:
2443 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2444 ; CHECK_BE-NEXT: addvl sp, sp, #-1
2445 ; CHECK_BE-NEXT: ptrue p0.d
2446 ; CHECK_BE-NEXT: ptrue p1.s
2447 ; CHECK_BE-NEXT: st1w { z0.d }, p0, [sp, #1, mul vl]
2448 ; CHECK_BE-NEXT: ld1h { z0.s }, p1/z, [sp, #1, mul vl]
2449 ; CHECK_BE-NEXT: addvl sp, sp, #1
2450 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2451 ; CHECK_BE-NEXT: ret
2452 %bc = bitcast <vscale x 2 x i32> %v to <vscale x 4 x bfloat>
2453 ret <vscale x 4 x bfloat> %bc
2456 define <vscale x 4 x bfloat> @bitcast_nxv1i64_to_nxv4bf16(<vscale x 1 x i64> %v) #0 {
2457 ; CHECK-LABEL: bitcast_nxv1i64_to_nxv4bf16:
2459 ; CHECK-NEXT: uunpklo z0.s, z0.h
2462 ; CHECK_BE-LABEL: bitcast_nxv1i64_to_nxv4bf16:
2463 ; CHECK_BE: // %bb.0:
2464 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2465 ; CHECK_BE-NEXT: addvl sp, sp, #-1
2466 ; CHECK_BE-NEXT: ptrue p0.d
2467 ; CHECK_BE-NEXT: ptrue p1.h
2468 ; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp]
2469 ; CHECK_BE-NEXT: ld1h { z0.h }, p1/z, [sp]
2470 ; CHECK_BE-NEXT: uunpklo z0.s, z0.h
2471 ; CHECK_BE-NEXT: addvl sp, sp, #1
2472 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2473 ; CHECK_BE-NEXT: ret
2474 %bc = bitcast <vscale x 1 x i64> %v to <vscale x 4 x bfloat>
2475 ret <vscale x 4 x bfloat> %bc
2478 define <vscale x 4 x bfloat> @bitcast_nxv4f16_to_nxv4bf16(<vscale x 4 x half> %v) #0 {
2479 ; CHECK-LABEL: bitcast_nxv4f16_to_nxv4bf16:
2483 ; CHECK_BE-LABEL: bitcast_nxv4f16_to_nxv4bf16:
2484 ; CHECK_BE: // %bb.0:
2485 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2486 ; CHECK_BE-NEXT: addvl sp, sp, #-1
2487 ; CHECK_BE-NEXT: ptrue p0.s
2488 ; CHECK_BE-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl]
2489 ; CHECK_BE-NEXT: ld1h { z0.s }, p0/z, [sp, #1, mul vl]
2490 ; CHECK_BE-NEXT: addvl sp, sp, #1
2491 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2492 ; CHECK_BE-NEXT: ret
2493 %bc = bitcast <vscale x 4 x half> %v to <vscale x 4 x bfloat>
2494 ret <vscale x 4 x bfloat> %bc
2497 define <vscale x 4 x bfloat> @bitcast_nxv2f32_to_nxv4bf16(<vscale x 2 x float> %v) #0 {
2498 ; CHECK-LABEL: bitcast_nxv2f32_to_nxv4bf16:
2500 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2501 ; CHECK-NEXT: addvl sp, sp, #-1
2502 ; CHECK-NEXT: ptrue p0.d
2503 ; CHECK-NEXT: ptrue p1.s
2504 ; CHECK-NEXT: st1w { z0.d }, p0, [sp, #1, mul vl]
2505 ; CHECK-NEXT: ld1h { z0.s }, p1/z, [sp, #1, mul vl]
2506 ; CHECK-NEXT: addvl sp, sp, #1
2507 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2510 ; CHECK_BE-LABEL: bitcast_nxv2f32_to_nxv4bf16:
2511 ; CHECK_BE: // %bb.0:
2512 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2513 ; CHECK_BE-NEXT: addvl sp, sp, #-1
2514 ; CHECK_BE-NEXT: ptrue p0.d
2515 ; CHECK_BE-NEXT: ptrue p1.s
2516 ; CHECK_BE-NEXT: st1w { z0.d }, p0, [sp, #1, mul vl]
2517 ; CHECK_BE-NEXT: ld1h { z0.s }, p1/z, [sp, #1, mul vl]
2518 ; CHECK_BE-NEXT: addvl sp, sp, #1
2519 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2520 ; CHECK_BE-NEXT: ret
2521 %bc = bitcast <vscale x 2 x float> %v to <vscale x 4 x bfloat>
2522 ret <vscale x 4 x bfloat> %bc
2525 define <vscale x 4 x bfloat> @bitcast_nxv1f64_to_nxv4bf16(<vscale x 1 x double> %v) #0 {
2526 ; CHECK-LABEL: bitcast_nxv1f64_to_nxv4bf16:
2528 ; CHECK-NEXT: uunpklo z0.s, z0.h
2531 ; CHECK_BE-LABEL: bitcast_nxv1f64_to_nxv4bf16:
2532 ; CHECK_BE: // %bb.0:
2533 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2534 ; CHECK_BE-NEXT: addvl sp, sp, #-1
2535 ; CHECK_BE-NEXT: ptrue p0.d
2536 ; CHECK_BE-NEXT: ptrue p1.h
2537 ; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp]
2538 ; CHECK_BE-NEXT: ld1h { z0.h }, p1/z, [sp]
2539 ; CHECK_BE-NEXT: uunpklo z0.s, z0.h
2540 ; CHECK_BE-NEXT: addvl sp, sp, #1
2541 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2542 ; CHECK_BE-NEXT: ret
2543 %bc = bitcast <vscale x 1 x double> %v to <vscale x 4 x bfloat>
2544 ret <vscale x 4 x bfloat> %bc
2551 define <vscale x 4 x i8> @bitcast_nxv2i16_to_nxv4i8(<vscale x 2 x i16> %v) #0 {
2552 ; CHECK-LABEL: bitcast_nxv2i16_to_nxv4i8:
2554 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2555 ; CHECK-NEXT: addvl sp, sp, #-1
2556 ; CHECK-NEXT: ptrue p0.d
2557 ; CHECK-NEXT: ptrue p1.s
2558 ; CHECK-NEXT: st1h { z0.d }, p0, [sp, #3, mul vl]
2559 ; CHECK-NEXT: ld1b { z0.s }, p1/z, [sp, #3, mul vl]
2560 ; CHECK-NEXT: addvl sp, sp, #1
2561 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2564 ; CHECK_BE-LABEL: bitcast_nxv2i16_to_nxv4i8:
2565 ; CHECK_BE: // %bb.0:
2566 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2567 ; CHECK_BE-NEXT: addvl sp, sp, #-1
2568 ; CHECK_BE-NEXT: ptrue p0.d
2569 ; CHECK_BE-NEXT: ptrue p1.s
2570 ; CHECK_BE-NEXT: st1h { z0.d }, p0, [sp, #3, mul vl]
2571 ; CHECK_BE-NEXT: ld1b { z0.s }, p1/z, [sp, #3, mul vl]
2572 ; CHECK_BE-NEXT: addvl sp, sp, #1
2573 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2574 ; CHECK_BE-NEXT: ret
2575 %bc = bitcast <vscale x 2 x i16> %v to <vscale x 4 x i8>
2576 ret <vscale x 4 x i8> %bc
2579 define <vscale x 4 x i8> @bitcast_nxv1i32_to_nxv4i8(<vscale x 1 x i32> %v) #0 {
2580 ; CHECK-LABEL: bitcast_nxv1i32_to_nxv4i8:
2582 ; CHECK-NEXT: uunpklo z0.h, z0.b
2583 ; CHECK-NEXT: uunpklo z0.s, z0.h
2586 ; CHECK_BE-LABEL: bitcast_nxv1i32_to_nxv4i8:
2587 ; CHECK_BE: // %bb.0:
2588 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2589 ; CHECK_BE-NEXT: addvl sp, sp, #-1
2590 ; CHECK_BE-NEXT: ptrue p0.s
2591 ; CHECK_BE-NEXT: ptrue p1.b
2592 ; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp]
2593 ; CHECK_BE-NEXT: ld1b { z0.b }, p1/z, [sp]
2594 ; CHECK_BE-NEXT: uunpklo z0.h, z0.b
2595 ; CHECK_BE-NEXT: uunpklo z0.s, z0.h
2596 ; CHECK_BE-NEXT: addvl sp, sp, #1
2597 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2598 ; CHECK_BE-NEXT: ret
2599 %bc = bitcast <vscale x 1 x i32> %v to <vscale x 4 x i8>
2600 ret <vscale x 4 x i8> %bc
2603 define <vscale x 4 x i8> @bitcast_nxv2f16_to_nxv4i8(<vscale x 2 x half> %v) #0 {
2604 ; CHECK-LABEL: bitcast_nxv2f16_to_nxv4i8:
2606 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2607 ; CHECK-NEXT: addvl sp, sp, #-1
2608 ; CHECK-NEXT: ptrue p0.d
2609 ; CHECK-NEXT: ptrue p1.s
2610 ; CHECK-NEXT: st1h { z0.d }, p0, [sp, #3, mul vl]
2611 ; CHECK-NEXT: ld1b { z0.s }, p1/z, [sp, #3, mul vl]
2612 ; CHECK-NEXT: addvl sp, sp, #1
2613 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2616 ; CHECK_BE-LABEL: bitcast_nxv2f16_to_nxv4i8:
2617 ; CHECK_BE: // %bb.0:
2618 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2619 ; CHECK_BE-NEXT: addvl sp, sp, #-1
2620 ; CHECK_BE-NEXT: ptrue p0.d
2621 ; CHECK_BE-NEXT: ptrue p1.s
2622 ; CHECK_BE-NEXT: st1h { z0.d }, p0, [sp, #3, mul vl]
2623 ; CHECK_BE-NEXT: ld1b { z0.s }, p1/z, [sp, #3, mul vl]
2624 ; CHECK_BE-NEXT: addvl sp, sp, #1
2625 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2626 ; CHECK_BE-NEXT: ret
2627 %bc = bitcast <vscale x 2 x half> %v to <vscale x 4 x i8>
2628 ret <vscale x 4 x i8> %bc
2631 ; @bitcast_nxv1f32_to_nxv4i8 is missing
2633 define <vscale x 4 x i8> @bitcast_nxv2bf16_to_nxv4i8(<vscale x 2 x bfloat> %v) #0 {
2634 ; CHECK-LABEL: bitcast_nxv2bf16_to_nxv4i8:
2636 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2637 ; CHECK-NEXT: addvl sp, sp, #-1
2638 ; CHECK-NEXT: ptrue p0.d
2639 ; CHECK-NEXT: ptrue p1.s
2640 ; CHECK-NEXT: st1h { z0.d }, p0, [sp, #3, mul vl]
2641 ; CHECK-NEXT: ld1b { z0.s }, p1/z, [sp, #3, mul vl]
2642 ; CHECK-NEXT: addvl sp, sp, #1
2643 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2646 ; CHECK_BE-LABEL: bitcast_nxv2bf16_to_nxv4i8:
2647 ; CHECK_BE: // %bb.0:
2648 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2649 ; CHECK_BE-NEXT: addvl sp, sp, #-1
2650 ; CHECK_BE-NEXT: ptrue p0.d
2651 ; CHECK_BE-NEXT: ptrue p1.s
2652 ; CHECK_BE-NEXT: st1h { z0.d }, p0, [sp, #3, mul vl]
2653 ; CHECK_BE-NEXT: ld1b { z0.s }, p1/z, [sp, #3, mul vl]
2654 ; CHECK_BE-NEXT: addvl sp, sp, #1
2655 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2656 ; CHECK_BE-NEXT: ret
2657 %bc = bitcast <vscale x 2 x bfloat> %v to <vscale x 4 x i8>
2658 ret <vscale x 4 x i8> %bc
2662 ; bitcast to nxv2i16
2665 define <vscale x 2 x i16> @bitcast_nxv4i8_to_nxv2i16(<vscale x 4 x i8> %v) #0 {
2666 ; CHECK-LABEL: bitcast_nxv4i8_to_nxv2i16:
2668 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2669 ; CHECK-NEXT: addvl sp, sp, #-1
2670 ; CHECK-NEXT: ptrue p0.s
2671 ; CHECK-NEXT: ptrue p1.d
2672 ; CHECK-NEXT: st1b { z0.s }, p0, [sp, #3, mul vl]
2673 ; CHECK-NEXT: ld1h { z0.d }, p1/z, [sp, #3, mul vl]
2674 ; CHECK-NEXT: addvl sp, sp, #1
2675 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2678 ; CHECK_BE-LABEL: bitcast_nxv4i8_to_nxv2i16:
2679 ; CHECK_BE: // %bb.0:
2680 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2681 ; CHECK_BE-NEXT: addvl sp, sp, #-1
2682 ; CHECK_BE-NEXT: ptrue p0.s
2683 ; CHECK_BE-NEXT: ptrue p1.d
2684 ; CHECK_BE-NEXT: st1b { z0.s }, p0, [sp, #3, mul vl]
2685 ; CHECK_BE-NEXT: ld1h { z0.d }, p1/z, [sp, #3, mul vl]
2686 ; CHECK_BE-NEXT: addvl sp, sp, #1
2687 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2688 ; CHECK_BE-NEXT: ret
2689 %bc = bitcast <vscale x 4 x i8> %v to <vscale x 2 x i16>
2690 ret <vscale x 2 x i16> %bc
2693 define <vscale x 2 x i16> @bitcast_nxv1i32_to_nxv2i16(<vscale x 1 x i32> %v) #0 {
2694 ; CHECK-LABEL: bitcast_nxv1i32_to_nxv2i16:
2696 ; CHECK-NEXT: uunpklo z0.s, z0.h
2697 ; CHECK-NEXT: uunpklo z0.d, z0.s
2700 ; CHECK_BE-LABEL: bitcast_nxv1i32_to_nxv2i16:
2701 ; CHECK_BE: // %bb.0:
2702 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2703 ; CHECK_BE-NEXT: addvl sp, sp, #-1
2704 ; CHECK_BE-NEXT: ptrue p0.s
2705 ; CHECK_BE-NEXT: ptrue p1.h
2706 ; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp]
2707 ; CHECK_BE-NEXT: ld1h { z0.h }, p1/z, [sp]
2708 ; CHECK_BE-NEXT: uunpklo z0.s, z0.h
2709 ; CHECK_BE-NEXT: uunpklo z0.d, z0.s
2710 ; CHECK_BE-NEXT: addvl sp, sp, #1
2711 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2712 ; CHECK_BE-NEXT: ret
2713 %bc = bitcast <vscale x 1 x i32> %v to <vscale x 2 x i16>
2714 ret <vscale x 2 x i16> %bc
2717 define <vscale x 2 x i16> @bitcast_nxv2f16_to_nxv2i16(<vscale x 2 x half> %v) #0 {
2718 ; CHECK-LABEL: bitcast_nxv2f16_to_nxv2i16:
2722 ; CHECK_BE-LABEL: bitcast_nxv2f16_to_nxv2i16:
2723 ; CHECK_BE: // %bb.0:
2724 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2725 ; CHECK_BE-NEXT: addvl sp, sp, #-1
2726 ; CHECK_BE-NEXT: ptrue p0.h
2727 ; CHECK_BE-NEXT: ptrue p1.d
2728 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp]
2729 ; CHECK_BE-NEXT: ld1d { z0.d }, p1/z, [sp]
2730 ; CHECK_BE-NEXT: addvl sp, sp, #1
2731 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2732 ; CHECK_BE-NEXT: ret
2733 %bc = bitcast <vscale x 2 x half> %v to <vscale x 2 x i16>
2734 ret <vscale x 2 x i16> %bc
2737 ; @bitcast_nxv1f32_to_nxv2i16 is missing
2739 define <vscale x 2 x i16> @bitcast_nxv2bf16_to_nxv2i16(<vscale x 2 x bfloat> %v) #0 {
2740 ; CHECK-LABEL: bitcast_nxv2bf16_to_nxv2i16:
2744 ; CHECK_BE-LABEL: bitcast_nxv2bf16_to_nxv2i16:
2745 ; CHECK_BE: // %bb.0:
2746 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2747 ; CHECK_BE-NEXT: addvl sp, sp, #-1
2748 ; CHECK_BE-NEXT: ptrue p0.h
2749 ; CHECK_BE-NEXT: ptrue p1.d
2750 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp]
2751 ; CHECK_BE-NEXT: ld1d { z0.d }, p1/z, [sp]
2752 ; CHECK_BE-NEXT: addvl sp, sp, #1
2753 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2754 ; CHECK_BE-NEXT: ret
2755 %bc = bitcast <vscale x 2 x bfloat> %v to <vscale x 2 x i16>
2756 ret <vscale x 2 x i16> %bc
2760 ; bitcast to nxv1i32
2763 define <vscale x 1 x i32> @bitcast_nxv4i8_to_nxv1i32(<vscale x 4 x i8> %v) #0 {
2764 ; CHECK-LABEL: bitcast_nxv4i8_to_nxv1i32:
2766 ; CHECK-NEXT: uzp1 z0.h, z0.h, z0.h
2767 ; CHECK-NEXT: uzp1 z0.b, z0.b, z0.b
2770 ; CHECK_BE-LABEL: bitcast_nxv4i8_to_nxv1i32:
2771 ; CHECK_BE: // %bb.0:
2772 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2773 ; CHECK_BE-NEXT: addvl sp, sp, #-1
2774 ; CHECK_BE-NEXT: uzp1 z0.h, z0.h, z0.h
2775 ; CHECK_BE-NEXT: ptrue p0.b
2776 ; CHECK_BE-NEXT: ptrue p1.s
2777 ; CHECK_BE-NEXT: uzp1 z0.b, z0.b, z0.b
2778 ; CHECK_BE-NEXT: st1b { z0.b }, p0, [sp]
2779 ; CHECK_BE-NEXT: ld1w { z0.s }, p1/z, [sp]
2780 ; CHECK_BE-NEXT: addvl sp, sp, #1
2781 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2782 ; CHECK_BE-NEXT: ret
2783 %bc = bitcast <vscale x 4 x i8> %v to <vscale x 1 x i32>
2784 ret <vscale x 1 x i32> %bc
2787 define <vscale x 1 x i32> @bitcast_nxv2i16_to_nxv1i32(<vscale x 2 x i16> %v) #0 {
2788 ; CHECK-LABEL: bitcast_nxv2i16_to_nxv1i32:
2790 ; CHECK-NEXT: uzp1 z0.s, z0.s, z0.s
2791 ; CHECK-NEXT: uzp1 z0.h, z0.h, z0.h
2794 ; CHECK_BE-LABEL: bitcast_nxv2i16_to_nxv1i32:
2795 ; CHECK_BE: // %bb.0:
2796 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2797 ; CHECK_BE-NEXT: addvl sp, sp, #-1
2798 ; CHECK_BE-NEXT: uzp1 z0.s, z0.s, z0.s
2799 ; CHECK_BE-NEXT: ptrue p0.h
2800 ; CHECK_BE-NEXT: ptrue p1.s
2801 ; CHECK_BE-NEXT: uzp1 z0.h, z0.h, z0.h
2802 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp]
2803 ; CHECK_BE-NEXT: ld1w { z0.s }, p1/z, [sp]
2804 ; CHECK_BE-NEXT: addvl sp, sp, #1
2805 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2806 ; CHECK_BE-NEXT: ret
2807 %bc = bitcast <vscale x 2 x i16> %v to <vscale x 1 x i32>
2808 ret <vscale x 1 x i32> %bc
2811 define <vscale x 1 x i32> @bitcast_nxv2f16_to_nxv1i32(<vscale x 2 x half> %v) #0 {
2812 ; CHECK-LABEL: bitcast_nxv2f16_to_nxv1i32:
2814 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2815 ; CHECK-NEXT: addvl sp, sp, #-1
2816 ; CHECK-NEXT: ptrue p0.d
2817 ; CHECK-NEXT: ptrue p1.s
2818 ; CHECK-NEXT: st1h { z0.d }, p0, [sp]
2819 ; CHECK-NEXT: ld1w { z0.s }, p1/z, [sp]
2820 ; CHECK-NEXT: addvl sp, sp, #1
2821 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2824 ; CHECK_BE-LABEL: bitcast_nxv2f16_to_nxv1i32:
2825 ; CHECK_BE: // %bb.0:
2826 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2827 ; CHECK_BE-NEXT: addvl sp, sp, #-2
2828 ; CHECK_BE-NEXT: ptrue p0.d
2829 ; CHECK_BE-NEXT: ptrue p1.h
2830 ; CHECK_BE-NEXT: st1h { z0.d }, p0, [sp]
2831 ; CHECK_BE-NEXT: ptrue p0.s
2832 ; CHECK_BE-NEXT: ld1h { z0.h }, p1/z, [sp]
2833 ; CHECK_BE-NEXT: st1h { z0.h }, p1, [sp, #1, mul vl]
2834 ; CHECK_BE-NEXT: ld1w { z0.s }, p0/z, [sp, #1, mul vl]
2835 ; CHECK_BE-NEXT: addvl sp, sp, #2
2836 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2837 ; CHECK_BE-NEXT: ret
2838 %bc = bitcast <vscale x 2 x half> %v to <vscale x 1 x i32>
2839 ret <vscale x 1 x i32> %bc
2842 ; @bitcast_nxv1f32_to_nxv1i32 is missing
2844 define <vscale x 1 x i32> @bitcast_nxv2bf16_to_nxv1i32(<vscale x 2 x bfloat> %v) #0 {
2845 ; CHECK-LABEL: bitcast_nxv2bf16_to_nxv1i32:
2847 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2848 ; CHECK-NEXT: addvl sp, sp, #-1
2849 ; CHECK-NEXT: ptrue p0.d
2850 ; CHECK-NEXT: ptrue p1.s
2851 ; CHECK-NEXT: st1h { z0.d }, p0, [sp]
2852 ; CHECK-NEXT: ld1w { z0.s }, p1/z, [sp]
2853 ; CHECK-NEXT: addvl sp, sp, #1
2854 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2857 ; CHECK_BE-LABEL: bitcast_nxv2bf16_to_nxv1i32:
2858 ; CHECK_BE: // %bb.0:
2859 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2860 ; CHECK_BE-NEXT: addvl sp, sp, #-2
2861 ; CHECK_BE-NEXT: ptrue p0.d
2862 ; CHECK_BE-NEXT: ptrue p1.h
2863 ; CHECK_BE-NEXT: st1h { z0.d }, p0, [sp]
2864 ; CHECK_BE-NEXT: ptrue p0.s
2865 ; CHECK_BE-NEXT: ld1h { z0.h }, p1/z, [sp]
2866 ; CHECK_BE-NEXT: st1h { z0.h }, p1, [sp, #1, mul vl]
2867 ; CHECK_BE-NEXT: ld1w { z0.s }, p0/z, [sp, #1, mul vl]
2868 ; CHECK_BE-NEXT: addvl sp, sp, #2
2869 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2870 ; CHECK_BE-NEXT: ret
2871 %bc = bitcast <vscale x 2 x bfloat> %v to <vscale x 1 x i32>
2872 ret <vscale x 1 x i32> %bc
2876 ; bitcast to nxv2f16
2879 define <vscale x 2 x half> @bitcast_nxv4i8_to_nxv2f16(<vscale x 4 x i8> %v) #0 {
2880 ; CHECK-LABEL: bitcast_nxv4i8_to_nxv2f16:
2882 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2883 ; CHECK-NEXT: addvl sp, sp, #-1
2884 ; CHECK-NEXT: ptrue p0.s
2885 ; CHECK-NEXT: ptrue p1.d
2886 ; CHECK-NEXT: st1b { z0.s }, p0, [sp, #3, mul vl]
2887 ; CHECK-NEXT: ld1h { z0.d }, p1/z, [sp, #3, mul vl]
2888 ; CHECK-NEXT: addvl sp, sp, #1
2889 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2892 ; CHECK_BE-LABEL: bitcast_nxv4i8_to_nxv2f16:
2893 ; CHECK_BE: // %bb.0:
2894 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2895 ; CHECK_BE-NEXT: addvl sp, sp, #-1
2896 ; CHECK_BE-NEXT: ptrue p0.s
2897 ; CHECK_BE-NEXT: ptrue p1.d
2898 ; CHECK_BE-NEXT: st1b { z0.s }, p0, [sp, #3, mul vl]
2899 ; CHECK_BE-NEXT: ld1h { z0.d }, p1/z, [sp, #3, mul vl]
2900 ; CHECK_BE-NEXT: addvl sp, sp, #1
2901 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2902 ; CHECK_BE-NEXT: ret
2903 %bc = bitcast <vscale x 4 x i8> %v to <vscale x 2 x half>
2904 ret <vscale x 2 x half> %bc
2907 define <vscale x 2 x half> @bitcast_nxv2i16_to_nxv2f16(<vscale x 2 x i16> %v) #0 {
2908 ; CHECK-LABEL: bitcast_nxv2i16_to_nxv2f16:
2912 ; CHECK_BE-LABEL: bitcast_nxv2i16_to_nxv2f16:
2913 ; CHECK_BE: // %bb.0:
2914 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2915 ; CHECK_BE-NEXT: addvl sp, sp, #-1
2916 ; CHECK_BE-NEXT: ptrue p0.d
2917 ; CHECK_BE-NEXT: ptrue p1.h
2918 ; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp]
2919 ; CHECK_BE-NEXT: ld1h { z0.h }, p1/z, [sp]
2920 ; CHECK_BE-NEXT: addvl sp, sp, #1
2921 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2922 ; CHECK_BE-NEXT: ret
2923 %bc = bitcast <vscale x 2 x i16> %v to <vscale x 2 x half>
2924 ret <vscale x 2 x half> %bc
2927 ; @bitcast_nxv1i32_to_nxv2f16 is missing
2928 ; @bitcast_nxv1f32_to_nxv2f16 is missing
2930 define <vscale x 2 x half> @bitcast_nxv2bf16_to_nxv2f16(<vscale x 2 x bfloat> %v) #0 {
2931 ; CHECK-LABEL: bitcast_nxv2bf16_to_nxv2f16:
2935 ; CHECK_BE-LABEL: bitcast_nxv2bf16_to_nxv2f16:
2936 ; CHECK_BE: // %bb.0:
2937 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2938 ; CHECK_BE-NEXT: addvl sp, sp, #-1
2939 ; CHECK_BE-NEXT: ptrue p0.d
2940 ; CHECK_BE-NEXT: st1h { z0.d }, p0, [sp, #3, mul vl]
2941 ; CHECK_BE-NEXT: ld1h { z0.d }, p0/z, [sp, #3, mul vl]
2942 ; CHECK_BE-NEXT: addvl sp, sp, #1
2943 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2944 ; CHECK_BE-NEXT: ret
2945 %bc = bitcast <vscale x 2 x bfloat> %v to <vscale x 2 x half>
2946 ret <vscale x 2 x half> %bc
2950 ; bitcast to nxv1f32
2953 ; @bitcast_nxv4i8_to_nxv1f32 is missing
2954 ; @bitcast_nxv2i16_to_nxv1f32 is missing
2955 ; @bitcast_nxv1i32_to_nxv1f32 is missing
2956 ; @bitcast_nxv2f16_to_nxv1f32 is missing
2957 ; @bitcast_nxv2bf16_to_nxv1f32 is missing
2960 ; bitcast to nxv2bf16
2963 define <vscale x 2 x bfloat> @bitcast_nxv4i8_to_nxv2bf16(<vscale x 4 x i8> %v) #0 {
2964 ; CHECK-LABEL: bitcast_nxv4i8_to_nxv2bf16:
2966 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2967 ; CHECK-NEXT: addvl sp, sp, #-1
2968 ; CHECK-NEXT: ptrue p0.s
2969 ; CHECK-NEXT: ptrue p1.d
2970 ; CHECK-NEXT: st1b { z0.s }, p0, [sp, #3, mul vl]
2971 ; CHECK-NEXT: ld1h { z0.d }, p1/z, [sp, #3, mul vl]
2972 ; CHECK-NEXT: addvl sp, sp, #1
2973 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2976 ; CHECK_BE-LABEL: bitcast_nxv4i8_to_nxv2bf16:
2977 ; CHECK_BE: // %bb.0:
2978 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2979 ; CHECK_BE-NEXT: addvl sp, sp, #-1
2980 ; CHECK_BE-NEXT: ptrue p0.s
2981 ; CHECK_BE-NEXT: ptrue p1.d
2982 ; CHECK_BE-NEXT: st1b { z0.s }, p0, [sp, #3, mul vl]
2983 ; CHECK_BE-NEXT: ld1h { z0.d }, p1/z, [sp, #3, mul vl]
2984 ; CHECK_BE-NEXT: addvl sp, sp, #1
2985 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
2986 ; CHECK_BE-NEXT: ret
2987 %bc = bitcast <vscale x 4 x i8> %v to <vscale x 2 x bfloat>
2988 ret <vscale x 2 x bfloat> %bc
2991 define <vscale x 2 x bfloat> @bitcast_nxv2i16_to_nxv2bf16(<vscale x 2 x i16> %v) #0 {
2992 ; CHECK-LABEL: bitcast_nxv2i16_to_nxv2bf16:
2996 ; CHECK_BE-LABEL: bitcast_nxv2i16_to_nxv2bf16:
2997 ; CHECK_BE: // %bb.0:
2998 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
2999 ; CHECK_BE-NEXT: addvl sp, sp, #-1
3000 ; CHECK_BE-NEXT: ptrue p0.d
3001 ; CHECK_BE-NEXT: ptrue p1.h
3002 ; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp]
3003 ; CHECK_BE-NEXT: ld1h { z0.h }, p1/z, [sp]
3004 ; CHECK_BE-NEXT: addvl sp, sp, #1
3005 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
3006 ; CHECK_BE-NEXT: ret
3007 %bc = bitcast <vscale x 2 x i16> %v to <vscale x 2 x bfloat>
3008 ret <vscale x 2 x bfloat> %bc
3011 ; @bitcast_nxv1i32_to_nxv2bf16 is missing
3013 define <vscale x 2 x bfloat> @bitcast_nxv2f16_to_nxv2bf16(<vscale x 2 x half> %v) #0 {
3014 ; CHECK-LABEL: bitcast_nxv2f16_to_nxv2bf16:
3018 ; CHECK_BE-LABEL: bitcast_nxv2f16_to_nxv2bf16:
3019 ; CHECK_BE: // %bb.0:
3020 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
3021 ; CHECK_BE-NEXT: addvl sp, sp, #-1
3022 ; CHECK_BE-NEXT: ptrue p0.d
3023 ; CHECK_BE-NEXT: st1h { z0.d }, p0, [sp, #3, mul vl]
3024 ; CHECK_BE-NEXT: ld1h { z0.d }, p0/z, [sp, #3, mul vl]
3025 ; CHECK_BE-NEXT: addvl sp, sp, #1
3026 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
3027 ; CHECK_BE-NEXT: ret
3028 %bc = bitcast <vscale x 2 x half> %v to <vscale x 2 x bfloat>
3029 ret <vscale x 2 x bfloat> %bc
3032 ; @bitcast_nxv1f32_to_nxv2bf16 is missing
3038 define <vscale x 2 x i8> @bitcast_nxv1i16_to_nxv2i8(<vscale x 1 x i16> %v) #0 {
3039 ; CHECK-LABEL: bitcast_nxv1i16_to_nxv2i8:
3041 ; CHECK-NEXT: uunpklo z0.h, z0.b
3042 ; CHECK-NEXT: uunpklo z0.s, z0.h
3043 ; CHECK-NEXT: uunpklo z0.d, z0.s
3046 ; CHECK_BE-LABEL: bitcast_nxv1i16_to_nxv2i8:
3047 ; CHECK_BE: // %bb.0:
3048 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
3049 ; CHECK_BE-NEXT: addvl sp, sp, #-1
3050 ; CHECK_BE-NEXT: ptrue p0.h
3051 ; CHECK_BE-NEXT: ptrue p1.b
3052 ; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp]
3053 ; CHECK_BE-NEXT: ld1b { z0.b }, p1/z, [sp]
3054 ; CHECK_BE-NEXT: uunpklo z0.h, z0.b
3055 ; CHECK_BE-NEXT: uunpklo z0.s, z0.h
3056 ; CHECK_BE-NEXT: uunpklo z0.d, z0.s
3057 ; CHECK_BE-NEXT: addvl sp, sp, #1
3058 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
3059 ; CHECK_BE-NEXT: ret
3060 %bc = bitcast <vscale x 1 x i16> %v to <vscale x 2 x i8>
3061 ret <vscale x 2 x i8> %bc
3064 ; @bitcast_nxv1f16_to_nxv2i8 is missing
3065 ; @bitcast_nxv1bf16_to_nxv2i8 is missing
3068 ; bitcast to nxv1i16
3071 define <vscale x 1 x i16> @bitcast_nxv2i8_to_nxv1i16(<vscale x 2 x i8> %v) #0 {
3072 ; CHECK-LABEL: bitcast_nxv2i8_to_nxv1i16:
3074 ; CHECK-NEXT: uzp1 z0.s, z0.s, z0.s
3075 ; CHECK-NEXT: uzp1 z0.h, z0.h, z0.h
3076 ; CHECK-NEXT: uzp1 z0.b, z0.b, z0.b
3079 ; CHECK_BE-LABEL: bitcast_nxv2i8_to_nxv1i16:
3080 ; CHECK_BE: // %bb.0:
3081 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
3082 ; CHECK_BE-NEXT: addvl sp, sp, #-1
3083 ; CHECK_BE-NEXT: uzp1 z0.s, z0.s, z0.s
3084 ; CHECK_BE-NEXT: ptrue p0.b
3085 ; CHECK_BE-NEXT: ptrue p1.h
3086 ; CHECK_BE-NEXT: uzp1 z0.h, z0.h, z0.h
3087 ; CHECK_BE-NEXT: uzp1 z0.b, z0.b, z0.b
3088 ; CHECK_BE-NEXT: st1b { z0.b }, p0, [sp]
3089 ; CHECK_BE-NEXT: ld1h { z0.h }, p1/z, [sp]
3090 ; CHECK_BE-NEXT: addvl sp, sp, #1
3091 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
3092 ; CHECK_BE-NEXT: ret
3093 %bc = bitcast <vscale x 2 x i8> %v to <vscale x 1 x i16>
3094 ret <vscale x 1 x i16> %bc
3097 ; @bitcast_nxv1f16_to_nxv1i16 is missing
3098 ; @bitcast_nxv1bf16_to_nxv1i16 is missing
3101 ; bitcast to nxv1f16
3104 ; @bitcast_nxv2i8_to_nxv1f16 is missing
3105 ; @bitcast_nxv1i16_to_nxv1f16 is missing
3106 ; @bitcast_nxv1bf16_to_nxv1f16 is missing
3109 ; bitcast to nxv1bf16
3112 ; @bitcast_nxv2i8_to_nxv1bf16 is missing
3113 ; @bitcast_nxv1i16_to_nxv1bf16 is missing
3114 ; @bitcast_nxv1f16_to_nxv1bf16 is missing
3120 define <vscale x 2 x i32> @bitcast_short_float_to_i32(<vscale x 2 x double> %v) #0 {
3121 ; CHECK-LABEL: bitcast_short_float_to_i32:
3123 ; CHECK-NEXT: ptrue p0.d
3124 ; CHECK-NEXT: fcvt z0.s, p0/m, z0.d
3127 ; CHECK_BE-LABEL: bitcast_short_float_to_i32:
3128 ; CHECK_BE: // %bb.0:
3129 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
3130 ; CHECK_BE-NEXT: addvl sp, sp, #-1
3131 ; CHECK_BE-NEXT: ptrue p0.d
3132 ; CHECK_BE-NEXT: ptrue p1.s
3133 ; CHECK_BE-NEXT: fcvt z0.s, p0/m, z0.d
3134 ; CHECK_BE-NEXT: st1w { z0.s }, p1, [sp]
3135 ; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp]
3136 ; CHECK_BE-NEXT: addvl sp, sp, #1
3137 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
3138 ; CHECK_BE-NEXT: ret
3139 %trunc = fptrunc <vscale x 2 x double> %v to <vscale x 2 x float>
3140 %bitcast = bitcast <vscale x 2 x float> %trunc to <vscale x 2 x i32>
3141 ret <vscale x 2 x i32> %bitcast
3144 define <vscale x 2 x double> @bitcast_short_i32_to_float(<vscale x 2 x i64> %v) #0 {
3145 ; CHECK-LABEL: bitcast_short_i32_to_float:
3147 ; CHECK-NEXT: ptrue p0.d
3148 ; CHECK-NEXT: fcvt z0.d, p0/m, z0.s
3151 ; CHECK_BE-LABEL: bitcast_short_i32_to_float:
3152 ; CHECK_BE: // %bb.0:
3153 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
3154 ; CHECK_BE-NEXT: addvl sp, sp, #-1
3155 ; CHECK_BE-NEXT: ptrue p0.d
3156 ; CHECK_BE-NEXT: ptrue p1.s
3157 ; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp]
3158 ; CHECK_BE-NEXT: ld1w { z0.s }, p1/z, [sp]
3159 ; CHECK_BE-NEXT: fcvt z0.d, p0/m, z0.s
3160 ; CHECK_BE-NEXT: addvl sp, sp, #1
3161 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
3162 ; CHECK_BE-NEXT: ret
3163 %trunc = trunc <vscale x 2 x i64> %v to <vscale x 2 x i32>
3164 %bitcast = bitcast <vscale x 2 x i32> %trunc to <vscale x 2 x float>
3165 %extended = fpext <vscale x 2 x float> %bitcast to <vscale x 2 x double>
3166 ret <vscale x 2 x double> %extended
3169 define <vscale x 2 x float> @bitcast_short_half_to_float(<vscale x 4 x half> %v) #0 {
3170 ; CHECK-LABEL: bitcast_short_half_to_float:
3172 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
3173 ; CHECK-NEXT: addvl sp, sp, #-1
3174 ; CHECK-NEXT: ptrue p0.s
3175 ; CHECK-NEXT: ptrue p1.d
3176 ; CHECK-NEXT: fadd z0.h, p0/m, z0.h, z0.h
3177 ; CHECK-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl]
3178 ; CHECK-NEXT: ld1w { z0.d }, p1/z, [sp, #1, mul vl]
3179 ; CHECK-NEXT: addvl sp, sp, #1
3180 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
3183 ; CHECK_BE-LABEL: bitcast_short_half_to_float:
3184 ; CHECK_BE: // %bb.0:
3185 ; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
3186 ; CHECK_BE-NEXT: addvl sp, sp, #-1
3187 ; CHECK_BE-NEXT: ptrue p0.s
3188 ; CHECK_BE-NEXT: ptrue p1.d
3189 ; CHECK_BE-NEXT: fadd z0.h, p0/m, z0.h, z0.h
3190 ; CHECK_BE-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl]
3191 ; CHECK_BE-NEXT: ld1w { z0.d }, p1/z, [sp, #1, mul vl]
3192 ; CHECK_BE-NEXT: addvl sp, sp, #1
3193 ; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
3194 ; CHECK_BE-NEXT: ret
3195 %add = fadd <vscale x 4 x half> %v, %v
3196 %bitcast = bitcast <vscale x 4 x half> %add to <vscale x 2 x float>
3197 ret <vscale x 2 x float> %bitcast
3200 ; +bf16 is required for the bfloat version.
3201 attributes #0 = { nounwind "target-features"="+sve,+bf16" }