Add execution + assembler tests of AArch64 TRN Intrinsics.
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / scalar_intrinsics.c
blobaa041cc2c20e2bb4354d4f168ac29334b16157a5
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -dp" } */
4 #include <arm_neon.h>
6 /* Used to force a variable to a SIMD register. */
7 #define force_simd(V1) asm volatile ("mov %d0, %1.d[0]" \
8 : "=w"(V1) \
9 : "w"(V1) \
10 : /* No clobbers */);
12 /* { dg-final { scan-assembler-times "\\tadd\\tx\[0-9\]+" 2 } } */
14 uint64x1_t
15 test_vaddd_u64 (uint64x1_t a, uint64x1_t b)
17 return vaddd_u64 (a, b);
20 int64x1_t
21 test_vaddd_s64 (int64x1_t a, int64x1_t b)
23 return vaddd_s64 (a, b);
26 /* { dg-final { scan-assembler-times "\\tadd\\td\[0-9\]+" 1 } } */
28 int64x1_t
29 test_vaddd_s64_2 (int64x1_t a, int64x1_t b, int64x1_t c, int64x1_t d)
31 return vqaddd_s64 (vaddd_s64 (vqaddd_s64 (a, b), vqaddd_s64 (c, d)),
32 vqaddd_s64 (a, d));
35 /* { dg-final { scan-assembler-times "\\tabs\\td\[0-9\]+, d\[0-9\]+" 1 } } */
37 int64x1_t
38 test_vabs_s64 (int64x1_t a)
40 uint64x1_t res;
41 force_simd (a);
42 res = vabs_s64 (a);
43 force_simd (res);
44 return res;
47 /* { dg-final { scan-assembler-times "\\tcmeq\\td\[0-9\]+, d\[0-9\]+, d\[0-9\]+" 1 } } */
49 uint64x1_t
50 test_vceqd_s64 (int64x1_t a, int64x1_t b)
52 uint64x1_t res;
53 force_simd (a);
54 force_simd (b);
55 res = vceqd_s64 (a, b);
56 force_simd (res);
57 return res;
60 /* { dg-final { scan-assembler-times "\\tcmeq\\td\[0-9\]+, d\[0-9\]+, #?0" 1 } } */
62 uint64x1_t
63 test_vceqzd_s64 (int64x1_t a)
65 uint64x1_t res;
66 force_simd (a);
67 res = vceqzd_s64 (a);
68 force_simd (res);
69 return res;
72 /* { dg-final { scan-assembler-times "\\tcmge\\td\[0-9\]+, d\[0-9\]+, d\[0-9\]+" 2 } } */
74 uint64x1_t
75 test_vcged_s64 (int64x1_t a, int64x1_t b)
77 uint64x1_t res;
78 force_simd (a);
79 force_simd (b);
80 res = vcged_s64 (a, b);
81 force_simd (res);
82 return res;
85 uint64x1_t
86 test_vcled_s64 (int64x1_t a, int64x1_t b)
88 uint64x1_t res;
89 force_simd (a);
90 force_simd (b);
91 res = vcled_s64 (a, b);
92 force_simd (res);
93 return res;
96 /* Idiom recognition will cause this testcase not to generate
97 the expected cmge instruction, so do not check for it. */
99 uint64x1_t
100 test_vcgezd_s64 (int64x1_t a)
102 uint64x1_t res;
103 force_simd (a);
104 res = vcgezd_s64 (a);
105 force_simd (res);
106 return res;
109 /* { dg-final { scan-assembler-times "\\tcmhs\\td\[0-9\]+, d\[0-9\]+, d\[0-9\]+" 1 } } */
111 uint64x1_t
112 test_vcged_u64 (uint64x1_t a, uint64x1_t b)
114 uint64x1_t res;
115 force_simd (a);
116 force_simd (b);
117 res = vcged_u64 (a, b);
118 force_simd (res);
119 return res;
122 /* { dg-final { scan-assembler-times "\\tcmgt\\td\[0-9\]+, d\[0-9\]+, d\[0-9\]+" 2 } } */
124 uint64x1_t
125 test_vcgtd_s64 (int64x1_t a, int64x1_t b)
127 uint64x1_t res;
128 force_simd (a);
129 force_simd (b);
130 res = vcgtd_s64 (a, b);
131 force_simd (res);
132 return res;
135 uint64x1_t
136 test_vcltd_s64 (int64x1_t a, int64x1_t b)
138 uint64x1_t res;
139 force_simd (a);
140 force_simd (b);
141 res = vcltd_s64 (a, b);
142 force_simd (res);
143 return res;
146 /* { dg-final { scan-assembler-times "\\tcmgt\\td\[0-9\]+, d\[0-9\]+, #?0" 1 } } */
148 uint64x1_t
149 test_vcgtzd_s64 (int64x1_t a)
151 uint64x1_t res;
152 force_simd (a);
153 res = vcgtzd_s64 (a);
154 force_simd (res);
155 return res;
158 /* { dg-final { scan-assembler-times "\\tcmhi\\td\[0-9\]+, d\[0-9\]+, d\[0-9\]+" 1 } } */
160 uint64x1_t
161 test_vcgtd_u64 (uint64x1_t a, uint64x1_t b)
163 uint64x1_t res;
164 force_simd (a);
165 force_simd (b);
166 res = vcgtd_u64 (a, b);
167 force_simd (res);
168 return res;
171 /* { dg-final { scan-assembler-times "\\tcmle\\td\[0-9\]+, d\[0-9\]+, #?0" 1 } } */
173 uint64x1_t
174 test_vclezd_s64 (int64x1_t a)
176 uint64x1_t res;
177 force_simd (a);
178 res = vclezd_s64 (a);
179 force_simd (res);
180 return res;
183 /* Idiom recognition will cause this testcase not to generate
184 the expected cmlt instruction, so do not check for it. */
186 uint64x1_t
187 test_vcltzd_s64 (int64x1_t a)
189 uint64x1_t res;
190 force_simd (a);
191 res = vcltzd_s64 (a);
192 force_simd (res);
193 return res;
196 /* { dg-final { scan-assembler-times "aarch64_get_lanev16qi" 2 } } */
198 int8x1_t
199 test_vdupb_lane_s8 (int8x16_t a)
201 int8x1_t res;
202 force_simd (a);
203 res = vdupb_laneq_s8 (a, 2);
204 force_simd (res);
205 return res;
208 uint8x1_t
209 test_vdupb_lane_u8 (uint8x16_t a)
211 uint8x1_t res;
212 force_simd (a);
213 res = vdupb_laneq_u8 (a, 2);
214 force_simd (res);
215 return res;
218 /* { dg-final { scan-assembler-times "aarch64_get_lanev8hi" 2 } } */
220 int16x1_t
221 test_vduph_lane_s16 (int16x8_t a)
223 int16x1_t res;
224 force_simd (a);
225 res = vduph_laneq_s16 (a, 2);
226 force_simd (res);
227 return res;
230 uint16x1_t
231 test_vduph_lane_u16 (uint16x8_t a)
233 uint16x1_t res;
234 force_simd (a);
235 res = vduph_laneq_u16 (a, 2);
236 force_simd (res);
237 return res;
240 /* { dg-final { scan-assembler-times "aarch64_get_lanev4si" 2 } } */
242 int32x1_t
243 test_vdups_lane_s32 (int32x4_t a)
245 int32x1_t res;
246 force_simd (a);
247 res = vdups_laneq_s32 (a, 2);
248 force_simd (res);
249 return res;
252 uint32x1_t
253 test_vdups_lane_u32 (uint32x4_t a)
255 uint32x1_t res;
256 force_simd (a);
257 res = vdups_laneq_u32 (a, 2);
258 force_simd (res);
259 return res;
262 /* { dg-final { scan-assembler-times "aarch64_get_lanev2di" 2 } } */
264 int64x1_t
265 test_vdupd_lane_s64 (int64x2_t a)
267 int64x1_t res;
268 force_simd (a);
269 res = vdupd_laneq_s64 (a, 1);
270 force_simd (res);
271 return res;
274 uint64x1_t
275 test_vdupd_lane_u64 (uint64x2_t a)
277 uint64x1_t res;
278 force_simd (a);
279 res = vdupd_laneq_u64 (a, 1);
280 force_simd (res);
281 return res;
284 /* { dg-final { scan-assembler-times "\\tcmtst\\td\[0-9\]+, d\[0-9\]+, d\[0-9\]+" 2 } } */
286 int64x1_t
287 test_vtst_s64 (int64x1_t a, int64x1_t b)
289 uint64x1_t res;
290 force_simd (a);
291 force_simd (b);
292 res = vtstd_s64 (a, b);
293 force_simd (res);
294 return res;
297 uint64x1_t
298 test_vtst_u64 (uint64x1_t a, uint64x1_t b)
300 uint64x1_t res;
301 force_simd (a);
302 force_simd (b);
303 res = vtstd_s64 (a, b);
304 force_simd (res);
305 return res;
308 /* { dg-final { scan-assembler-times "\\taddp\\td\[0-9\]+, v\[0-9\]+\.2d" 1 } } */
310 test_vpaddd_s64 (int64x2_t a)
312 return vpaddd_s64 (a);
315 /* { dg-final { scan-assembler-times "\\tuqadd\\td\[0-9\]+" 1 } } */
317 uint64x1_t
318 test_vqaddd_u64 (uint64x1_t a, uint64x1_t b)
320 return vqaddd_u64 (a, b);
323 /* { dg-final { scan-assembler-times "\\tuqadd\\ts\[0-9\]+" 1 } } */
325 uint32x1_t
326 test_vqadds_u32 (uint32x1_t a, uint32x1_t b)
328 return vqadds_u32 (a, b);
331 /* { dg-final { scan-assembler-times "\\tuqadd\\th\[0-9\]+" 1 } } */
333 uint16x1_t
334 test_vqaddh_u16 (uint16x1_t a, uint16x1_t b)
336 return vqaddh_u16 (a, b);
339 /* { dg-final { scan-assembler-times "\\tuqadd\\tb\[0-9\]+" 1 } } */
341 uint8x1_t
342 test_vqaddb_u8 (uint8x1_t a, uint8x1_t b)
344 return vqaddb_u8 (a, b);
347 /* { dg-final { scan-assembler-times "\\tsqadd\\td\[0-9\]+" 5 } } */
349 int64x1_t
350 test_vqaddd_s64 (int64x1_t a, int64x1_t b)
352 return vqaddd_s64 (a, b);
355 /* { dg-final { scan-assembler-times "\\tsqadd\\ts\[0-9\]+, s\[0-9\]+" 1 } } */
357 int32x1_t
358 test_vqadds_s32 (int32x1_t a, int32x1_t b)
360 return vqadds_s32 (a, b);
363 /* { dg-final { scan-assembler-times "\\tsqadd\\th\[0-9\]+, h\[0-9\]+" 1 } } */
365 int16x1_t
366 test_vqaddh_s16 (int16x1_t a, int16x1_t b)
368 return vqaddh_s16 (a, b);
371 /* { dg-final { scan-assembler-times "\\tsqadd\\tb\[0-9\]+, b\[0-9\]+" 1 } } */
373 int8x1_t
374 test_vqaddb_s8 (int8x1_t a, int8x1_t b)
376 return vqaddb_s8 (a, b);
379 /* { dg-final { scan-assembler-times "\\tsqdmlal\\ts\[0-9\]+, h\[0-9\]+, h\[0-9\]+" 1 } } */
381 int32x1_t
382 test_vqdmlalh_s16 (int32x1_t a, int16x1_t b, int16x1_t c)
384 return vqdmlalh_s16 (a, b, c);
387 /* { dg-final { scan-assembler-times "\\tsqdmlal\\ts\[0-9\]+, h\[0-9\]+, v" 1 } } */
389 int32x1_t
390 test_vqdmlalh_lane_s16 (int32x1_t a, int16x1_t b, int16x8_t c)
392 return vqdmlalh_lane_s16 (a, b, c, 3);
395 /* { dg-final { scan-assembler-times "\\tsqdmlal\\td\[0-9\]+, s\[0-9\]+, s\[0-9\]+" 1 } } */
397 int64x1_t
398 test_vqdmlals_s32 (int64x1_t a, int32x1_t b, int32x1_t c)
400 return vqdmlals_s32 (a, b, c);
403 /* { dg-final { scan-assembler-times "\\tsqdmlal\\td\[0-9\]+, s\[0-9\]+, v" 1 } } */
405 int64x1_t
406 test_vqdmlals_lane_s32 (int64x1_t a, int32x1_t b, int32x4_t c)
408 return vqdmlals_lane_s32 (a, b, c, 1);
411 /* { dg-final { scan-assembler-times "\\tsqdmlsl\\ts\[0-9\]+, h\[0-9\]+, h\[0-9\]+" 1 } } */
413 int32x1_t
414 test_vqdmlslh_s16 (int32x1_t a, int16x1_t b, int16x1_t c)
416 return vqdmlslh_s16 (a, b, c);
419 /* { dg-final { scan-assembler-times "\\tsqdmlsl\\ts\[0-9\]+, h\[0-9\]+, v" 1 } } */
421 int32x1_t
422 test_vqdmlslh_lane_s16 (int32x1_t a, int16x1_t b, int16x8_t c)
424 return vqdmlslh_lane_s16 (a, b, c, 3);
427 /* { dg-final { scan-assembler-times "\\tsqdmlsl\\td\[0-9\]+, s\[0-9\]+, s\[0-9\]+" 1 } } */
429 int64x1_t
430 test_vqdmlsls_s32 (int64x1_t a, int32x1_t b, int32x1_t c)
432 return vqdmlsls_s32 (a, b, c);
435 /* { dg-final { scan-assembler-times "\\tsqdmlsl\\td\[0-9\]+, s\[0-9\]+, v" 1 } } */
437 int64x1_t
438 test_vqdmlsls_lane_s32 (int64x1_t a, int32x1_t b, int32x4_t c)
440 return vqdmlsls_lane_s32 (a, b, c, 1);
443 /* { dg-final { scan-assembler-times "\\tsqdmulh\\th\[0-9\]+, h\[0-9\]+, h\[0-9\]+" 1 } } */
445 int16x1_t
446 test_vqdmulhh_s16 (int16x1_t a, int16x1_t b)
448 return vqdmulhh_s16 (a, b);
451 /* { dg-final { scan-assembler-times "\\tsqdmulh\\th\[0-9\]+, h\[0-9\]+, v" 1 } } */
453 int16x1_t
454 test_vqdmulhh_lane_s16 (int16x1_t a, int16x8_t b)
456 return vqdmulhh_lane_s16 (a, b, 3);
459 /* { dg-final { scan-assembler-times "\\tsqdmulh\\ts\[0-9\]+, s\[0-9\]+, s\[0-9\]+" 1 } } */
461 int32x1_t
462 test_vqdmulhs_s32 (int32x1_t a, int32x1_t b)
464 return vqdmulhs_s32 (a, b);
467 /* { dg-final { scan-assembler-times "\\tsqdmulh\\ts\[0-9\]+, s\[0-9\]+, v" 1 } } */
469 int32x1_t
470 test_vqdmulhs_lane_s32 (int32x1_t a, int32x4_t b)
472 return vqdmulhs_lane_s32 (a, b, 3);
475 /* { dg-final { scan-assembler-times "\\tsqdmull\\ts\[0-9\]+, h\[0-9\]+, h\[0-9\]+" 1 } } */
477 int32x1_t
478 test_vqdmullh_s16 (int16x1_t a, int16x1_t b)
480 return vqdmullh_s16 (a, b);
483 /* { dg-final { scan-assembler-times "\\tsqdmull\\ts\[0-9\]+, h\[0-9\]+, v" 1 } } */
485 int32x1_t
486 test_vqdmullh_lane_s16 (int16x1_t a, int16x8_t b)
488 return vqdmullh_lane_s16 (a, b, 3);
491 /* { dg-final { scan-assembler-times "\\tsqdmull\\td\[0-9\]+, s\[0-9\]+, s\[0-9\]+" 1 } } */
493 int64x1_t
494 test_vqdmulls_s32 (int32x1_t a, int32x1_t b)
496 return vqdmulls_s32 (a, b);
499 /* { dg-final { scan-assembler-times "\\tsqdmull\\td\[0-9\]+, s\[0-9\]+, v" 1 } } */
501 int64x1_t
502 test_vqdmulls_lane_s32 (int32x1_t a, int32x4_t b)
504 return vqdmulls_lane_s32 (a, b, 1);
507 /* { dg-final { scan-assembler-times "\\tsqrdmulh\\th\[0-9\]+, h\[0-9\]+, h\[0-9\]+" 1 } } */
509 int16x1_t
510 test_vqrdmulhh_s16 (int16x1_t a, int16x1_t b)
512 return vqrdmulhh_s16 (a, b);
515 /* { dg-final { scan-assembler-times "\\tsqrdmulh\\th\[0-9\]+, h\[0-9\]+, v" 1 } } */
517 int16x1_t
518 test_vqrdmulhh_lane_s16 (int16x1_t a, int16x8_t b)
520 return vqrdmulhh_lane_s16 (a, b, 6);
523 /* { dg-final { scan-assembler-times "\\tsqrdmulh\\ts\[0-9\]+, s\[0-9\]+, s\[0-9\]+" 1 } } */
525 int32x1_t
526 test_vqrdmulhs_s32 (int32x1_t a, int32x1_t b)
528 return vqrdmulhs_s32 (a, b);
531 /* { dg-final { scan-assembler-times "\\tsqrdmulh\\ts\[0-9\]+, s\[0-9\]+, v" 1 } } */
533 int32x1_t
534 test_vqrdmulhs_lane_s32 (int32x1_t a, int32x4_t b)
536 return vqrdmulhs_lane_s32 (a, b, 2);
539 /* { dg-final { scan-assembler-times "\\tsuqadd\\tb\[0-9\]+" 1 } } */
541 int8x1_t
542 test_vuqaddb_s8 (int8x1_t a, int8x1_t b)
544 return vuqaddb_s8 (a, b);
547 /* { dg-final { scan-assembler-times "\\tsuqadd\\th\[0-9\]+" 1 } } */
549 int16x1_t
550 test_vuqaddh_s16 (int16x1_t a, int8x1_t b)
552 return vuqaddh_s16 (a, b);
555 /* { dg-final { scan-assembler-times "\\tsuqadd\\ts\[0-9\]+" 1 } } */
557 int32x1_t
558 test_vuqadds_s32 (int32x1_t a, int8x1_t b)
560 return vuqadds_s32 (a, b);
563 /* { dg-final { scan-assembler-times "\\tsuqadd\\td\[0-9\]+" 1 } } */
565 int64x1_t
566 test_vuqaddd_s64 (int64x1_t a, int8x1_t b)
568 return vuqaddd_s64 (a, b);
571 /* { dg-final { scan-assembler-times "\\tusqadd\\tb\[0-9\]+" 1 } } */
573 uint8x1_t
574 test_vsqaddb_u8 (uint8x1_t a, int8x1_t b)
576 return vsqaddb_u8 (a, b);
579 /* { dg-final { scan-assembler-times "\\tusqadd\\th\[0-9\]+" 1 } } */
581 uint16x1_t
582 test_vsqaddh_u16 (uint16x1_t a, int8x1_t b)
584 return vsqaddh_u16 (a, b);
587 /* { dg-final { scan-assembler-times "\\tusqadd\\ts\[0-9\]+" 1 } } */
589 uint32x1_t
590 test_vsqadds_u32 (uint32x1_t a, int8x1_t b)
592 return vsqadds_u32 (a, b);
595 /* { dg-final { scan-assembler-times "\\tusqadd\\td\[0-9\]+" 1 } } */
597 uint64x1_t
598 test_vsqaddd_u64 (uint64x1_t a, int8x1_t b)
600 return vsqaddd_u64 (a, b);
603 /* { dg-final { scan-assembler-times "\\tsqabs\\tb\[0-9\]+" 1 } } */
605 int8x1_t
606 test_vqabsb_s8 (int8x1_t a)
608 return vqabsb_s8 (a);
611 /* { dg-final { scan-assembler-times "\\tsqabs\\th\[0-9\]+" 1 } } */
613 int16x1_t
614 test_vqabsh_s16 (int16x1_t a)
616 return vqabsh_s16 (a);
619 /* { dg-final { scan-assembler-times "\\tsqabs\\ts\[0-9\]+" 1 } } */
621 int32x1_t
622 test_vqabss_s32 (int32x1_t a)
624 return vqabss_s32 (a);
627 /* { dg-final { scan-assembler-times "\\tsqneg\\tb\[0-9\]+" 1 } } */
629 int8x1_t
630 test_vqnegb_s8 (int8x1_t a)
632 return vqnegb_s8 (a);
635 /* { dg-final { scan-assembler-times "\\tsqneg\\th\[0-9\]+" 1 } } */
637 int16x1_t
638 test_vqnegh_s16 (int16x1_t a)
640 return vqnegh_s16 (a);
643 /* { dg-final { scan-assembler-times "\\tsqneg\\ts\[0-9\]+" 1 } } */
645 int32x1_t
646 test_vqnegs_s32 (int32x1_t a)
648 return vqnegs_s32 (a);
651 /* { dg-final { scan-assembler-times "\\tsqxtun\\tb\[0-9\]+" 1 } } */
653 int8x1_t
654 test_vqmovunh_s16 (int16x1_t a)
656 return vqmovunh_s16 (a);
659 /* { dg-final { scan-assembler-times "\\tsqxtun\\th\[0-9\]+" 1 } } */
661 int16x1_t
662 test_vqmovuns_s32 (int32x1_t a)
664 return vqmovuns_s32 (a);
667 /* { dg-final { scan-assembler-times "\\tsqxtun\\ts\[0-9\]+" 1 } } */
669 int32x1_t
670 test_vqmovund_s64 (int64x1_t a)
672 return vqmovund_s64 (a);
675 /* { dg-final { scan-assembler-times "\\tsqxtn\\tb\[0-9\]+" 1 } } */
677 int8x1_t
678 test_vqmovnh_s16 (int16x1_t a)
680 return vqmovnh_s16 (a);
683 /* { dg-final { scan-assembler-times "\\tsqxtn\\th\[0-9\]+" 1 } } */
685 int16x1_t
686 test_vqmovns_s32 (int32x1_t a)
688 return vqmovns_s32 (a);
691 /* { dg-final { scan-assembler-times "\\tsqxtn\\ts\[0-9\]+" 1 } } */
693 int32x1_t
694 test_vqmovnd_s64 (int64x1_t a)
696 return vqmovnd_s64 (a);
699 /* { dg-final { scan-assembler-times "\\tuqxtn\\tb\[0-9\]+" 1 } } */
701 uint8x1_t
702 test_vqmovnh_u16 (uint16x1_t a)
704 return vqmovnh_u16 (a);
707 /* { dg-final { scan-assembler-times "\\tuqxtn\\th\[0-9\]+" 1 } } */
709 uint16x1_t
710 test_vqmovns_u32 (uint32x1_t a)
712 return vqmovns_u32 (a);
715 /* { dg-final { scan-assembler-times "\\tuqxtn\\ts\[0-9\]+" 1 } } */
717 uint32x1_t
718 test_vqmovnd_u64 (uint64x1_t a)
720 return vqmovnd_u64 (a);
723 /* { dg-final { scan-assembler-times "\\tsub\\tx\[0-9\]+" 2 } } */
725 uint64x1_t
726 test_vsubd_u64 (uint64x1_t a, uint64x1_t b)
728 return vsubd_u64 (a, b);
731 int64x1_t
732 test_vsubd_s64 (int64x1_t a, int64x1_t b)
734 return vsubd_s64 (a, b);
737 /* { dg-final { scan-assembler-times "\\tsub\\td\[0-9\]+" 1 } } */
739 int64x1_t
740 test_vsubd_s64_2 (int64x1_t a, int64x1_t b, int64x1_t c, int64x1_t d)
742 return vqsubd_s64 (vsubd_s64 (vqsubd_s64 (a, b), vqsubd_s64 (c, d)),
743 vqsubd_s64 (a, d));
746 /* { dg-final { scan-assembler-times "\\tuqsub\\td\[0-9\]+" 1 } } */
748 uint64x1_t
749 test_vqsubd_u64 (uint64x1_t a, uint64x1_t b)
751 return vqsubd_u64 (a, b);
754 /* { dg-final { scan-assembler-times "\\tuqsub\\ts\[0-9\]+" 1 } } */
756 uint32x1_t
757 test_vqsubs_u32 (uint32x1_t a, uint32x1_t b)
759 return vqsubs_u32 (a, b);
762 /* { dg-final { scan-assembler-times "\\tuqsub\\th\[0-9\]+" 1 } } */
764 uint16x1_t
765 test_vqsubh_u16 (uint16x1_t a, uint16x1_t b)
767 return vqsubh_u16 (a, b);
770 /* { dg-final { scan-assembler-times "\\tuqsub\\tb\[0-9\]+" 1 } } */
772 uint8x1_t
773 test_vqsubb_u8 (uint8x1_t a, uint8x1_t b)
775 return vqsubb_u8 (a, b);
778 /* { dg-final { scan-assembler-times "\\tsqsub\\td\[0-9\]+" 5 } } */
780 int64x1_t
781 test_vqsubd_s64 (int64x1_t a, int64x1_t b)
783 return vqsubd_s64 (a, b);
786 /* { dg-final { scan-assembler-times "\\tsqsub\\ts\[0-9\]+" 1 } } */
788 int32x1_t
789 test_vqsubs_s32 (int32x1_t a, int32x1_t b)
791 return vqsubs_s32 (a, b);
794 /* { dg-final { scan-assembler-times "\\tsqsub\\th\[0-9\]+" 1 } } */
796 int16x1_t
797 test_vqsubh_s16 (int16x1_t a, int16x1_t b)
799 return vqsubh_s16 (a, b);
802 /* { dg-final { scan-assembler-times "\\tsqsub\\tb\[0-9\]+" 1 } } */
804 int8x1_t
805 test_vqsubb_s8 (int8x1_t a, int8x1_t b)
807 return vqsubb_s8 (a, b);
810 /* { dg-final { scan-assembler-times "\\tsshl\\td\[0-9\]+" 1 } } */
812 int64x1_t
813 test_vshld_s64 (int64x1_t a, int64x1_t b)
815 return vshld_s64 (a, b);
818 /* { dg-final { scan-assembler-times "\\tushl\\td\[0-9\]+" 1 } } */
820 uint64x1_t
821 test_vshld_u64 (uint64x1_t a, uint64x1_t b)
823 return vshld_u64 (a, b);
826 /* { dg-final { scan-assembler-times "\\tsrshl\\td\[0-9\]+" 1 } } */
828 int64x1_t
829 test_vrshld_s64 (int64x1_t a, int64x1_t b)
831 return vrshld_s64 (a, b);
834 /* { dg-final { scan-assembler-times "\\turshl\\td\[0-9\]+" 1 } } */
836 uint64x1_t
837 test_vrshld_u64 (uint64x1_t a, uint64x1_t b)
839 return vrshld_u64 (a, b);
842 /* Other intrinsics can generate an asr instruction (vcltzd, vcgezd),
843 so we cannot check scan-assembler-times. */
845 /* { dg-final { scan-assembler "\\tasr\\tx\[0-9\]+" } } */
847 int64x1_t
848 test_vshrd_n_s64 (int64x1_t a)
850 return vshrd_n_s64 (a, 5);
853 /* { dg-final { scan-assembler-times "\\tlsr\\tx\[0-9\]+" 1 } } */
855 uint64x1_t
856 test_vshrd_n_u64 (uint64x1_t a)
858 return vshrd_n_u64 (a, 3);
861 /* { dg-final { scan-assembler-times "\\tssra\\td\[0-9\]+" 1 } } */
863 int64x1_t
864 test_vsrad_n_s64 (int64x1_t a, int64x1_t b)
866 return vsrad_n_s64 (a, b, 2);
869 /* { dg-final { scan-assembler-times "\\tusra\\td\[0-9\]+" 1 } } */
871 uint64x1_t
872 test_vsrad_n_u64 (uint64x1_t a, uint64x1_t b)
874 return vsrad_n_u64 (a, b, 5);
877 /* { dg-final { scan-assembler-times "\\tsrshr\\td\[0-9\]+" 1 } } */
879 int64x1_t
880 test_vrshrd_n_s64 (int64x1_t a)
882 return vrshrd_n_s64 (a, 5);
885 /* { dg-final { scan-assembler-times "\\turshr\\td\[0-9\]+" 1 } } */
887 uint64x1_t
888 test_vrshrd_n_u64 (uint64x1_t a)
890 return vrshrd_n_u64 (a, 3);
893 /* { dg-final { scan-assembler-times "\\tsrsra\\td\[0-9\]+" 1 } } */
895 int64x1_t
896 test_vrsrad_n_s64 (int64x1_t a, int64x1_t b)
898 return vrsrad_n_s64 (a, b, 3);
901 /* { dg-final { scan-assembler-times "\\tsrsra\\td\[0-9\]+" 1 } } */
903 uint64x1_t
904 test_vrsrad_n_u64 (uint64x1_t a, uint64x1_t b)
906 return vrsrad_n_u64 (a, b, 4);
909 /* { dg-final { scan-assembler-times "\\tsqrshl\\tb\[0-9\]+" 1 } } */
911 int8x1_t
912 test_vqrshlb_s8 (int8x1_t a, int8x1_t b)
914 return vqrshlb_s8 (a, b);
917 /* { dg-final { scan-assembler-times "\\tsqrshl\\th\[0-9\]+" 1 } } */
919 int16x1_t
920 test_vqrshlh_s16 (int16x1_t a, int16x1_t b)
922 return vqrshlh_s16 (a, b);
925 /* { dg-final { scan-assembler-times "\\tsqrshl\\ts\[0-9\]+" 1 } } */
927 int32x1_t
928 test_vqrshls_s32 (int32x1_t a, int32x1_t b)
930 return vqrshls_s32 (a, b);
933 /* { dg-final { scan-assembler-times "\\tsqrshl\\td\[0-9\]+" 1 } } */
935 int64x1_t
936 test_vqrshld_s64 (int64x1_t a, int64x1_t b)
938 return vqrshld_s64 (a, b);
941 /* { dg-final { scan-assembler-times "\\tuqrshl\\tb\[0-9\]+" 1 } } */
943 uint8x1_t
944 test_vqrshlb_u8 (uint8x1_t a, uint8x1_t b)
946 return vqrshlb_u8 (a, b);
949 /* { dg-final { scan-assembler-times "\\tuqrshl\\th\[0-9\]+" 1 } } */
951 uint16x1_t
952 test_vqrshlh_u16 (uint16x1_t a, uint16x1_t b)
954 return vqrshlh_u16 (a, b);
957 /* { dg-final { scan-assembler-times "\\tuqrshl\\ts\[0-9\]+" 1 } } */
959 uint32x1_t
960 test_vqrshls_u32 (uint32x1_t a, uint32x1_t b)
962 return vqrshls_u32 (a, b);
965 /* { dg-final { scan-assembler-times "\\tuqrshl\\td\[0-9\]+" 1 } } */
967 uint64x1_t
968 test_vqrshld_u64 (uint64x1_t a, uint64x1_t b)
970 return vqrshld_u64 (a, b);
973 /* { dg-final { scan-assembler-times "\\tsqshlu\\tb\[0-9\]+" 1 } } */
975 int8x1_t
976 test_vqshlub_n_s8 (int8x1_t a)
978 return vqshlub_n_s8 (a, 3);
981 /* { dg-final { scan-assembler-times "\\tsqshlu\\th\[0-9\]+" 1 } } */
983 int16x1_t
984 test_vqshluh_n_s16 (int16x1_t a)
986 return vqshluh_n_s16 (a, 4);
989 /* { dg-final { scan-assembler-times "\\tsqshlu\\ts\[0-9\]+" 1 } } */
991 int32x1_t
992 test_vqshlus_n_s32 (int32x1_t a)
994 return vqshlus_n_s32 (a, 5);
997 /* { dg-final { scan-assembler-times "\\tsqshlu\\td\[0-9\]+" 1 } } */
999 int64x1_t
1000 test_vqshlud_n_s64 (int64x1_t a)
1002 return vqshlud_n_s64 (a, 6);
1005 /* { dg-final { scan-assembler-times "\\tsqshl\\tb\[0-9\]+" 2 } } */
1007 int8x1_t
1008 test_vqshlb_s8 (int8x1_t a, int8x1_t b)
1010 return vqshlb_s8 (a, b);
1013 int8x1_t
1014 test_vqshlb_n_s8 (int8x1_t a)
1016 return vqshlb_n_s8 (a, 2);
1019 /* { dg-final { scan-assembler-times "\\tsqshl\\th\[0-9\]+" 2 } } */
1021 int16x1_t
1022 test_vqshlh_s16 (int16x1_t a, int16x1_t b)
1024 return vqshlh_s16 (a, b);
1027 int16x1_t
1028 test_vqshlh_n_s16 (int16x1_t a)
1030 return vqshlh_n_s16 (a, 3);
1033 /* { dg-final { scan-assembler-times "\\tsqshl\\ts\[0-9\]+" 2 } } */
1035 int32x1_t
1036 test_vqshls_s32 (int32x1_t a, int32x1_t b)
1038 return vqshls_s32 (a, b);
1041 int32x1_t
1042 test_vqshls_n_s32 (int32x1_t a)
1044 return vqshls_n_s32 (a, 4);
1047 /* { dg-final { scan-assembler-times "\\tsqshl\\td\[0-9\]+" 2 } } */
1049 int64x1_t
1050 test_vqshld_s64 (int64x1_t a, int64x1_t b)
1052 return vqshld_s64 (a, b);
1055 int64x1_t
1056 test_vqshld_n_s64 (int64x1_t a)
1058 return vqshld_n_s64 (a, 5);
1061 /* { dg-final { scan-assembler-times "\\tuqshl\\tb\[0-9\]+" 2 } } */
1063 uint8x1_t
1064 test_vqshlb_u8 (uint8x1_t a, uint8x1_t b)
1066 return vqshlb_u8 (a, b);
1069 uint8x1_t
1070 test_vqshlb_n_u8 (uint8x1_t a)
1072 return vqshlb_n_u8 (a, 2);
1075 /* { dg-final { scan-assembler-times "\\tuqshl\\th\[0-9\]+" 2 } } */
1077 uint16x1_t
1078 test_vqshlh_u16 (uint16x1_t a, uint16x1_t b)
1080 return vqshlh_u16 (a, b);
1083 uint16x1_t
1084 test_vqshlh_n_u16 (uint16x1_t a)
1086 return vqshlh_n_u16 (a, 3);
1089 /* { dg-final { scan-assembler-times "\\tuqshl\\ts\[0-9\]+" 2 } } */
1091 uint32x1_t
1092 test_vqshls_u32 (uint32x1_t a, uint32x1_t b)
1094 return vqshls_u32 (a, b);
1097 uint32x1_t
1098 test_vqshls_n_u32 (uint32x1_t a)
1100 return vqshls_n_u32 (a, 4);
1103 /* { dg-final { scan-assembler-times "\\tuqshl\\td\[0-9\]+" 2 } } */
1105 uint64x1_t
1106 test_vqshld_u64 (uint64x1_t a, uint64x1_t b)
1108 return vqshld_u64 (a, b);
1111 uint64x1_t
1112 test_vqshld_n_u64 (uint64x1_t a)
1114 return vqshld_n_u64 (a, 5);
1117 /* { dg-final { scan-assembler-times "\\tsqshrun\\tb\[0-9\]+" 1 } } */
1119 int8x1_t
1120 test_vqshrunh_n_s16 (int16x1_t a)
1122 return vqshrunh_n_s16 (a, 2);
1125 /* { dg-final { scan-assembler-times "\\tsqshrun\\th\[0-9\]+" 1 } } */
1127 int16x1_t
1128 test_vqshruns_n_s32 (int32x1_t a)
1130 return vqshruns_n_s32 (a, 3);
1133 /* { dg-final { scan-assembler-times "\\tsqshrun\\ts\[0-9\]+" 1 } } */
1135 int32x1_t
1136 test_vqshrund_n_s64 (int64x1_t a)
1138 return vqshrund_n_s64 (a, 4);
1141 /* { dg-final { scan-assembler-times "\\tsqrshrun\\tb\[0-9\]+" 1 } } */
1143 int8x1_t
1144 test_vqrshrunh_n_s16 (int16x1_t a)
1146 return vqrshrunh_n_s16 (a, 2);
1149 /* { dg-final { scan-assembler-times "\\tsqrshrun\\th\[0-9\]+" 1 } } */
1151 int16x1_t
1152 test_vqrshruns_n_s32 (int32x1_t a)
1154 return vqrshruns_n_s32 (a, 3);
1157 /* { dg-final { scan-assembler-times "\\tsqrshrun\\ts\[0-9\]+" 1 } } */
1159 int32x1_t
1160 test_vqrshrund_n_s64 (int64x1_t a)
1162 return vqrshrund_n_s64 (a, 4);
1165 /* { dg-final { scan-assembler-times "\\tsqshrn\\tb\[0-9\]+" 1 } } */
1167 int8x1_t
1168 test_vqshrnh_n_s16 (int16x1_t a)
1170 return vqshrnh_n_s16 (a, 2);
1173 /* { dg-final { scan-assembler-times "\\tsqshrn\\th\[0-9\]+" 1 } } */
1175 int16x1_t
1176 test_vqshrns_n_s32 (int32x1_t a)
1178 return vqshrns_n_s32 (a, 3);
1181 /* { dg-final { scan-assembler-times "\\tsqshrn\\ts\[0-9\]+" 1 } } */
1183 int32x1_t
1184 test_vqshrnd_n_s64 (int64x1_t a)
1186 return vqshrnd_n_s64 (a, 4);
1189 /* { dg-final { scan-assembler-times "\\tuqshrn\\tb\[0-9\]+" 1 } } */
1191 uint8x1_t
1192 test_vqshrnh_n_u16 (uint16x1_t a)
1194 return vqshrnh_n_u16 (a, 2);
1197 /* { dg-final { scan-assembler-times "\\tuqshrn\\th\[0-9\]+" 1 } } */
1199 uint16x1_t
1200 test_vqshrns_n_u32 (uint32x1_t a)
1202 return vqshrns_n_u32 (a, 3);
1205 /* { dg-final { scan-assembler-times "\\tuqshrn\\ts\[0-9\]+" 1 } } */
1207 uint32x1_t
1208 test_vqshrnd_n_u64 (uint64x1_t a)
1210 return vqshrnd_n_u64 (a, 4);
1213 /* { dg-final { scan-assembler-times "\\tsqrshrn\\tb\[0-9\]+" 1 } } */
1215 int8x1_t
1216 test_vqrshrnh_n_s16 (int16x1_t a)
1218 return vqrshrnh_n_s16 (a, 2);
1221 /* { dg-final { scan-assembler-times "\\tsqrshrn\\th\[0-9\]+" 1 } } */
1223 int16x1_t
1224 test_vqrshrns_n_s32 (int32x1_t a)
1226 return vqrshrns_n_s32 (a, 3);
1229 /* { dg-final { scan-assembler-times "\\tsqrshrn\\ts\[0-9\]+" 1 } } */
1231 int32x1_t
1232 test_vqrshrnd_n_s64 (int64x1_t a)
1234 return vqrshrnd_n_s64 (a, 4);
1237 /* { dg-final { scan-assembler-times "\\tuqrshrn\\tb\[0-9\]+" 1 } } */
1239 uint8x1_t
1240 test_vqrshrnh_n_u16 (uint16x1_t a)
1242 return vqrshrnh_n_u16 (a, 2);
1245 /* { dg-final { scan-assembler-times "\\tuqrshrn\\th\[0-9\]+" 1 } } */
1247 uint16x1_t
1248 test_vqrshrns_n_u32 (uint32x1_t a)
1250 return vqrshrns_n_u32 (a, 3);
1253 /* { dg-final { scan-assembler-times "\\tuqrshrn\\ts\[0-9\]+" 1 } } */
1255 uint32x1_t
1256 test_vqrshrnd_n_u64 (uint64x1_t a)
1258 return vqrshrnd_n_u64 (a, 4);
1261 /* { dg-final { scan-assembler-times "\\tlsl\\tx\[0-9\]+" 2 } } */
1263 int64x1_t
1264 test_vshl_n_s64 (int64x1_t a)
1266 return vshld_n_s64 (a, 9);
1269 uint64x1_t
1270 test_vshl_n_u64 (uint64x1_t a)
1272 return vshld_n_u64 (a, 9);
1275 /* { dg-final { scan-assembler-times "\\tsli\\td\[0-9\]+" 2 } } */
1277 int64x1_t
1278 test_vsli_n_s64 (int64x1_t a, int64x1_t b)
1280 return vslid_n_s64 (a, b, 9);
1283 uint64x1_t
1284 test_vsli_n_u64 (uint64x1_t a, uint64x1_t b)
1286 return vslid_n_u64 (a, b, 9);
1289 /* { dg-final { scan-assembler-times "\\tsri\\td\[0-9\]+" 2 } } */
1291 int64x1_t
1292 test_vsri_n_s64 (int64x1_t a, int64x1_t b)
1294 return vsrid_n_s64 (a, b, 9);
1297 uint64x1_t
1298 test_vsri_n_u64 (uint64x1_t a, uint64x1_t b)
1300 return vsrid_n_u64 (a, b, 9);