1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -verify-machineinstrs -mtriple=aarch64-none-linux-gnu -mattr=+neon | FileCheck %s --check-prefixes=CHECK,CHECK-NOFP16,CHECK-NOFP16-SD
3 ; RUN: llc < %s -verify-machineinstrs -mtriple=aarch64-none-linux-gnu -mattr=+neon,+fullfp16 | FileCheck %s --check-prefixes=CHECK,CHECK-FP16,CHECK-FP16-SD
4 ; RUN: llc -mtriple=aarch64-none-linux-gnu -mattr=+neon -global-isel %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-NOFP16,CHECK-NOFP16-GI
5 ; RUN: llc -mtriple=aarch64-none-linux-gnu -mattr=+neon,+fullfp16 -global-isel %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-FP16,CHECK-FP16-GI
7 define <8 x i8> @movi8b_0() {
8 ; CHECK-LABEL: movi8b_0:
10 ; CHECK-NEXT: movi v0.2d, #0000000000000000
12 ret <8 x i8> zeroinitializer
15 define <8 x i8> @movi8b() {
16 ; CHECK-LABEL: movi8b:
18 ; CHECK-NEXT: movi v0.8b, #8
20 ret <8 x i8> <i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8>
23 define <16 x i8> @movi16b_0() {
24 ; CHECK-LABEL: movi16b_0:
26 ; CHECK-NEXT: movi v0.2d, #0000000000000000
28 ret <16 x i8> zeroinitializer
31 define <16 x i8> @movi16b() {
32 ; CHECK-LABEL: movi16b:
34 ; CHECK-NEXT: movi v0.16b, #8
36 ret <16 x i8> <i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8>
39 define <2 x i32> @movi2s_0() {
40 ; CHECK-LABEL: movi2s_0:
42 ; CHECK-NEXT: movi v0.2d, #0000000000000000
44 ret <2 x i32> zeroinitializer
47 define <2 x i32> @movi2s_lsl0() {
48 ; CHECK-LABEL: movi2s_lsl0:
50 ; CHECK-NEXT: movi d0, #0x0000ff000000ff
52 ret <2 x i32> <i32 255, i32 255>
55 define <2 x i32> @movi2s_lsl8() {
56 ; CHECK-LABEL: movi2s_lsl8:
58 ; CHECK-NEXT: movi d0, #0x00ff000000ff00
60 ret <2 x i32> <i32 65280, i32 65280>
63 define <2 x i32> @movi2s_lsl16() {
64 ; CHECK-LABEL: movi2s_lsl16:
66 ; CHECK-NEXT: movi d0, #0xff000000ff0000
68 ret <2 x i32> <i32 16711680, i32 16711680>
71 define <2 x i32> @movi2s_lsl24() {
72 ; CHECK-LABEL: movi2s_lsl24:
74 ; CHECK-NEXT: movi d0, #0xff000000ff000000
76 ret <2 x i32> <i32 4278190080, i32 4278190080>
79 define <4 x i32> @movi4s_0() {
80 ; CHECK-LABEL: movi4s_0:
82 ; CHECK-NEXT: movi v0.2d, #0000000000000000
84 ret <4 x i32> zeroinitializer
87 define <4 x i32> @movi4s_lsl0() {
88 ; CHECK-LABEL: movi4s_lsl0:
90 ; CHECK-NEXT: movi v0.2d, #0x0000ff000000ff
92 ret <4 x i32> <i32 255, i32 255, i32 255, i32 255>
95 define <4 x i32> @movi4s_lsl8() {
96 ; CHECK-LABEL: movi4s_lsl8:
98 ; CHECK-NEXT: movi v0.2d, #0x00ff000000ff00
100 ret <4 x i32> <i32 65280, i32 65280, i32 65280, i32 65280>
103 define <4 x i32> @movi4s_lsl16() {
104 ; CHECK-LABEL: movi4s_lsl16:
106 ; CHECK-NEXT: movi v0.2d, #0xff000000ff0000
108 ret <4 x i32> <i32 16711680, i32 16711680, i32 16711680, i32 16711680>
111 define <4 x i32> @movi4s_fneg() {
112 ; CHECK-LABEL: movi4s_fneg:
114 ; CHECK-NEXT: movi v0.4s, #240, lsl #8
115 ; CHECK-NEXT: fneg v0.4s, v0.4s
117 ret <4 x i32> <i32 2147545088, i32 2147545088, i32 2147545088, i32 2147545088>
120 define <4 x i32> @movi4s_lsl24() {
121 ; CHECK-LABEL: movi4s_lsl24:
123 ; CHECK-NEXT: movi v0.2d, #0xff000000ff000000
125 ret <4 x i32> <i32 4278190080, i32 4278190080, i32 4278190080, i32 4278190080>
128 define <4 x i16> @movi4h_lsl0() {
129 ; CHECK-LABEL: movi4h_lsl0:
131 ; CHECK-NEXT: movi d0, #0xff00ff00ff00ff
133 ret <4 x i16> <i16 255, i16 255, i16 255, i16 255>
136 define <4 x i16> @movi4h_lsl8() {
137 ; CHECK-LABEL: movi4h_lsl8:
139 ; CHECK-NEXT: movi d0, #0xff00ff00ff00ff00
141 ret <4 x i16> <i16 65280, i16 65280, i16 65280, i16 65280>
144 define <8 x i16> @movi8h_lsl0() {
145 ; CHECK-LABEL: movi8h_lsl0:
147 ; CHECK-NEXT: movi v0.2d, #0xff00ff00ff00ff
149 ret <8 x i16> <i16 255, i16 255, i16 255, i16 255, i16 255, i16 255, i16 255, i16 255>
152 define <8 x i16> @movi8h_lsl8() {
153 ; CHECK-LABEL: movi8h_lsl8:
155 ; CHECK-NEXT: movi v0.2d, #0xff00ff00ff00ff00
157 ret <8 x i16> <i16 65280, i16 65280, i16 65280, i16 65280, i16 65280, i16 65280, i16 65280, i16 65280>
160 define <8 x i16> @movi8h_fneg() {
161 ; CHECK-NOFP16-SD-LABEL: movi8h_fneg:
162 ; CHECK-NOFP16-SD: // %bb.0:
163 ; CHECK-NOFP16-SD-NEXT: movi v0.8h, #127, lsl #8
164 ; CHECK-NOFP16-SD-NEXT: fneg v0.4s, v0.4s
165 ; CHECK-NOFP16-SD-NEXT: ret
167 ; CHECK-FP16-SD-LABEL: movi8h_fneg:
168 ; CHECK-FP16-SD: // %bb.0:
169 ; CHECK-FP16-SD-NEXT: movi v0.8h, #127, lsl #8
170 ; CHECK-FP16-SD-NEXT: fneg v0.4s, v0.4s
171 ; CHECK-FP16-SD-NEXT: ret
173 ; CHECK-NOFP16-GI-LABEL: movi8h_fneg:
174 ; CHECK-NOFP16-GI: // %bb.0:
175 ; CHECK-NOFP16-GI-NEXT: adrp x8, .LCPI19_0
176 ; CHECK-NOFP16-GI-NEXT: ldr q0, [x8, :lo12:.LCPI19_0]
177 ; CHECK-NOFP16-GI-NEXT: ret
179 ; CHECK-FP16-GI-LABEL: movi8h_fneg:
180 ; CHECK-FP16-GI: // %bb.0:
181 ; CHECK-FP16-GI-NEXT: adrp x8, .LCPI19_0
182 ; CHECK-FP16-GI-NEXT: ldr q0, [x8, :lo12:.LCPI19_0]
183 ; CHECK-FP16-GI-NEXT: ret
184 ret <8 x i16> <i16 32512, i16 65280, i16 32512, i16 65280, i16 32512, i16 65280, i16 32512, i16 65280>
188 define <2 x i32> @mvni2s_lsl0() {
189 ; CHECK-LABEL: mvni2s_lsl0:
191 ; CHECK-NEXT: mvni v0.2s, #16
193 ret <2 x i32> <i32 4294967279, i32 4294967279>
196 define <2 x i32> @mvni2s_lsl8() {
197 ; CHECK-LABEL: mvni2s_lsl8:
199 ; CHECK-NEXT: mvni v0.2s, #16, lsl #8
201 ret <2 x i32> <i32 4294963199, i32 4294963199>
204 define <2 x i32> @mvni2s_lsl16() {
205 ; CHECK-LABEL: mvni2s_lsl16:
207 ; CHECK-NEXT: mvni v0.2s, #16, lsl #16
209 ret <2 x i32> <i32 4293918719, i32 4293918719>
212 define <2 x i32> @mvni2s_lsl24() {
213 ; CHECK-LABEL: mvni2s_lsl24:
215 ; CHECK-NEXT: mvni v0.2s, #16, lsl #24
217 ret <2 x i32> <i32 4026531839, i32 4026531839>
220 define <4 x i32> @mvni4s_lsl0() {
221 ; CHECK-LABEL: mvni4s_lsl0:
223 ; CHECK-NEXT: mvni v0.4s, #16
225 ret <4 x i32> <i32 4294967279, i32 4294967279, i32 4294967279, i32 4294967279>
228 define <4 x i32> @mvni4s_lsl8() {
229 ; CHECK-LABEL: mvni4s_lsl8:
231 ; CHECK-NEXT: mvni v0.4s, #16, lsl #8
233 ret <4 x i32> <i32 4294963199, i32 4294963199, i32 4294963199, i32 4294963199>
236 define <4 x i32> @mvni4s_lsl16() {
237 ; CHECK-LABEL: mvni4s_lsl16:
239 ; CHECK-NEXT: mvni v0.4s, #16, lsl #16
241 ret <4 x i32> <i32 4293918719, i32 4293918719, i32 4293918719, i32 4293918719>
245 define <4 x i32> @mvni4s_lsl24() {
246 ; CHECK-LABEL: mvni4s_lsl24:
248 ; CHECK-NEXT: mvni v0.4s, #16, lsl #24
250 ret <4 x i32> <i32 4026531839, i32 4026531839, i32 4026531839, i32 4026531839>
254 define <4 x i16> @mvni4h_lsl0() {
255 ; CHECK-LABEL: mvni4h_lsl0:
257 ; CHECK-NEXT: mvni v0.4h, #16
259 ret <4 x i16> <i16 65519, i16 65519, i16 65519, i16 65519>
262 define <4 x i16> @mvni4h_lsl8() {
263 ; CHECK-LABEL: mvni4h_lsl8:
265 ; CHECK-NEXT: mvni v0.4h, #16, lsl #8
267 ret <4 x i16> <i16 61439, i16 61439, i16 61439, i16 61439>
270 define <8 x i16> @mvni8h_lsl0() {
271 ; CHECK-LABEL: mvni8h_lsl0:
273 ; CHECK-NEXT: mvni v0.8h, #16
275 ret <8 x i16> <i16 65519, i16 65519, i16 65519, i16 65519, i16 65519, i16 65519, i16 65519, i16 65519>
278 define <8 x i16> @mvni8h_lsl8() {
279 ; CHECK-LABEL: mvni8h_lsl8:
281 ; CHECK-NEXT: mvni v0.8h, #16, lsl #8
283 ret <8 x i16> <i16 61439, i16 61439, i16 61439, i16 61439, i16 61439, i16 61439, i16 61439, i16 61439>
286 define <8 x i16> @mvni8h_neg() {
287 ; CHECK-NOFP16-SD-LABEL: mvni8h_neg:
288 ; CHECK-NOFP16-SD: // %bb.0:
289 ; CHECK-NOFP16-SD-NEXT: mov w8, #33008 // =0x80f0
290 ; CHECK-NOFP16-SD-NEXT: dup v0.8h, w8
291 ; CHECK-NOFP16-SD-NEXT: ret
293 ; CHECK-FP16-LABEL: mvni8h_neg:
294 ; CHECK-FP16: // %bb.0:
295 ; CHECK-FP16-NEXT: movi v0.8h, #240
296 ; CHECK-FP16-NEXT: fneg v0.8h, v0.8h
297 ; CHECK-FP16-NEXT: ret
299 ; CHECK-NOFP16-GI-LABEL: mvni8h_neg:
300 ; CHECK-NOFP16-GI: // %bb.0:
301 ; CHECK-NOFP16-GI-NEXT: adrp x8, .LCPI32_0
302 ; CHECK-NOFP16-GI-NEXT: ldr q0, [x8, :lo12:.LCPI32_0]
303 ; CHECK-NOFP16-GI-NEXT: ret
304 ret <8 x i16> <i16 33008, i16 33008, i16 33008, i16 33008, i16 33008, i16 33008, i16 33008, i16 33008>
308 define <2 x i32> @movi2s_msl8(<2 x i32> %a) {
309 ; CHECK-LABEL: movi2s_msl8:
311 ; CHECK-NEXT: movi d0, #0x00ffff0000ffff
313 ret <2 x i32> <i32 65535, i32 65535>
316 define <2 x i32> @movi2s_msl16() {
317 ; CHECK-LABEL: movi2s_msl16:
319 ; CHECK-NEXT: movi d0, #0xffffff00ffffff
321 ret <2 x i32> <i32 16777215, i32 16777215>
325 define <4 x i32> @movi4s_msl8() {
326 ; CHECK-LABEL: movi4s_msl8:
328 ; CHECK-NEXT: movi v0.2d, #0x00ffff0000ffff
330 ret <4 x i32> <i32 65535, i32 65535, i32 65535, i32 65535>
333 define <4 x i32> @movi4s_msl16() {
334 ; CHECK-LABEL: movi4s_msl16:
336 ; CHECK-NEXT: movi v0.2d, #0xffffff00ffffff
338 ret <4 x i32> <i32 16777215, i32 16777215, i32 16777215, i32 16777215>
341 define <2 x i32> @mvni2s_msl8() {
342 ; CHECK-LABEL: mvni2s_msl8:
344 ; CHECK-NEXT: mvni v0.2s, #16, msl #8
346 ret <2 x i32> <i32 18446744073709547264, i32 18446744073709547264>
349 define <2 x i32> @mvni2s_msl16() {
350 ; CHECK-LABEL: mvni2s_msl16:
352 ; CHECK-NEXT: mvni v0.2s, #16, msl #16
354 ret <2 x i32> <i32 18446744073708437504, i32 18446744073708437504>
357 define <4 x i32> @mvni4s_msl8() {
358 ; CHECK-LABEL: mvni4s_msl8:
360 ; CHECK-NEXT: mvni v0.4s, #16, msl #8
362 ret <4 x i32> <i32 18446744073709547264, i32 18446744073709547264, i32 18446744073709547264, i32 18446744073709547264>
365 define <4 x i32> @mvni4s_msl16() {
366 ; CHECK-LABEL: mvni4s_msl16:
368 ; CHECK-NEXT: mvni v0.4s, #16, msl #16
370 ret <4 x i32> <i32 18446744073708437504, i32 18446744073708437504, i32 18446744073708437504, i32 18446744073708437504>
373 define <2 x i64> @movi2d() {
374 ; CHECK-LABEL: movi2d:
376 ; CHECK-NEXT: movi v0.2d, #0xff0000ff0000ffff
378 ret <2 x i64> <i64 18374687574888349695, i64 18374687574888349695>
381 define <1 x i64> @movid() {
382 ; CHECK-NOFP16-SD-LABEL: movid:
383 ; CHECK-NOFP16-SD: // %bb.0:
384 ; CHECK-NOFP16-SD-NEXT: movi d0, #0xff0000ff0000ffff
385 ; CHECK-NOFP16-SD-NEXT: ret
387 ; CHECK-FP16-SD-LABEL: movid:
388 ; CHECK-FP16-SD: // %bb.0:
389 ; CHECK-FP16-SD-NEXT: movi d0, #0xff0000ff0000ffff
390 ; CHECK-FP16-SD-NEXT: ret
392 ; CHECK-NOFP16-GI-LABEL: movid:
393 ; CHECK-NOFP16-GI: // %bb.0:
394 ; CHECK-NOFP16-GI-NEXT: mov x8, #-72056494526300161 // =0xff0000ffffffffff
395 ; CHECK-NOFP16-GI-NEXT: movk x8, #0, lsl #16
396 ; CHECK-NOFP16-GI-NEXT: fmov d0, x8
397 ; CHECK-NOFP16-GI-NEXT: ret
399 ; CHECK-FP16-GI-LABEL: movid:
400 ; CHECK-FP16-GI: // %bb.0:
401 ; CHECK-FP16-GI-NEXT: mov x8, #-72056494526300161 // =0xff0000ffffffffff
402 ; CHECK-FP16-GI-NEXT: movk x8, #0, lsl #16
403 ; CHECK-FP16-GI-NEXT: fmov d0, x8
404 ; CHECK-FP16-GI-NEXT: ret
405 ret <1 x i64> <i64 18374687574888349695>
408 define <2 x float> @fmov2s_0() {
409 ; CHECK-LABEL: fmov2s_0:
411 ; CHECK-NEXT: movi v0.2d, #0000000000000000
413 ret <2 x float> zeroinitializer
416 define <2 x float> @fmov2s() {
417 ; CHECK-LABEL: fmov2s:
419 ; CHECK-NEXT: fmov v0.2s, #-12.00000000
421 ret <2 x float> <float -1.2e1, float -1.2e1>
424 define <2 x float> @fmov2s_neg0() {
425 ; CHECK-LABEL: fmov2s_neg0:
427 ; CHECK-NEXT: movi v0.2s, #128, lsl #24
429 ret <2 x float> <float -0.0, float -0.0>
432 define <4 x float> @fmov4s_0() {
433 ; CHECK-LABEL: fmov4s_0:
435 ; CHECK-NEXT: movi v0.2d, #0000000000000000
437 ret <4 x float> zeroinitializer
440 define <4 x float> @fmov4s() {
441 ; CHECK-LABEL: fmov4s:
443 ; CHECK-NEXT: fmov v0.4s, #-12.00000000
445 ret <4 x float> <float -1.2e1, float -1.2e1, float -1.2e1, float -1.2e1>
448 define <4 x float> @fmov4s_neg0() {
449 ; CHECK-LABEL: fmov4s_neg0:
451 ; CHECK-NEXT: movi v0.4s, #128, lsl #24
453 ret <4 x float> <float -0.0, float -0.0, float -0.0, float -0.0>
456 define <2 x double> @fmov2d_0() {
457 ; CHECK-LABEL: fmov2d_0:
459 ; CHECK-NEXT: movi v0.2d, #0000000000000000
461 ret <2 x double> zeroinitializer
464 define <2 x double> @fmov2d() {
465 ; CHECK-LABEL: fmov2d:
467 ; CHECK-NEXT: fmov v0.2d, #-12.00000000
469 ret <2 x double> <double -1.2e1, double -1.2e1>
472 define <2 x double> @fmov2d_neg0() {
473 ; CHECK-LABEL: fmov2d_neg0:
475 ; CHECK-NEXT: movi v0.2d, #0000000000000000
476 ; CHECK-NEXT: fneg v0.2d, v0.2d
478 ret <2 x double> <double -0.0, double -0.0>
481 define <2 x i32> @movi1d_1() {
482 ; CHECK-NOFP16-SD-LABEL: movi1d_1:
483 ; CHECK-NOFP16-SD: // %bb.0:
484 ; CHECK-NOFP16-SD-NEXT: movi d0, #0x00ffffffff0000
485 ; CHECK-NOFP16-SD-NEXT: ret
487 ; CHECK-FP16-SD-LABEL: movi1d_1:
488 ; CHECK-FP16-SD: // %bb.0:
489 ; CHECK-FP16-SD-NEXT: movi d0, #0x00ffffffff0000
490 ; CHECK-FP16-SD-NEXT: ret
492 ; CHECK-NOFP16-GI-LABEL: movi1d_1:
493 ; CHECK-NOFP16-GI: // %bb.0:
494 ; CHECK-NOFP16-GI-NEXT: adrp x8, .LCPI52_0
495 ; CHECK-NOFP16-GI-NEXT: ldr d0, [x8, :lo12:.LCPI52_0]
496 ; CHECK-NOFP16-GI-NEXT: ret
498 ; CHECK-FP16-GI-LABEL: movi1d_1:
499 ; CHECK-FP16-GI: // %bb.0:
500 ; CHECK-FP16-GI-NEXT: adrp x8, .LCPI52_0
501 ; CHECK-FP16-GI-NEXT: ldr d0, [x8, :lo12:.LCPI52_0]
502 ; CHECK-FP16-GI-NEXT: ret
503 ret <2 x i32> <i32 -65536, i32 65535>
507 declare <2 x i32> @test_movi1d(<2 x i32>, <2 x i32>)
508 define <2 x i32> @movi1d() {
509 ; CHECK-NOFP16-SD-LABEL: movi1d:
510 ; CHECK-NOFP16-SD: // %bb.0:
511 ; CHECK-NOFP16-SD-NEXT: movi d1, #0x00ffffffff0000
512 ; CHECK-NOFP16-SD-NEXT: adrp x8, .LCPI53_0
513 ; CHECK-NOFP16-SD-NEXT: ldr d0, [x8, :lo12:.LCPI53_0]
514 ; CHECK-NOFP16-SD-NEXT: b test_movi1d
516 ; CHECK-FP16-SD-LABEL: movi1d:
517 ; CHECK-FP16-SD: // %bb.0:
518 ; CHECK-FP16-SD-NEXT: movi d1, #0x00ffffffff0000
519 ; CHECK-FP16-SD-NEXT: adrp x8, .LCPI53_0
520 ; CHECK-FP16-SD-NEXT: ldr d0, [x8, :lo12:.LCPI53_0]
521 ; CHECK-FP16-SD-NEXT: b test_movi1d
523 ; CHECK-NOFP16-GI-LABEL: movi1d:
524 ; CHECK-NOFP16-GI: // %bb.0:
525 ; CHECK-NOFP16-GI-NEXT: adrp x8, .LCPI53_1
526 ; CHECK-NOFP16-GI-NEXT: adrp x9, .LCPI53_0
527 ; CHECK-NOFP16-GI-NEXT: ldr d0, [x8, :lo12:.LCPI53_1]
528 ; CHECK-NOFP16-GI-NEXT: ldr d1, [x9, :lo12:.LCPI53_0]
529 ; CHECK-NOFP16-GI-NEXT: b test_movi1d
531 ; CHECK-FP16-GI-LABEL: movi1d:
532 ; CHECK-FP16-GI: // %bb.0:
533 ; CHECK-FP16-GI-NEXT: adrp x8, .LCPI53_1
534 ; CHECK-FP16-GI-NEXT: adrp x9, .LCPI53_0
535 ; CHECK-FP16-GI-NEXT: ldr d0, [x8, :lo12:.LCPI53_1]
536 ; CHECK-FP16-GI-NEXT: ldr d1, [x9, :lo12:.LCPI53_0]
537 ; CHECK-FP16-GI-NEXT: b test_movi1d
538 %1 = tail call <2 x i32> @test_movi1d(<2 x i32> <i32 -2147483648, i32 2147450880>, <2 x i32> <i32 -65536, i32 65535>)
541 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
542 ; CHECK-NOFP16: {{.*}}