1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=arm64-eabi -aarch64-neon-syntax=apple | FileCheck %s --check-prefixes=CHECK,CHECK-SD
3 ; RUN: llc < %s -mtriple=arm64-eabi -aarch64-neon-syntax=apple -global-isel -global-isel-abort=2 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-GI
5 ; Test efficient codegen of vector extends up from legal type to 128 bit
6 ; and 256 bit vector types.
8 ; CHECK-GI: warning: Instruction selection used fallback path for zext_v32i1
9 ; CHECK-GI-NEXT: warning: Instruction selection used fallback path for sext_v32i1
10 ; CHECK-GI-NEXT: warning: Instruction selection used fallback path for zext_v64i1
11 ; CHECK-GI-NEXT: warning: Instruction selection used fallback path for sext_v64i1
17 define <8 x i16> @func1(<8 x i8> %v0) nounwind {
20 ; CHECK-NEXT: ushll.8h v0, v0, #0
22 %r = zext <8 x i8> %v0 to <8 x i16>
26 define <8 x i16> @func2(<8 x i8> %v0) nounwind {
29 ; CHECK-NEXT: sshll.8h v0, v0, #0
31 %r = sext <8 x i8> %v0 to <8 x i16>
35 define <16 x i16> @func3(<16 x i8> %v0) nounwind {
36 ; CHECK-SD-LABEL: func3:
38 ; CHECK-SD-NEXT: ushll2.8h v1, v0, #0
39 ; CHECK-SD-NEXT: ushll.8h v0, v0, #0
42 ; CHECK-GI-LABEL: func3:
44 ; CHECK-GI-NEXT: ushll.8h v2, v0, #0
45 ; CHECK-GI-NEXT: ushll2.8h v1, v0, #0
46 ; CHECK-GI-NEXT: mov.16b v0, v2
48 %r = zext <16 x i8> %v0 to <16 x i16>
52 define <16 x i16> @func4(<16 x i8> %v0) nounwind {
53 ; CHECK-SD-LABEL: func4:
55 ; CHECK-SD-NEXT: sshll2.8h v1, v0, #0
56 ; CHECK-SD-NEXT: sshll.8h v0, v0, #0
59 ; CHECK-GI-LABEL: func4:
61 ; CHECK-GI-NEXT: sshll.8h v2, v0, #0
62 ; CHECK-GI-NEXT: sshll2.8h v1, v0, #0
63 ; CHECK-GI-NEXT: mov.16b v0, v2
65 %r = sext <16 x i8> %v0 to <16 x i16>
73 define <4 x i32> @afunc1(<4 x i16> %v0) nounwind {
74 ; CHECK-LABEL: afunc1:
76 ; CHECK-NEXT: ushll.4s v0, v0, #0
78 %r = zext <4 x i16> %v0 to <4 x i32>
82 define <4 x i32> @afunc2(<4 x i16> %v0) nounwind {
83 ; CHECK-LABEL: afunc2:
85 ; CHECK-NEXT: sshll.4s v0, v0, #0
87 %r = sext <4 x i16> %v0 to <4 x i32>
91 define <8 x i32> @afunc3(<8 x i16> %v0) nounwind {
92 ; CHECK-SD-LABEL: afunc3:
94 ; CHECK-SD-NEXT: ushll2.4s v1, v0, #0
95 ; CHECK-SD-NEXT: ushll.4s v0, v0, #0
98 ; CHECK-GI-LABEL: afunc3:
100 ; CHECK-GI-NEXT: ushll.4s v2, v0, #0
101 ; CHECK-GI-NEXT: ushll2.4s v1, v0, #0
102 ; CHECK-GI-NEXT: mov.16b v0, v2
104 %r = zext <8 x i16> %v0 to <8 x i32>
108 define <8 x i32> @afunc4(<8 x i16> %v0) nounwind {
109 ; CHECK-SD-LABEL: afunc4:
110 ; CHECK-SD: // %bb.0:
111 ; CHECK-SD-NEXT: sshll2.4s v1, v0, #0
112 ; CHECK-SD-NEXT: sshll.4s v0, v0, #0
115 ; CHECK-GI-LABEL: afunc4:
116 ; CHECK-GI: // %bb.0:
117 ; CHECK-GI-NEXT: sshll.4s v2, v0, #0
118 ; CHECK-GI-NEXT: sshll2.4s v1, v0, #0
119 ; CHECK-GI-NEXT: mov.16b v0, v2
121 %r = sext <8 x i16> %v0 to <8 x i32>
125 define <8 x i32> @bfunc1(<8 x i8> %v0) nounwind {
126 ; CHECK-SD-LABEL: bfunc1:
127 ; CHECK-SD: // %bb.0:
128 ; CHECK-SD-NEXT: ushll.8h v0, v0, #0
129 ; CHECK-SD-NEXT: ushll2.4s v1, v0, #0
130 ; CHECK-SD-NEXT: ushll.4s v0, v0, #0
133 ; CHECK-GI-LABEL: bfunc1:
134 ; CHECK-GI: // %bb.0:
135 ; CHECK-GI-NEXT: ushll.8h v1, v0, #0
136 ; CHECK-GI-NEXT: ushll.4s v0, v1, #0
137 ; CHECK-GI-NEXT: ushll2.4s v1, v1, #0
139 %r = zext <8 x i8> %v0 to <8 x i32>
143 define <8 x i32> @bfunc2(<8 x i8> %v0) nounwind {
144 ; CHECK-SD-LABEL: bfunc2:
145 ; CHECK-SD: // %bb.0:
146 ; CHECK-SD-NEXT: sshll.8h v0, v0, #0
147 ; CHECK-SD-NEXT: sshll2.4s v1, v0, #0
148 ; CHECK-SD-NEXT: sshll.4s v0, v0, #0
151 ; CHECK-GI-LABEL: bfunc2:
152 ; CHECK-GI: // %bb.0:
153 ; CHECK-GI-NEXT: sshll.8h v1, v0, #0
154 ; CHECK-GI-NEXT: sshll.4s v0, v1, #0
155 ; CHECK-GI-NEXT: sshll2.4s v1, v1, #0
157 %r = sext <8 x i8> %v0 to <8 x i32>
165 define <4 x i64> @zfunc1(<4 x i32> %v0) nounwind {
166 ; CHECK-SD-LABEL: zfunc1:
167 ; CHECK-SD: // %bb.0:
168 ; CHECK-SD-NEXT: ushll2.2d v1, v0, #0
169 ; CHECK-SD-NEXT: ushll.2d v0, v0, #0
172 ; CHECK-GI-LABEL: zfunc1:
173 ; CHECK-GI: // %bb.0:
174 ; CHECK-GI-NEXT: ushll.2d v2, v0, #0
175 ; CHECK-GI-NEXT: ushll2.2d v1, v0, #0
176 ; CHECK-GI-NEXT: mov.16b v0, v2
178 %r = zext <4 x i32> %v0 to <4 x i64>
182 define <4 x i64> @zfunc2(<4 x i32> %v0) nounwind {
183 ; CHECK-SD-LABEL: zfunc2:
184 ; CHECK-SD: // %bb.0:
185 ; CHECK-SD-NEXT: sshll2.2d v1, v0, #0
186 ; CHECK-SD-NEXT: sshll.2d v0, v0, #0
189 ; CHECK-GI-LABEL: zfunc2:
190 ; CHECK-GI: // %bb.0:
191 ; CHECK-GI-NEXT: sshll.2d v2, v0, #0
192 ; CHECK-GI-NEXT: sshll2.2d v1, v0, #0
193 ; CHECK-GI-NEXT: mov.16b v0, v2
195 %r = sext <4 x i32> %v0 to <4 x i64>
199 define <4 x i64> @bfunc3(<4 x i16> %v0) nounwind {
200 ; CHECK-SD-LABEL: bfunc3:
201 ; CHECK-SD: // %bb.0:
202 ; CHECK-SD-NEXT: ushll.4s v0, v0, #0
203 ; CHECK-SD-NEXT: ushll2.2d v1, v0, #0
204 ; CHECK-SD-NEXT: ushll.2d v0, v0, #0
207 ; CHECK-GI-LABEL: bfunc3:
208 ; CHECK-GI: // %bb.0:
209 ; CHECK-GI-NEXT: ushll.4s v1, v0, #0
210 ; CHECK-GI-NEXT: ushll.2d v0, v1, #0
211 ; CHECK-GI-NEXT: ushll2.2d v1, v1, #0
213 %r = zext <4 x i16> %v0 to <4 x i64>
217 define <4 x i64> @cfunc4(<4 x i16> %v0) nounwind {
218 ; CHECK-SD-LABEL: cfunc4:
219 ; CHECK-SD: // %bb.0:
220 ; CHECK-SD-NEXT: sshll.4s v0, v0, #0
221 ; CHECK-SD-NEXT: sshll2.2d v1, v0, #0
222 ; CHECK-SD-NEXT: sshll.2d v0, v0, #0
225 ; CHECK-GI-LABEL: cfunc4:
226 ; CHECK-GI: // %bb.0:
227 ; CHECK-GI-NEXT: sshll.4s v1, v0, #0
228 ; CHECK-GI-NEXT: sshll.2d v0, v1, #0
229 ; CHECK-GI-NEXT: sshll2.2d v1, v1, #0
231 %r = sext <4 x i16> %v0 to <4 x i64>
235 define <4 x i64> @zext_v4i8_to_v4i64(<4 x i8> %v0) nounwind {
236 ; CHECK-SD-LABEL: zext_v4i8_to_v4i64:
237 ; CHECK-SD: // %bb.0:
238 ; CHECK-SD-NEXT: bic.4h v0, #255, lsl #8
239 ; CHECK-SD-NEXT: ushll.4s v0, v0, #0
240 ; CHECK-SD-NEXT: ushll2.2d v1, v0, #0
241 ; CHECK-SD-NEXT: ushll.2d v0, v0, #0
244 ; CHECK-GI-LABEL: zext_v4i8_to_v4i64:
245 ; CHECK-GI: // %bb.0:
246 ; CHECK-GI-NEXT: ushll.4s v0, v0, #0
247 ; CHECK-GI-NEXT: movi.2d v1, #0x000000000000ff
248 ; CHECK-GI-NEXT: ushll.2d v2, v0, #0
249 ; CHECK-GI-NEXT: ushll2.2d v3, v0, #0
250 ; CHECK-GI-NEXT: and.16b v0, v2, v1
251 ; CHECK-GI-NEXT: and.16b v1, v3, v1
253 %r = zext <4 x i8> %v0 to <4 x i64>
257 define <4 x i64> @sext_v4i8_to_v4i64(<4 x i8> %v0) nounwind {
258 ; CHECK-SD-LABEL: sext_v4i8_to_v4i64:
259 ; CHECK-SD: // %bb.0:
260 ; CHECK-SD-NEXT: ushll.4s v0, v0, #0
261 ; CHECK-SD-NEXT: ushll.2d v1, v0, #0
262 ; CHECK-SD-NEXT: ushll2.2d v0, v0, #0
263 ; CHECK-SD-NEXT: shl.2d v0, v0, #56
264 ; CHECK-SD-NEXT: shl.2d v2, v1, #56
265 ; CHECK-SD-NEXT: sshr.2d v1, v0, #56
266 ; CHECK-SD-NEXT: sshr.2d v0, v2, #56
269 ; CHECK-GI-LABEL: sext_v4i8_to_v4i64:
270 ; CHECK-GI: // %bb.0:
271 ; CHECK-GI-NEXT: ushll.4s v0, v0, #0
272 ; CHECK-GI-NEXT: ushll.2d v1, v0, #0
273 ; CHECK-GI-NEXT: ushll2.2d v0, v0, #0
274 ; CHECK-GI-NEXT: shl.2d v1, v1, #56
275 ; CHECK-GI-NEXT: shl.2d v2, v0, #56
276 ; CHECK-GI-NEXT: sshr.2d v0, v1, #56
277 ; CHECK-GI-NEXT: sshr.2d v1, v2, #56
279 %r = sext <4 x i8> %v0 to <4 x i64>
283 define <8 x i64> @zext_v8i8_to_v8i64(<8 x i8> %v0) nounwind {
284 ; CHECK-SD-LABEL: zext_v8i8_to_v8i64:
285 ; CHECK-SD: // %bb.0:
286 ; CHECK-SD-NEXT: ushll.8h v0, v0, #0
287 ; CHECK-SD-NEXT: ushll.4s v1, v0, #0
288 ; CHECK-SD-NEXT: ushll2.4s v2, v0, #0
289 ; CHECK-SD-NEXT: ushll.2d v0, v1, #0
290 ; CHECK-SD-NEXT: ushll2.2d v3, v2, #0
291 ; CHECK-SD-NEXT: ushll2.2d v1, v1, #0
292 ; CHECK-SD-NEXT: ushll.2d v2, v2, #0
295 ; CHECK-GI-LABEL: zext_v8i8_to_v8i64:
296 ; CHECK-GI: // %bb.0:
297 ; CHECK-GI-NEXT: ushll.8h v0, v0, #0
298 ; CHECK-GI-NEXT: ushll.4s v1, v0, #0
299 ; CHECK-GI-NEXT: ushll2.4s v3, v0, #0
300 ; CHECK-GI-NEXT: ushll.2d v0, v1, #0
301 ; CHECK-GI-NEXT: ushll2.2d v1, v1, #0
302 ; CHECK-GI-NEXT: ushll.2d v2, v3, #0
303 ; CHECK-GI-NEXT: ushll2.2d v3, v3, #0
305 %r = zext <8 x i8> %v0 to <8 x i64>
309 define <8 x i64> @sext_v8i8_to_v8i64(<8 x i8> %v0) nounwind {
310 ; CHECK-SD-LABEL: sext_v8i8_to_v8i64:
311 ; CHECK-SD: // %bb.0:
312 ; CHECK-SD-NEXT: sshll.8h v0, v0, #0
313 ; CHECK-SD-NEXT: sshll.4s v1, v0, #0
314 ; CHECK-SD-NEXT: sshll2.4s v2, v0, #0
315 ; CHECK-SD-NEXT: sshll.2d v0, v1, #0
316 ; CHECK-SD-NEXT: sshll2.2d v3, v2, #0
317 ; CHECK-SD-NEXT: sshll2.2d v1, v1, #0
318 ; CHECK-SD-NEXT: sshll.2d v2, v2, #0
321 ; CHECK-GI-LABEL: sext_v8i8_to_v8i64:
322 ; CHECK-GI: // %bb.0:
323 ; CHECK-GI-NEXT: sshll.8h v0, v0, #0
324 ; CHECK-GI-NEXT: sshll.4s v1, v0, #0
325 ; CHECK-GI-NEXT: sshll2.4s v3, v0, #0
326 ; CHECK-GI-NEXT: sshll.2d v0, v1, #0
327 ; CHECK-GI-NEXT: sshll2.2d v1, v1, #0
328 ; CHECK-GI-NEXT: sshll.2d v2, v3, #0
329 ; CHECK-GI-NEXT: sshll2.2d v3, v3, #0
331 %r = sext <8 x i8> %v0 to <8 x i64>
335 ; Extends of vectors of i1.
337 define <32 x i8> @zext_v32i1(<32 x i1> %arg) {
338 ; CHECK-LABEL: zext_v32i1:
340 ; CHECK-NEXT: ldr w8, [sp, #64]
341 ; CHECK-NEXT: fmov s0, w0
342 ; CHECK-NEXT: ldr w9, [sp, #72]
343 ; CHECK-NEXT: movi.16b v2, #1
344 ; CHECK-NEXT: fmov s1, w8
345 ; CHECK-NEXT: ldr w8, [sp, #80]
346 ; CHECK-NEXT: mov.b v0[1], w1
347 ; CHECK-NEXT: mov.b v1[1], w9
348 ; CHECK-NEXT: ldr w9, [sp]
349 ; CHECK-NEXT: mov.b v0[2], w2
350 ; CHECK-NEXT: mov.b v1[2], w8
351 ; CHECK-NEXT: ldr w8, [sp, #88]
352 ; CHECK-NEXT: mov.b v0[3], w3
353 ; CHECK-NEXT: mov.b v1[3], w8
354 ; CHECK-NEXT: ldr w8, [sp, #96]
355 ; CHECK-NEXT: mov.b v0[4], w4
356 ; CHECK-NEXT: mov.b v1[4], w8
357 ; CHECK-NEXT: ldr w8, [sp, #104]
358 ; CHECK-NEXT: mov.b v0[5], w5
359 ; CHECK-NEXT: mov.b v1[5], w8
360 ; CHECK-NEXT: ldr w8, [sp, #112]
361 ; CHECK-NEXT: mov.b v0[6], w6
362 ; CHECK-NEXT: mov.b v1[6], w8
363 ; CHECK-NEXT: ldr w8, [sp, #120]
364 ; CHECK-NEXT: mov.b v0[7], w7
365 ; CHECK-NEXT: mov.b v1[7], w8
366 ; CHECK-NEXT: ldr w8, [sp, #128]
367 ; CHECK-NEXT: mov.b v0[8], w9
368 ; CHECK-NEXT: ldr w9, [sp, #8]
369 ; CHECK-NEXT: mov.b v1[8], w8
370 ; CHECK-NEXT: ldr w8, [sp, #136]
371 ; CHECK-NEXT: mov.b v0[9], w9
372 ; CHECK-NEXT: ldr w9, [sp, #16]
373 ; CHECK-NEXT: mov.b v1[9], w8
374 ; CHECK-NEXT: ldr w8, [sp, #144]
375 ; CHECK-NEXT: mov.b v0[10], w9
376 ; CHECK-NEXT: ldr w9, [sp, #24]
377 ; CHECK-NEXT: mov.b v1[10], w8
378 ; CHECK-NEXT: ldr w8, [sp, #152]
379 ; CHECK-NEXT: mov.b v0[11], w9
380 ; CHECK-NEXT: ldr w9, [sp, #32]
381 ; CHECK-NEXT: mov.b v1[11], w8
382 ; CHECK-NEXT: ldr w8, [sp, #160]
383 ; CHECK-NEXT: mov.b v0[12], w9
384 ; CHECK-NEXT: ldr w9, [sp, #40]
385 ; CHECK-NEXT: mov.b v1[12], w8
386 ; CHECK-NEXT: ldr w8, [sp, #168]
387 ; CHECK-NEXT: mov.b v0[13], w9
388 ; CHECK-NEXT: ldr w9, [sp, #48]
389 ; CHECK-NEXT: mov.b v1[13], w8
390 ; CHECK-NEXT: ldr w8, [sp, #176]
391 ; CHECK-NEXT: mov.b v0[14], w9
392 ; CHECK-NEXT: ldr w9, [sp, #56]
393 ; CHECK-NEXT: mov.b v1[14], w8
394 ; CHECK-NEXT: ldr w8, [sp, #184]
395 ; CHECK-NEXT: mov.b v0[15], w9
396 ; CHECK-NEXT: mov.b v1[15], w8
397 ; CHECK-NEXT: and.16b v0, v0, v2
398 ; CHECK-NEXT: and.16b v1, v1, v2
400 %res = zext <32 x i1> %arg to <32 x i8>
404 define <32 x i8> @sext_v32i1(<32 x i1> %arg) {
405 ; CHECK-LABEL: sext_v32i1:
407 ; CHECK-NEXT: ldr w8, [sp, #64]
408 ; CHECK-NEXT: fmov s1, w0
409 ; CHECK-NEXT: ldr w9, [sp, #72]
410 ; CHECK-NEXT: fmov s0, w8
411 ; CHECK-NEXT: ldr w8, [sp, #80]
412 ; CHECK-NEXT: mov.b v1[1], w1
413 ; CHECK-NEXT: mov.b v0[1], w9
414 ; CHECK-NEXT: ldr w9, [sp]
415 ; CHECK-NEXT: mov.b v1[2], w2
416 ; CHECK-NEXT: mov.b v0[2], w8
417 ; CHECK-NEXT: ldr w8, [sp, #88]
418 ; CHECK-NEXT: mov.b v1[3], w3
419 ; CHECK-NEXT: mov.b v0[3], w8
420 ; CHECK-NEXT: ldr w8, [sp, #96]
421 ; CHECK-NEXT: mov.b v1[4], w4
422 ; CHECK-NEXT: mov.b v0[4], w8
423 ; CHECK-NEXT: ldr w8, [sp, #104]
424 ; CHECK-NEXT: mov.b v1[5], w5
425 ; CHECK-NEXT: mov.b v0[5], w8
426 ; CHECK-NEXT: ldr w8, [sp, #112]
427 ; CHECK-NEXT: mov.b v1[6], w6
428 ; CHECK-NEXT: mov.b v0[6], w8
429 ; CHECK-NEXT: ldr w8, [sp, #120]
430 ; CHECK-NEXT: mov.b v1[7], w7
431 ; CHECK-NEXT: mov.b v0[7], w8
432 ; CHECK-NEXT: ldr w8, [sp, #128]
433 ; CHECK-NEXT: mov.b v1[8], w9
434 ; CHECK-NEXT: ldr w9, [sp, #8]
435 ; CHECK-NEXT: mov.b v0[8], w8
436 ; CHECK-NEXT: ldr w8, [sp, #136]
437 ; CHECK-NEXT: mov.b v1[9], w9
438 ; CHECK-NEXT: ldr w9, [sp, #16]
439 ; CHECK-NEXT: mov.b v0[9], w8
440 ; CHECK-NEXT: ldr w8, [sp, #144]
441 ; CHECK-NEXT: mov.b v1[10], w9
442 ; CHECK-NEXT: ldr w9, [sp, #24]
443 ; CHECK-NEXT: mov.b v0[10], w8
444 ; CHECK-NEXT: ldr w8, [sp, #152]
445 ; CHECK-NEXT: mov.b v1[11], w9
446 ; CHECK-NEXT: ldr w9, [sp, #32]
447 ; CHECK-NEXT: mov.b v0[11], w8
448 ; CHECK-NEXT: ldr w8, [sp, #160]
449 ; CHECK-NEXT: mov.b v1[12], w9
450 ; CHECK-NEXT: ldr w9, [sp, #40]
451 ; CHECK-NEXT: mov.b v0[12], w8
452 ; CHECK-NEXT: ldr w8, [sp, #168]
453 ; CHECK-NEXT: mov.b v1[13], w9
454 ; CHECK-NEXT: ldr w9, [sp, #48]
455 ; CHECK-NEXT: mov.b v0[13], w8
456 ; CHECK-NEXT: ldr w8, [sp, #176]
457 ; CHECK-NEXT: mov.b v1[14], w9
458 ; CHECK-NEXT: ldr w9, [sp, #56]
459 ; CHECK-NEXT: mov.b v0[14], w8
460 ; CHECK-NEXT: ldr w8, [sp, #184]
461 ; CHECK-NEXT: mov.b v1[15], w9
462 ; CHECK-NEXT: mov.b v0[15], w8
463 ; CHECK-NEXT: shl.16b v1, v1, #7
464 ; CHECK-NEXT: shl.16b v2, v0, #7
465 ; CHECK-NEXT: cmlt.16b v0, v1, #0
466 ; CHECK-NEXT: cmlt.16b v1, v2, #0
468 %res = sext <32 x i1> %arg to <32 x i8>
472 define <64 x i8> @zext_v64i1(<64 x i1> %arg) {
473 ; CHECK-LABEL: zext_v64i1:
475 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
476 ; CHECK-NEXT: .cfi_def_cfa_offset 16
477 ; CHECK-NEXT: .cfi_offset w29, -16
478 ; CHECK-NEXT: ldr w8, [sp, #336]
479 ; CHECK-NEXT: ldr w9, [sp, #208]
480 ; CHECK-NEXT: fmov s0, w0
481 ; CHECK-NEXT: ldr w10, [sp, #80]
482 ; CHECK-NEXT: ldr w11, [sp, #216]
483 ; CHECK-NEXT: movi.16b v4, #1
484 ; CHECK-NEXT: fmov s3, w8
485 ; CHECK-NEXT: fmov s2, w9
486 ; CHECK-NEXT: ldr w8, [sp, #344]
487 ; CHECK-NEXT: fmov s1, w10
488 ; CHECK-NEXT: ldr w12, [sp, #88]
489 ; CHECK-NEXT: mov.b v0[1], w1
490 ; CHECK-NEXT: ldr w9, [sp, #224]
491 ; CHECK-NEXT: ldr w10, [sp, #96]
492 ; CHECK-NEXT: mov.b v3[1], w8
493 ; CHECK-NEXT: mov.b v2[1], w11
494 ; CHECK-NEXT: ldr w8, [sp, #352]
495 ; CHECK-NEXT: mov.b v1[1], w12
496 ; CHECK-NEXT: ldr w11, [sp, #144]
497 ; CHECK-NEXT: mov.b v0[2], w2
498 ; CHECK-NEXT: mov.b v3[2], w8
499 ; CHECK-NEXT: mov.b v2[2], w9
500 ; CHECK-NEXT: ldr w8, [sp, #360]
501 ; CHECK-NEXT: mov.b v1[2], w10
502 ; CHECK-NEXT: ldr w9, [sp, #232]
503 ; CHECK-NEXT: ldr w10, [sp, #104]
504 ; CHECK-NEXT: mov.b v0[3], w3
505 ; CHECK-NEXT: mov.b v3[3], w8
506 ; CHECK-NEXT: mov.b v2[3], w9
507 ; CHECK-NEXT: ldr w8, [sp, #368]
508 ; CHECK-NEXT: mov.b v1[3], w10
509 ; CHECK-NEXT: ldr w9, [sp, #240]
510 ; CHECK-NEXT: ldr w10, [sp, #112]
511 ; CHECK-NEXT: mov.b v0[4], w4
512 ; CHECK-NEXT: mov.b v3[4], w8
513 ; CHECK-NEXT: mov.b v2[4], w9
514 ; CHECK-NEXT: ldr w8, [sp, #376]
515 ; CHECK-NEXT: mov.b v1[4], w10
516 ; CHECK-NEXT: ldr w9, [sp, #248]
517 ; CHECK-NEXT: ldr w10, [sp, #120]
518 ; CHECK-NEXT: mov.b v0[5], w5
519 ; CHECK-NEXT: mov.b v3[5], w8
520 ; CHECK-NEXT: mov.b v2[5], w9
521 ; CHECK-NEXT: ldr w8, [sp, #384]
522 ; CHECK-NEXT: mov.b v1[5], w10
523 ; CHECK-NEXT: ldr w9, [sp, #256]
524 ; CHECK-NEXT: ldr w10, [sp, #128]
525 ; CHECK-NEXT: mov.b v0[6], w6
526 ; CHECK-NEXT: mov.b v3[6], w8
527 ; CHECK-NEXT: mov.b v2[6], w9
528 ; CHECK-NEXT: ldr w8, [sp, #392]
529 ; CHECK-NEXT: mov.b v1[6], w10
530 ; CHECK-NEXT: ldr w9, [sp, #264]
531 ; CHECK-NEXT: ldr w10, [sp, #136]
532 ; CHECK-NEXT: mov.b v0[7], w7
533 ; CHECK-NEXT: mov.b v3[7], w8
534 ; CHECK-NEXT: mov.b v2[7], w9
535 ; CHECK-NEXT: ldr w8, [sp, #16]
536 ; CHECK-NEXT: mov.b v1[7], w10
537 ; CHECK-NEXT: ldr w9, [sp, #400]
538 ; CHECK-NEXT: ldr w10, [sp, #272]
539 ; CHECK-NEXT: mov.b v0[8], w8
540 ; CHECK-NEXT: ldr w8, [sp, #24]
541 ; CHECK-NEXT: mov.b v3[8], w9
542 ; CHECK-NEXT: mov.b v2[8], w10
543 ; CHECK-NEXT: ldr w9, [sp, #408]
544 ; CHECK-NEXT: mov.b v1[8], w11
545 ; CHECK-NEXT: ldr w10, [sp, #280]
546 ; CHECK-NEXT: ldr w11, [sp, #152]
547 ; CHECK-NEXT: mov.b v0[9], w8
548 ; CHECK-NEXT: ldr w8, [sp, #32]
549 ; CHECK-NEXT: mov.b v3[9], w9
550 ; CHECK-NEXT: mov.b v2[9], w10
551 ; CHECK-NEXT: ldr w9, [sp, #416]
552 ; CHECK-NEXT: mov.b v1[9], w11
553 ; CHECK-NEXT: ldr w10, [sp, #288]
554 ; CHECK-NEXT: ldr w11, [sp, #160]
555 ; CHECK-NEXT: mov.b v0[10], w8
556 ; CHECK-NEXT: ldr w8, [sp, #40]
557 ; CHECK-NEXT: mov.b v3[10], w9
558 ; CHECK-NEXT: mov.b v2[10], w10
559 ; CHECK-NEXT: ldr w9, [sp, #424]
560 ; CHECK-NEXT: mov.b v1[10], w11
561 ; CHECK-NEXT: ldr w10, [sp, #296]
562 ; CHECK-NEXT: ldr w11, [sp, #168]
563 ; CHECK-NEXT: mov.b v0[11], w8
564 ; CHECK-NEXT: ldr w8, [sp, #48]
565 ; CHECK-NEXT: mov.b v3[11], w9
566 ; CHECK-NEXT: mov.b v2[11], w10
567 ; CHECK-NEXT: ldr w9, [sp, #432]
568 ; CHECK-NEXT: mov.b v1[11], w11
569 ; CHECK-NEXT: ldr w10, [sp, #304]
570 ; CHECK-NEXT: ldr w11, [sp, #176]
571 ; CHECK-NEXT: mov.b v0[12], w8
572 ; CHECK-NEXT: ldr w8, [sp, #56]
573 ; CHECK-NEXT: mov.b v3[12], w9
574 ; CHECK-NEXT: mov.b v2[12], w10
575 ; CHECK-NEXT: ldr w9, [sp, #440]
576 ; CHECK-NEXT: mov.b v1[12], w11
577 ; CHECK-NEXT: ldr w10, [sp, #312]
578 ; CHECK-NEXT: ldr w11, [sp, #184]
579 ; CHECK-NEXT: mov.b v0[13], w8
580 ; CHECK-NEXT: ldr w8, [sp, #64]
581 ; CHECK-NEXT: mov.b v3[13], w9
582 ; CHECK-NEXT: mov.b v2[13], w10
583 ; CHECK-NEXT: ldr w9, [sp, #448]
584 ; CHECK-NEXT: mov.b v1[13], w11
585 ; CHECK-NEXT: ldr w10, [sp, #320]
586 ; CHECK-NEXT: ldr w11, [sp, #192]
587 ; CHECK-NEXT: mov.b v0[14], w8
588 ; CHECK-NEXT: ldr w8, [sp, #72]
589 ; CHECK-NEXT: mov.b v3[14], w9
590 ; CHECK-NEXT: mov.b v2[14], w10
591 ; CHECK-NEXT: ldr w9, [sp, #456]
592 ; CHECK-NEXT: mov.b v1[14], w11
593 ; CHECK-NEXT: ldr w10, [sp, #328]
594 ; CHECK-NEXT: ldr w11, [sp, #200]
595 ; CHECK-NEXT: mov.b v0[15], w8
596 ; CHECK-NEXT: mov.b v3[15], w9
597 ; CHECK-NEXT: mov.b v2[15], w10
598 ; CHECK-NEXT: mov.b v1[15], w11
599 ; CHECK-NEXT: and.16b v0, v0, v4
600 ; CHECK-NEXT: and.16b v2, v2, v4
601 ; CHECK-NEXT: and.16b v3, v3, v4
602 ; CHECK-NEXT: and.16b v1, v1, v4
603 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
605 %res = zext <64 x i1> %arg to <64 x i8>
609 define <64 x i8> @sext_v64i1(<64 x i1> %arg) {
610 ; CHECK-LABEL: sext_v64i1:
612 ; CHECK-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill
613 ; CHECK-NEXT: .cfi_def_cfa_offset 16
614 ; CHECK-NEXT: .cfi_offset w29, -16
615 ; CHECK-NEXT: ldr w8, [sp, #336]
616 ; CHECK-NEXT: ldr w9, [sp, #208]
617 ; CHECK-NEXT: fmov s2, w0
618 ; CHECK-NEXT: ldr w10, [sp, #80]
619 ; CHECK-NEXT: ldr w11, [sp, #216]
620 ; CHECK-NEXT: ldr w12, [sp, #88]
621 ; CHECK-NEXT: fmov s0, w8
622 ; CHECK-NEXT: fmov s1, w9
623 ; CHECK-NEXT: ldr w8, [sp, #344]
624 ; CHECK-NEXT: fmov s3, w10
625 ; CHECK-NEXT: mov.b v2[1], w1
626 ; CHECK-NEXT: ldr w9, [sp, #224]
627 ; CHECK-NEXT: ldr w10, [sp, #96]
628 ; CHECK-NEXT: mov.b v0[1], w8
629 ; CHECK-NEXT: mov.b v1[1], w11
630 ; CHECK-NEXT: ldr w8, [sp, #352]
631 ; CHECK-NEXT: mov.b v3[1], w12
632 ; CHECK-NEXT: ldr w11, [sp, #144]
633 ; CHECK-NEXT: mov.b v2[2], w2
634 ; CHECK-NEXT: mov.b v0[2], w8
635 ; CHECK-NEXT: mov.b v1[2], w9
636 ; CHECK-NEXT: ldr w8, [sp, #360]
637 ; CHECK-NEXT: mov.b v3[2], w10
638 ; CHECK-NEXT: ldr w9, [sp, #232]
639 ; CHECK-NEXT: ldr w10, [sp, #104]
640 ; CHECK-NEXT: mov.b v2[3], w3
641 ; CHECK-NEXT: mov.b v0[3], w8
642 ; CHECK-NEXT: mov.b v1[3], w9
643 ; CHECK-NEXT: ldr w8, [sp, #368]
644 ; CHECK-NEXT: mov.b v3[3], w10
645 ; CHECK-NEXT: ldr w9, [sp, #240]
646 ; CHECK-NEXT: ldr w10, [sp, #112]
647 ; CHECK-NEXT: mov.b v2[4], w4
648 ; CHECK-NEXT: mov.b v0[4], w8
649 ; CHECK-NEXT: mov.b v1[4], w9
650 ; CHECK-NEXT: ldr w8, [sp, #376]
651 ; CHECK-NEXT: mov.b v3[4], w10
652 ; CHECK-NEXT: ldr w9, [sp, #248]
653 ; CHECK-NEXT: ldr w10, [sp, #120]
654 ; CHECK-NEXT: mov.b v2[5], w5
655 ; CHECK-NEXT: mov.b v0[5], w8
656 ; CHECK-NEXT: mov.b v1[5], w9
657 ; CHECK-NEXT: ldr w8, [sp, #384]
658 ; CHECK-NEXT: mov.b v3[5], w10
659 ; CHECK-NEXT: ldr w9, [sp, #256]
660 ; CHECK-NEXT: ldr w10, [sp, #128]
661 ; CHECK-NEXT: mov.b v2[6], w6
662 ; CHECK-NEXT: mov.b v0[6], w8
663 ; CHECK-NEXT: mov.b v1[6], w9
664 ; CHECK-NEXT: ldr w8, [sp, #392]
665 ; CHECK-NEXT: mov.b v3[6], w10
666 ; CHECK-NEXT: ldr w9, [sp, #264]
667 ; CHECK-NEXT: ldr w10, [sp, #136]
668 ; CHECK-NEXT: mov.b v2[7], w7
669 ; CHECK-NEXT: mov.b v0[7], w8
670 ; CHECK-NEXT: mov.b v1[7], w9
671 ; CHECK-NEXT: ldr w8, [sp, #16]
672 ; CHECK-NEXT: mov.b v3[7], w10
673 ; CHECK-NEXT: ldr w9, [sp, #400]
674 ; CHECK-NEXT: ldr w10, [sp, #272]
675 ; CHECK-NEXT: mov.b v2[8], w8
676 ; CHECK-NEXT: ldr w8, [sp, #24]
677 ; CHECK-NEXT: mov.b v0[8], w9
678 ; CHECK-NEXT: mov.b v1[8], w10
679 ; CHECK-NEXT: ldr w9, [sp, #408]
680 ; CHECK-NEXT: mov.b v3[8], w11
681 ; CHECK-NEXT: ldr w10, [sp, #280]
682 ; CHECK-NEXT: ldr w11, [sp, #152]
683 ; CHECK-NEXT: mov.b v2[9], w8
684 ; CHECK-NEXT: ldr w8, [sp, #32]
685 ; CHECK-NEXT: mov.b v0[9], w9
686 ; CHECK-NEXT: mov.b v1[9], w10
687 ; CHECK-NEXT: ldr w9, [sp, #416]
688 ; CHECK-NEXT: mov.b v3[9], w11
689 ; CHECK-NEXT: ldr w10, [sp, #288]
690 ; CHECK-NEXT: ldr w11, [sp, #160]
691 ; CHECK-NEXT: mov.b v2[10], w8
692 ; CHECK-NEXT: ldr w8, [sp, #40]
693 ; CHECK-NEXT: mov.b v0[10], w9
694 ; CHECK-NEXT: mov.b v1[10], w10
695 ; CHECK-NEXT: ldr w9, [sp, #424]
696 ; CHECK-NEXT: mov.b v3[10], w11
697 ; CHECK-NEXT: ldr w10, [sp, #296]
698 ; CHECK-NEXT: ldr w11, [sp, #168]
699 ; CHECK-NEXT: mov.b v2[11], w8
700 ; CHECK-NEXT: ldr w8, [sp, #48]
701 ; CHECK-NEXT: mov.b v0[11], w9
702 ; CHECK-NEXT: mov.b v1[11], w10
703 ; CHECK-NEXT: ldr w9, [sp, #432]
704 ; CHECK-NEXT: mov.b v3[11], w11
705 ; CHECK-NEXT: ldr w10, [sp, #304]
706 ; CHECK-NEXT: ldr w11, [sp, #176]
707 ; CHECK-NEXT: mov.b v2[12], w8
708 ; CHECK-NEXT: ldr w8, [sp, #56]
709 ; CHECK-NEXT: mov.b v0[12], w9
710 ; CHECK-NEXT: mov.b v1[12], w10
711 ; CHECK-NEXT: ldr w9, [sp, #440]
712 ; CHECK-NEXT: mov.b v3[12], w11
713 ; CHECK-NEXT: ldr w10, [sp, #312]
714 ; CHECK-NEXT: ldr w11, [sp, #184]
715 ; CHECK-NEXT: mov.b v2[13], w8
716 ; CHECK-NEXT: ldr w8, [sp, #64]
717 ; CHECK-NEXT: mov.b v0[13], w9
718 ; CHECK-NEXT: mov.b v1[13], w10
719 ; CHECK-NEXT: ldr w9, [sp, #448]
720 ; CHECK-NEXT: mov.b v3[13], w11
721 ; CHECK-NEXT: ldr w10, [sp, #320]
722 ; CHECK-NEXT: ldr w11, [sp, #192]
723 ; CHECK-NEXT: mov.b v2[14], w8
724 ; CHECK-NEXT: ldr w8, [sp, #72]
725 ; CHECK-NEXT: mov.b v0[14], w9
726 ; CHECK-NEXT: mov.b v1[14], w10
727 ; CHECK-NEXT: ldr w9, [sp, #456]
728 ; CHECK-NEXT: mov.b v3[14], w11
729 ; CHECK-NEXT: ldr w10, [sp, #328]
730 ; CHECK-NEXT: ldr w11, [sp, #200]
731 ; CHECK-NEXT: mov.b v2[15], w8
732 ; CHECK-NEXT: mov.b v0[15], w9
733 ; CHECK-NEXT: mov.b v1[15], w10
734 ; CHECK-NEXT: mov.b v3[15], w11
735 ; CHECK-NEXT: shl.16b v2, v2, #7
736 ; CHECK-NEXT: shl.16b v4, v1, #7
737 ; CHECK-NEXT: shl.16b v5, v0, #7
738 ; CHECK-NEXT: shl.16b v3, v3, #7
739 ; CHECK-NEXT: cmlt.16b v0, v2, #0
740 ; CHECK-NEXT: cmlt.16b v2, v4, #0
741 ; CHECK-NEXT: cmlt.16b v1, v3, #0
742 ; CHECK-NEXT: cmlt.16b v3, v5, #0
743 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload
745 %res = sext <64 x i1> %arg to <64 x i8>
749 ; X0 & X1 are the real return registers, SDAG messes with v0 too for unknown reasons.
750 define <1 x i128> @sext_v1x64(<1 x i64> %arg) {
751 ; CHECK-SD-LABEL: sext_v1x64:
752 ; CHECK-SD: // %bb.0:
753 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
754 ; CHECK-SD-NEXT: fmov x8, d0
755 ; CHECK-SD-NEXT: asr x1, x8, #63
756 ; CHECK-SD-NEXT: mov.d v0[1], x1
757 ; CHECK-SD-NEXT: fmov x0, d0
760 ; CHECK-GI-LABEL: sext_v1x64:
761 ; CHECK-GI: // %bb.0:
762 ; CHECK-GI-NEXT: fmov x8, d0
763 ; CHECK-GI-NEXT: fmov x0, d0
764 ; CHECK-GI-NEXT: asr x1, x8, #63
766 %res = sext <1 x i64> %arg to <1 x i128>