Debian Codegraph @

gcc/config/aarch64/aarch64-sve-builtins-sve2.cc

raw
1 /* ACLE support for AArch64 SVE (__ARM_FEATURE_SVE2 intrinsics)
2 Copyright (C) 2020-2025 Free Software Foundation, Inc.
3
4 This file is part of GCC.
5
6 GCC is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
9 any later version.
10
11 GCC is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
19
20 #include "config.h"
21 #include "system.h"
22 #include "coretypes.h"
23 #include "tm.h"
24 #include "tree.h"
25 #include "rtl.h"
26 #include "tm_p.h"
27 #include "memmodel.h"
28 #include "insn-codes.h"
29 #include "optabs.h"
30 #include "recog.h"
31 #include "expr.h"
32 #include "basic-block.h"
33 #include "function.h"
34 #include "fold-const.h"
35 #include "gimple.h"
36 #include "gimple-iterator.h"
37 #include "gimplify.h"
38 #include "explow.h"
39 #include "emit-rtl.h"
40 #include "tree-vector-builder.h"
41 #include "rtx-vector-builder.h"
42 #include "vec-perm-indices.h"
43 #include "aarch64-sve-builtins.h"
44 #include "aarch64-sve-builtins-shapes.h"
45 #include "aarch64-sve-builtins-base.h"
46 #include "aarch64-sve-builtins-sve2.h"
47 #include "aarch64-sve-builtins-functions.h"
48
49 using namespace aarch64_sve;
50
51 namespace {
52
53 /* Return the UNSPEC_CDOT* unspec for rotation amount ROT. */
54 static int
55 unspec_cdot (int rot)
56 {
57 switch (rot)
58 {
59 case 0: return UNSPEC_CDOT;
60 case 90: return UNSPEC_CDOT90;
61 case 180: return UNSPEC_CDOT180;
62 case 270: return UNSPEC_CDOT270;
63 default: gcc_unreachable ();
64 }
65 }
66
67 /* Return the UNSPEC_SQRDCMLAH* unspec for rotation amount ROT. */
68 static int
69 unspec_sqrdcmlah (int rot)
70 {
71 switch (rot)
72 {
73 case 0: return UNSPEC_SQRDCMLAH;
74 case 90: return UNSPEC_SQRDCMLAH90;
75 case 180: return UNSPEC_SQRDCMLAH180;
76 case 270: return UNSPEC_SQRDCMLAH270;
77 default: gcc_unreachable ();
78 }
79 }
80
81 class ld1uxq_st1xq_base : public function_base
82 {
83 public:
84 CONSTEXPR ld1uxq_st1xq_base (machine_mode memory_mode)
85 : m_memory_mode (memory_mode) {}
86
87 tree
88 memory_scalar_type (const function_instance &fi) const override
89 {
90 return fi.scalar_type (0);
91 }
92
93 machine_mode
94 memory_vector_mode (const function_instance &) const override
95 {
96 return m_memory_mode;
97 }
98
99 protected:
100 machine_mode m_memory_mode;
101 };
102
103 class ld234q_st234q_base : public full_width_access
104 {
105 public:
106 CONSTEXPR ld234q_st234q_base (unsigned int vector_count, machine_mode mode)
107 : full_width_access (vector_count), m_mode (mode)
108 {}
109
110 machine_mode
111 memory_vector_mode (const function_instance &) const override
112 {
113 return m_mode;
114 }
115
116 machine_mode m_mode;
117 };
118
119 class svaba_impl : public function_base
120 {
121 public:
122 gimple *
123 fold (gimple_folder &f) const override
124 {
125 /* Fold to svabd if op1 is all zeros. */
126 tree op1 = gimple_call_arg (f.call, 0);
127 if (!integer_zerop (op1))
128 return NULL;
129 function_instance instance ("svabd", functions::svabd, shapes::binary_opt_n,
130 f.mode_suffix_id, f.type_suffix_ids, GROUP_none,
131 PRED_x, FPM_unused);
132 gcall *call = f.redirect_call (instance);
133 /* Add a ptrue as predicate, because unlike svaba, svabd is
134 predicated. */
135 gimple_call_set_arg (call, 0, build_all_ones_cst (f.gp_type ()));
136 return call;
137 }
138
139 public:
140 rtx
141 expand (function_expander &e) const override
142 {
143 rtx_code max_code = e.type_suffix (0).unsigned_p ? UMAX : SMAX;
144 machine_mode mode = e.vector_mode (0);
145 return e.use_exact_insn (code_for_aarch64_sve2_aba (max_code, mode));
146 }
147 };
148
149 class svxar_impl : public function_base
150 {
151 public:
152 rtx
153 expand (function_expander &e) const override
154 {
155 /* aarch64_sve2_xar represents this operation with a left-rotate RTX.
156 Convert the right-rotate amount from the intrinsic to fit this. */
157 machine_mode mode = e.vector_mode (0);
158 HOST_WIDE_INT rot = GET_MODE_UNIT_BITSIZE (mode)
159 - INTVAL (e.args[2]);
160 e.args[2] = aarch64_simd_gen_const_vector_dup (mode, rot);
161 return e.use_exact_insn (code_for_aarch64_sve2_xar (mode));
162 }
163 };
164
165 class svcdot_impl : public function_base
166 {
167 public:
168 rtx
169 expand (function_expander &e) const override
170 {
171 /* Convert the rotation amount into a specific unspec. */
172 int rot = INTVAL (e.args.pop ());
173 return e.use_exact_insn (code_for_aarch64_sve (unspec_cdot (rot),
174 e.vector_mode (0)));
175 }
176 };
177
178 class svcdot_lane_impl : public function_base
179 {
180 public:
181 rtx
182 expand (function_expander &e) const override
183 {
184 /* Convert the rotation amount into a specific unspec. */
185 int rot = INTVAL (e.args.pop ());
186 return e.use_exact_insn (code_for_aarch64_lane (unspec_cdot (rot),
187 e.vector_mode (0)));
188 }
189 };
190
191 class svclamp_impl : public function_base
192 {
193 public:
194 rtx
195 expand (function_expander &e) const override
196 {
197 auto mode = e.tuple_mode (0);
198 insn_code icode;
199 if (e.type_suffix (0).float_p)
200 icode = (e.vectors_per_tuple () > 1
201 ? code_for_aarch64_sve_fclamp_single (mode)
202 : code_for_aarch64_sve_fclamp (mode));
203 else
204 {
205 auto max = e.type_suffix (0).unsigned_p ? UMAX : SMAX;
206 icode = (e.vectors_per_tuple () > 1
207 ? code_for_aarch64_sve_clamp_single (max, mode)
208 : code_for_aarch64_sve_clamp (max, mode));
209 }
210 return e.use_exact_insn (icode);
211 }
212 };
213
214 class svcvtl_impl : public function_base
215 {
216 public:
217 rtx
218 expand (function_expander &e) const override
219 {
220 return e.use_exact_insn (code_for_aarch64_sve_cvtl (e.result_mode ()));
221 }
222 };
223
224 class svcvt_fp8_impl : public function_base
225 {
226 public:
227 CONSTEXPR
228 svcvt_fp8_impl (int unspec) : m_unspec (unspec) {}
229
230 rtx
231 expand (function_expander &e) const override
232 {
233 auto icode = code_for_aarch64_sve2_fp8_cvt (m_unspec, e.result_mode ());
234 return e.use_exact_insn (icode);
235 }
236
237 int m_unspec;
238 };
239
240 class svcvtn_impl : public function_base
241 {
242 public:
243 rtx
244 expand (function_expander &e) const override
245 {
246 insn_code icode;
247 if (e.fpm_mode == FPM_set)
248 icode = code_for_aarch64_sve2_fp8_cvtn (GET_MODE (e.args[0]));
249 else
250 icode = code_for_aarch64_sve_cvtn (e.result_mode ());
251 return e.use_exact_insn (icode);
252 }
253 };
254
255 class svcvtxnt_impl : public CODE_FOR_MODE1 (aarch64_sve2_cvtxnt)
256 {
257 public:
258 gimple *
259 fold (gimple_folder &f) const override
260 {
261 if (f.pred == PRED_x && is_pfalse (gimple_call_arg (f.call, 1)))
262 return f.fold_call_to (build_zero_cst (TREE_TYPE (f.lhs)));
263 return NULL;
264 }
265 };
266
267 class svdup_laneq_impl : public function_base
268 {
269 public:
270 rtx
271 expand (function_expander &e) const override
272 {
273 return e.use_exact_insn (code_for_aarch64_sve_dupq (e.result_mode ()));
274 }
275 };
276
277 class svextq_impl : public permute
278 {
279 public:
280 gimple *
281 fold (gimple_folder &f) const override
282 {
283 unsigned int index = tree_to_uhwi (gimple_call_arg (f.call, 2));
284 machine_mode mode = f.vector_mode (0);
285 unsigned int subelts = 128U / GET_MODE_UNIT_BITSIZE (mode);
286 poly_uint64 nelts = GET_MODE_NUNITS (mode);
287 vec_perm_builder builder (nelts, subelts, 3);
288 for (unsigned int i = 0; i < 3; ++i)
289 for (unsigned int j = 0; j < subelts; ++j)
290 {
291 if (index + j < subelts)
292 builder.quick_push (i * subelts + index + j);
293 else
294 builder.quick_push (i * subelts + index + j - subelts + nelts);
295 }
296 return fold_permute (f, builder);
297 }
298
299 rtx
300 expand (function_expander &e) const override
301 {
302 return e.use_exact_insn (code_for_aarch64_sve_extq (e.vector_mode (0)));
303 }
304 };
305
306 class svld1q_gather_impl : public full_width_access
307 {
308 public:
309 unsigned int
310 call_properties (const function_instance &) const override
311 {
312 return CP_READ_MEMORY;
313 }
314
315 rtx
316 expand (function_expander &e) const override
317 {
318 e.prepare_gather_address_operands (1, false);
319 auto icode = code_for_aarch64_gather_ld1q (e.tuple_mode (0));
320 return e.use_exact_insn (icode);
321 }
322 };
323
324 class svld1uxq_impl : public ld1uxq_st1xq_base
325 {
326 public:
327 using ld1uxq_st1xq_base::ld1uxq_st1xq_base;
328
329 unsigned int
330 call_properties (const function_instance &) const override
331 {
332 return CP_READ_MEMORY;
333 }
334
335 rtx
336 expand (function_expander &e) const override
337 {
338 insn_code icode = code_for_aarch64_sve_ld1_extendq (e.vector_mode (0));
339 return e.use_contiguous_load_insn (icode);
340 }
341 };
342
343 class svld234q_impl : public ld234q_st234q_base
344 {
345 public:
346 using ld234q_st234q_base::ld234q_st234q_base;
347
348 unsigned int
349 call_properties (const function_instance &) const override
350 {
351 return CP_READ_MEMORY;
352 }
353
354 rtx
355 expand (function_expander &e) const override
356 {
357 insn_code icode = code_for_aarch64_sve_ldnq (e.result_mode ());
358 return e.use_contiguous_load_insn (icode);
359 }
360 };
361
362 class svldnt1_gather_impl : public full_width_access
363 {
364 public:
365 unsigned int
366 call_properties (const function_instance &) const override
367 {
368 return CP_READ_MEMORY;
369 }
370
371 rtx
372 expand (function_expander &e) const override
373 {
374 e.prepare_gather_address_operands (1, false);
375 machine_mode mem_mode = e.memory_vector_mode ();
376 return e.use_exact_insn (code_for_aarch64_gather_ldnt (mem_mode));
377 }
378 };
379
380 /* Implements extending forms of svldnt1_gather. */
381 class svldnt1_gather_extend_impl : public extending_load
382 {
383 public:
384 using extending_load::extending_load;
385
386 rtx
387 expand (function_expander &e) const override
388 {
389 e.prepare_gather_address_operands (1, false);
390 /* Add a constant predicate for the extension rtx. */
391 e.args.quick_push (CONSTM1_RTX (VNx16BImode));
392 insn_code icode = code_for_aarch64_gather_ldnt (extend_rtx_code (),
393 e.vector_mode (0),
394 e.memory_vector_mode ());
395 return e.use_exact_insn (icode);
396 }
397 };
398
399 /* Implements both svmatch and svnmatch; the unspec parameter decides
400 between them. */
401 class svmatch_svnmatch_impl : public function_base
402 {
403 public:
404 CONSTEXPR svmatch_svnmatch_impl (int unspec) : m_unspec (unspec) {}
405 gimple *
406 fold (gimple_folder &f) const override
407 {
408 tree pg = gimple_call_arg (f.call, 0);
409 if (is_pfalse (pg))
410 return f.fold_call_to (pg);
411 return NULL;
412 }
413
414 rtx
415 expand (function_expander &e) const override
416 {
417 /* These are UNSPEC_PRED_Z operations and so need a hint operand. */
418 e.add_ptrue_hint (0, e.gp_mode (0));
419 return e.use_exact_insn (code_for_aarch64_pred (m_unspec,
420 e.vector_mode (0)));
421 }
422
423 int m_unspec;
424 };
425
426 /* Implements both svmovlb and svmovlt; the unspec parameters decide
427 between them. */
428 class svmovl_lb_impl : public unspec_based_function_base
429 {
430 public:
431 using unspec_based_function_base::unspec_based_function_base;
432
433 rtx
434 expand (function_expander &e) const override
435 {
436 e.args.quick_push (const0_rtx);
437 return e.map_to_unspecs (m_unspec_for_sint, m_unspec_for_uint,
438 m_unspec_for_fp);
439 }
440 };
441
442 class svpext_lane_impl : public function_base
443 {
444 public:
445 rtx
446 expand (function_expander &e) const override
447 {
448 unsigned int bits = e.type_suffix (0).element_bits;
449 return e.use_exact_insn (e.vectors_per_tuple () == 2
450 ? code_for_aarch64_sve_pextx2 (bits)
451 : code_for_aarch64_sve_pext (bits));
452 }
453 };
454
455 class svpmov_impl : public function_base
456 {
457 public:
458 rtx
459 expand (function_expander &e) const override
460 {
461 insn_code icode;
462 if (e.pred == PRED_z)
463 icode = code_for_aarch64_pmov_to (e.vector_mode (0));
464 else
465 icode = code_for_aarch64_pmov_from (e.vector_mode (0));
466 return e.use_exact_insn (icode);
467 }
468 };
469
470 class svpmov_lane_impl : public function_base
471 {
472 public:
473 rtx
474 expand (function_expander &e) const override
475 {
476 insn_code icode;
477 if (e.pred == PRED_m)
478 icode = code_for_aarch64_pmov_lane_to (e.vector_mode (0));
479 else if (e.args[1] == const0_rtx)
480 icode = code_for_aarch64_pmov_from (e.vector_mode (0));
481 else
482 icode = code_for_aarch64_pmov_lane_from (e.vector_mode (0));
483 return e.use_exact_insn (icode);
484 }
485 };
486
487 class svpsel_lane_impl : public function_base
488 {
489 public:
490 rtx
491 expand (function_expander &e) const override
492 {
493 unsigned int bits = e.type_suffix (0).element_bits;
494 return e.use_exact_insn (code_for_aarch64_sve_psel (bits));
495 }
496 };
497
498 class svqcadd_impl : public function_base
499 {
500 public:
501 rtx
502 expand (function_expander &e) const override
503 {
504 /* Convert the rotation amount into a specific unspec. */
505 int rot = INTVAL (e.args.pop ());
506 if (rot == 90)
507 return e.map_to_unspecs (UNSPEC_SQCADD90, -1, -1);
508 if (rot == 270)
509 return e.map_to_unspecs (UNSPEC_SQCADD270, -1, -1);
510 gcc_unreachable ();
511 }
512 };
513
514 class svqrdcmlah_impl : public function_base
515 {
516 public:
517 rtx
518 expand (function_expander &e) const override
519 {
520 /* Convert the rotation amount into a specific unspec. */
521 int rot = INTVAL (e.args.pop ());
522 return e.use_exact_insn (code_for_aarch64_sve (unspec_sqrdcmlah (rot),
523 e.vector_mode (0)));
524 }
525 };
526
527 class svqrdcmlah_lane_impl : public function_base
528 {
529 public:
530 rtx
531 expand (function_expander &e) const override
532 {
533 /* Convert the rotation amount into a specific unspec. */
534 int rot = INTVAL (e.args.pop ());
535 return e.use_exact_insn (code_for_aarch64_lane (unspec_sqrdcmlah (rot),
536 e.vector_mode (0)));
537 }
538 };
539
540 class svqrshl_impl : public unspec_based_function
541 {
542 public:
543 CONSTEXPR svqrshl_impl ()
544 : unspec_based_function (UNSPEC_SQRSHL, UNSPEC_UQRSHL, -1) {}
545
546 gimple *
547 fold (gimple_folder &f) const override
548 {
549 if (tree amount = uniform_integer_cst_p (gimple_call_arg (f.call, 2)))
550 {
551 if (wi::to_widest (amount) >= 0)
552 {
553 /* The rounding has no effect, and [SU]QSHL has immediate forms
554 that we can use for sensible shift amounts. */
555 function_instance instance ("svqshl", functions::svqshl,
556 shapes::binary_int_opt_n, MODE_n,
557 f.type_suffix_ids, GROUP_none, f.pred,
558 FPM_unused);
559 return f.redirect_call (instance);
560 }
561 else
562 {
563 /* The saturation has no effect, and [SU]RSHL has immediate forms
564 that we can use for sensible shift amounts. */
565 function_instance instance ("svrshl", functions::svrshl,
566 shapes::binary_int_opt_single_n, MODE_n,
567 f.type_suffix_ids, GROUP_none, f.pred,
568 FPM_unused);
569 return f.redirect_call (instance);
570 }
571 }
572 return NULL;
573 }
574 };
575
576 class svqshl_impl : public unspec_based_function
577 {
578 public:
579 CONSTEXPR svqshl_impl ()
580 : unspec_based_function (UNSPEC_SQSHL, UNSPEC_UQSHL, -1) {}
581
582 gimple *
583 fold (gimple_folder &f) const override
584 {
585 if (tree amount = uniform_integer_cst_p (gimple_call_arg (f.call, 2)))
586 {
587 int element_bits = f.type_suffix (0).element_bits;
588 if (wi::to_widest (amount) >= -element_bits
589 && wi::to_widest (amount) < 0)
590 {
591 /* The saturation has no effect for right shifts, so we can
592 use the immediate form of ASR or LSR. */
593 amount = wide_int_to_tree (TREE_TYPE (amount),
594 -wi::to_wide (amount));
595 function_instance instance ("svasr", functions::svasr,
596 shapes::binary_uint_opt_n, MODE_n,
597 f.type_suffix_ids, GROUP_none, f.pred,
598 FPM_unused);
599 if (f.type_suffix (0).unsigned_p)
600 {
601 instance.base_name = "svlsr";
602 instance.base = functions::svlsr;
603 }
604 gcall *call = f.redirect_call (instance);
605 gimple_call_set_arg (call, 2, amount);
606 return call;
607 }
608 }
609 return NULL;
610 }
611 };
612
613 class svrshl_impl : public unspec_based_function
614 {
615 public:
616 CONSTEXPR svrshl_impl ()
617 : unspec_based_function (UNSPEC_SRSHL, UNSPEC_URSHL, -1) {}
618
619 gimple *
620 fold (gimple_folder &f) const override
621 {
622 if (f.vectors_per_tuple () > 1)
623 return nullptr;
624
625 if (tree amount = uniform_integer_cst_p (gimple_call_arg (f.call, 2)))
626 {
627 if (wi::to_widest (amount) >= 0)
628 {
629 /* The rounding has no effect, and LSL has immediate forms
630 that we can use for sensible shift amounts. */
631 function_instance instance ("svlsl", functions::svlsl,
632 shapes::binary_uint_opt_n, MODE_n,
633 f.type_suffix_ids, GROUP_none, f.pred,
634 FPM_unused);
635 gcall *call = f.redirect_call (instance);
636 gimple_call_set_arg (call, 2, amount);
637 return call;
638 }
639 int element_bits = f.type_suffix (0).element_bits;
640 if (wi::to_widest (amount) >= -element_bits)
641 {
642 /* The shift amount is in range of [SU]RSHR. */
643 amount = wide_int_to_tree (TREE_TYPE (amount),
644 -wi::to_wide (amount));
645 function_instance instance ("svrshr", functions::svrshr,
646 shapes::shift_right_imm, MODE_n,
647 f.type_suffix_ids, GROUP_none, f.pred,
648 FPM_unused);
649 gcall *call = f.redirect_call (instance);
650 gimple_call_set_arg (call, 2, amount);
651 return call;
652 }
653 }
654 return NULL;
655 }
656 };
657
658 class svsqadd_impl : public function_base
659 {
660 public:
661 rtx
662 expand (function_expander &e) const override
663 {
664 machine_mode mode = e.vector_mode (0);
665 if (e.pred == PRED_x
666 && aarch64_sve_sqadd_sqsub_immediate_p (mode, e.args[2], false))
667 return e.map_to_rtx_codes (UNKNOWN, US_PLUS, -1, -1);
668 return e.map_to_unspecs (-1, UNSPEC_USQADD, -1);
669 }
670 };
671
672 class svsra_impl : public function_base
673 {
674 public:
675 gimple *
676 fold (gimple_folder &f) const override
677 {
678 /* Fold to svlsr/svasr if op1 is all zeros. */
679 tree op1 = gimple_call_arg (f.call, 0);
680 if (!integer_zerop (op1))
681 return NULL;
682 function_instance instance ("svlsr", functions::svlsr,
683 shapes::binary_uint_opt_n, MODE_n,
684 f.type_suffix_ids, GROUP_none, PRED_x,
685 FPM_unused);
686 if (!f.type_suffix (0).unsigned_p)
687 {
688 instance.base_name = "svasr";
689 instance.base = functions::svasr;
690 }
691 gcall *call = f.redirect_call (instance);
692 /* Add a ptrue as predicate, because unlike svsra, svlsr/svasr are
693 predicated intrinsics. */
694 gimple_call_set_arg (call, 0, build_all_ones_cst (f.gp_type ()));
695 /* For svsra, the shift amount (imm3) is uint64_t for all function types,
696 but for svlsr/svasr, imm3 has the same width as the function type. */
697 tree imm3 = gimple_call_arg (f.call, 2);
698 tree imm3_prec = wide_int_to_tree (f.scalar_type (0),
699 wi::to_widest (imm3));
700 gimple_call_set_arg (call, 2, imm3_prec);
701 return call;
702 }
703
704 rtx
705 expand (function_expander &e) const override
706 {
707 rtx_code shift_code = e.type_suffix (0).unsigned_p ? LSHIFTRT : ASHIFTRT;
708 machine_mode mode = e.vector_mode (0);
709 return e.use_exact_insn (code_for_aarch64_sve_add (shift_code, mode));
710 }
711 };
712
713 class svst1q_scatter_impl : public full_width_access
714 {
715 public:
716 unsigned int
717 call_properties (const function_instance &) const override
718 {
719 return CP_WRITE_MEMORY;
720 }
721
722 rtx
723 expand (function_expander &e) const override
724 {
725 rtx data = e.args.last ();
726 e.args.last () = aarch64_sve_reinterpret (VNx2DImode, data);
727 e.prepare_gather_address_operands (1, false);
728 return e.use_exact_insn (CODE_FOR_aarch64_scatter_st1q);
729 }
730 };
731
732 class svst1xq_impl : public ld1uxq_st1xq_base
733 {
734 public:
735 using ld1uxq_st1xq_base::ld1uxq_st1xq_base;
736
737 unsigned int
738 call_properties (const function_instance &) const override
739 {
740 return CP_WRITE_MEMORY;
741 }
742
743 rtx
744 expand (function_expander &e) const override
745 {
746 insn_code icode = code_for_aarch64_sve_st1_truncq (e.vector_mode (0));
747 return e.use_contiguous_store_insn (icode);
748 }
749 };
750
751 class svst234q_impl : public ld234q_st234q_base
752 {
753 public:
754 using ld234q_st234q_base::ld234q_st234q_base;
755
756 unsigned int
757 call_properties (const function_instance &) const override
758 {
759 return CP_WRITE_MEMORY;
760 }
761
762 rtx
763 expand (function_expander &e) const override
764 {
765 machine_mode tuple_mode = GET_MODE (e.args.last ());
766 insn_code icode = code_for_aarch64_sve_stnq (tuple_mode);
767 return e.use_contiguous_store_insn (icode);
768 }
769 };
770
771 class svstnt1_scatter_impl : public full_width_access
772 {
773 public:
774 unsigned int
775 call_properties (const function_instance &) const override
776 {
777 return CP_WRITE_MEMORY;
778 }
779
780 rtx
781 expand (function_expander &e) const override
782 {
783 e.prepare_gather_address_operands (1, false);
784 machine_mode mem_mode = e.memory_vector_mode ();
785 return e.use_exact_insn (code_for_aarch64_scatter_stnt (mem_mode));
786 }
787 };
788
789 /* Implements truncating forms of svstnt1_scatter. */
790 class svstnt1_scatter_truncate_impl : public truncating_store
791 {
792 public:
793 using truncating_store::truncating_store;
794
795 rtx
796 expand (function_expander &e) const override
797 {
798 e.prepare_gather_address_operands (1, false);
799 insn_code icode = code_for_aarch64_scatter_stnt (e.vector_mode (0),
800 e.memory_vector_mode ());
801 return e.use_exact_insn (icode);
802 }
803 };
804
805 class svtbl2_impl : public quiet<multi_vector_function>
806 {
807 public:
808 CONSTEXPR svtbl2_impl () : quiet<multi_vector_function> (2) {}
809
810 rtx
811 expand (function_expander &e) const override
812 {
813 return e.use_exact_insn (code_for_aarch64_sve2_tbl2 (e.vector_mode (0)));
814 }
815 };
816
817 class svunpk_impl : public function_base
818 {
819 public:
820 rtx
821 expand (function_expander &e) const override
822 {
823 optab op = (e.type_suffix (0).unsigned_p ? zext_optab : sext_optab);
824 insn_code icode = convert_optab_handler (op, e.result_mode (),
825 GET_MODE (e.args[0]));
826 return e.use_exact_insn (icode);
827 }
828 };
829
830 class svuqadd_impl : public function_base
831 {
832 public:
833 rtx
834 expand (function_expander &e) const override
835 {
836 machine_mode mode = e.vector_mode (0);
837 if (e.pred == PRED_x
838 && aarch64_sve_arith_immediate_p (mode, e.args[2], false))
839 return e.use_unpred_insn (code_for_aarch64_sve_suqadd_const (mode));
840 return e.map_to_unspecs (UNSPEC_SUQADD, -1, -1);
841 }
842 };
843
844 /* Implements svuzpq1 and svuzpq2. */
845 class svuzpq_impl : public binary_permute
846 {
847 public:
848 CONSTEXPR svuzpq_impl (unsigned int base)
849 : binary_permute (base ? UNSPEC_UZPQ2 : UNSPEC_UZPQ1), m_base (base) {}
850
851 gimple *
852 fold (gimple_folder &f) const override
853 {
854 machine_mode mode = f.vector_mode (0);
855 unsigned int subelts = 128U / GET_MODE_UNIT_BITSIZE (mode);
856 poly_uint64 nelts = GET_MODE_NUNITS (mode);
857 vec_perm_builder builder (nelts, subelts, 3);
858 for (unsigned int i = 0; i < 3; ++i)
859 {
860 for (unsigned int j = 0; j < subelts / 2; ++j)
861 builder.quick_push (m_base + j * 2 + i * subelts);
862 for (unsigned int j = 0; j < subelts / 2; ++j)
863 builder.quick_push (m_base + j * 2 + i * subelts + nelts);
864 }
865 return fold_permute (f, builder);
866 }
867
868 /* 0 for svuzpq1, 1 for svuzpq2. */
869 unsigned int m_base;
870 };
871
872 /* Implements both svwhilerw and svwhilewr; the unspec parameter decides
873 between them. */
874 class svwhilerw_svwhilewr_impl : public full_width_access
875 {
876 public:
877 CONSTEXPR svwhilerw_svwhilewr_impl (int unspec) : m_unspec (unspec) {}
878
879 rtx
880 expand (function_expander &e) const override
881 {
882 for (unsigned int i = 0; i < 2; ++i)
883 e.args[i] = e.convert_to_pmode (e.args[i]);
884 return e.use_exact_insn (code_for_while (m_unspec, Pmode, e.gp_mode (0)));
885 }
886
887 int m_unspec;
888 };
889
890 /* Implements svzipq1 and svzipq2. */
891 class svzipq_impl : public binary_permute
892 {
893 public:
894 CONSTEXPR svzipq_impl (unsigned int base)
895 : binary_permute (base ? UNSPEC_ZIPQ2 : UNSPEC_ZIPQ1), m_base (base) {}
896
897 gimple *
898 fold (gimple_folder &f) const override
899 {
900 machine_mode mode = f.vector_mode (0);
901 unsigned int pairs = 64U / GET_MODE_UNIT_BITSIZE (mode);
902 poly_uint64 nelts = GET_MODE_NUNITS (mode);
903 auto base = m_base * pairs;
904 vec_perm_builder builder (nelts, pairs * 2, 3);
905 for (unsigned int i = 0; i < 3; ++i)
906 for (unsigned int j = 0; j < pairs; ++j)
907 {
908 builder.quick_push (base + j + i * pairs * 2);
909 builder.quick_push (base + j + i * pairs * 2 + nelts);
910 }
911 return fold_permute (f, builder);
912 }
913
914 /* 0 for svzipq1, 1 for svzipq2. */
915 unsigned int m_base;
916 };
917
918 class svluti_lane_impl : public function_base
919 {
920 public:
921 CONSTEXPR svluti_lane_impl (unsigned int bits) : m_bits (bits)
922 {}
923
924 rtx expand (function_expander &e) const override
925 {
926 auto mode = e.tuple_mode (0);
927 return e.use_exact_insn (code_for_aarch64_sve_luti (m_bits, mode));
928 }
929
930 unsigned int m_bits;
931 };
932
933 } /* end anonymous namespace */
934
935 namespace aarch64_sve {
936
937 FUNCTION (svaba, svaba_impl,)
938 FUNCTION (svabalb, unspec_based_add_function, (UNSPEC_SABDLB,
939 UNSPEC_UABDLB, -1))
940 FUNCTION (svabalt, unspec_based_add_function, (UNSPEC_SABDLT,
941 UNSPEC_UABDLT, -1))
942 FUNCTION (svabdlb, unspec_based_function, (UNSPEC_SABDLB, UNSPEC_UABDLB, -1))
943 FUNCTION (svabdlt, unspec_based_function, (UNSPEC_SABDLT, UNSPEC_UABDLT, -1))
944 FUNCTION (svadalp, unspec_based_function, (UNSPEC_SADALP, UNSPEC_UADALP, -1))
945 FUNCTION (svadclb, unspec_based_function, (-1, UNSPEC_ADCLB, -1))
946 FUNCTION (svadclt, unspec_based_function, (-1, UNSPEC_ADCLT, -1))
947 FUNCTION (svaddhnb, unspec_based_function, (UNSPEC_ADDHNB, UNSPEC_ADDHNB, -1))
948 FUNCTION (svaddhnt, unspec_based_function, (UNSPEC_ADDHNT, UNSPEC_ADDHNT, -1))
949 FUNCTION (svaddlb, unspec_based_function, (UNSPEC_SADDLB, UNSPEC_UADDLB, -1))
950 FUNCTION (svaddlbt, unspec_based_function, (UNSPEC_SADDLBT, -1, -1))
951 FUNCTION (svaddlt, unspec_based_function, (UNSPEC_SADDLT, UNSPEC_UADDLT, -1))
952 FUNCTION (svaddp, unspec_based_pred_function, (UNSPEC_ADDP, UNSPEC_ADDP,
953 UNSPEC_FADDP))
954 FUNCTION (svaddqv, reduction, (UNSPEC_ADDQV, UNSPEC_ADDQV, UNSPEC_FADDQV))
955 FUNCTION (svaddwb, unspec_based_function, (UNSPEC_SADDWB, UNSPEC_UADDWB, -1))
956 FUNCTION (svaddwt, unspec_based_function, (UNSPEC_SADDWT, UNSPEC_UADDWT, -1))
957 FUNCTION (svaesd, fixed_insn_function, (CODE_FOR_aarch64_sve2_aesd))
958 FUNCTION (svaese, fixed_insn_function, (CODE_FOR_aarch64_sve2_aese))
959 FUNCTION (svaesimc, fixed_insn_function, (CODE_FOR_aarch64_sve2_aesimc))
960 FUNCTION (svaesmc, fixed_insn_function, (CODE_FOR_aarch64_sve2_aesmc))
961 FUNCTION (svamax, cond_or_uncond_unspec_function,
962 (UNSPEC_COND_FAMAX, UNSPEC_FAMAX))
963 FUNCTION (svamin, cond_or_uncond_unspec_function,
964 (UNSPEC_COND_FAMIN, UNSPEC_FAMIN))
965 FUNCTION (svandqv, reduction, (UNSPEC_ANDQV, UNSPEC_ANDQV, -1))
966 FUNCTION (svbcax, CODE_FOR_MODE0 (aarch64_sve2_bcax),)
967 FUNCTION (svbdep, unspec_based_function, (UNSPEC_BDEP, UNSPEC_BDEP, -1))
968 FUNCTION (svbext, unspec_based_function, (UNSPEC_BEXT, UNSPEC_BEXT, -1))
969 FUNCTION (svbfmlslb, fixed_insn_function, (CODE_FOR_aarch64_sve_bfmlslbvnx4sf))
970 FUNCTION (svbfmlslb_lane, fixed_insn_function,
971 (CODE_FOR_aarch64_sve_bfmlslb_lanevnx4sf))
972 FUNCTION (svbfmlslt, fixed_insn_function, (CODE_FOR_aarch64_sve_bfmlsltvnx4sf))
973 FUNCTION (svbfmlslt_lane, fixed_insn_function,
974 (CODE_FOR_aarch64_sve_bfmlslt_lanevnx4sf))
975 FUNCTION (svbgrp, unspec_based_function, (UNSPEC_BGRP, UNSPEC_BGRP, -1))
976 FUNCTION (svbsl, CODE_FOR_MODE0 (aarch64_sve2_bsl),)
977 FUNCTION (svbsl1n, CODE_FOR_MODE0 (aarch64_sve2_bsl1n),)
978 FUNCTION (svbsl2n, CODE_FOR_MODE0 (aarch64_sve2_bsl2n),)
979 FUNCTION (svcdot, svcdot_impl,)
980 FUNCTION (svcdot_lane, svcdot_lane_impl,)
981 FUNCTION (svclamp, svclamp_impl,)
982 FUNCTION (svcvt1, svcvt_fp8_impl, (UNSPEC_F1CVT))
983 FUNCTION (svcvt2, svcvt_fp8_impl, (UNSPEC_F2CVT))
984 FUNCTION (svcvtl, svcvtl_impl,)
985 FUNCTION (svcvtlt1, svcvt_fp8_impl, (UNSPEC_F1CVTLT))
986 FUNCTION (svcvtlt2, svcvt_fp8_impl, (UNSPEC_F2CVTLT))
987 FUNCTION (svcvtlt, unspec_based_function, (-1, -1, UNSPEC_COND_FCVTLT))
988 FUNCTION (svcvtn, svcvtn_impl,)
989 FUNCTION (svcvtnb, fixed_insn_function, (CODE_FOR_aarch64_sve2_fp8_cvtnbvnx16qi))
990 FUNCTION (svcvtx, unspec_based_function, (-1, -1, UNSPEC_COND_FCVTX))
991 FUNCTION (svcvtxnt, svcvtxnt_impl,)
992 FUNCTION (svdup_laneq, svdup_laneq_impl,)
993 FUNCTION (sveor3, CODE_FOR_MODE0 (aarch64_sve2_eor3),)
994 FUNCTION (sveorbt, unspec_based_function, (UNSPEC_EORBT, UNSPEC_EORBT, -1))
995 FUNCTION (sveorqv, reduction, (UNSPEC_EORQV, UNSPEC_EORQV, -1))
996 FUNCTION (sveortb, unspec_based_function, (UNSPEC_EORTB, UNSPEC_EORTB, -1))
997 FUNCTION (svextq, svextq_impl,)
998 FUNCTION (svhadd, unspec_based_function, (UNSPEC_SHADD, UNSPEC_UHADD, -1))
999 FUNCTION (svhsub, unspec_based_function, (UNSPEC_SHSUB, UNSPEC_UHSUB, -1))
1000 FUNCTION (svhistcnt, CODE_FOR_MODE0 (aarch64_sve2_histcnt),)
1001 FUNCTION (svhistseg, CODE_FOR_MODE0 (aarch64_sve2_histseg),)
1002 FUNCTION (svhsubr, unspec_based_function_rotated, (UNSPEC_SHSUB,
1003 UNSPEC_UHSUB, -1))
1004 FUNCTION (svld1q_gather, svld1q_gather_impl,)
1005 FUNCTION (svld1udq, svld1uxq_impl, (VNx1DImode))
1006 FUNCTION (svld1uwq, svld1uxq_impl, (VNx1SImode))
1007 FUNCTION (svld2q, svld234q_impl, (2, VNx2TImode))
1008 FUNCTION (svld3q, svld234q_impl, (3, VNx3TImode))
1009 FUNCTION (svld4q, svld234q_impl, (4, VNx4TImode))
1010 FUNCTION (svldnt1_gather, svldnt1_gather_impl,)
1011 FUNCTION (svldnt1sb_gather, svldnt1_gather_extend_impl, (TYPE_SUFFIX_s8))
1012 FUNCTION (svldnt1sh_gather, svldnt1_gather_extend_impl, (TYPE_SUFFIX_s16))
1013 FUNCTION (svldnt1sw_gather, svldnt1_gather_extend_impl, (TYPE_SUFFIX_s32))
1014 FUNCTION (svldnt1ub_gather, svldnt1_gather_extend_impl, (TYPE_SUFFIX_u8))
1015 FUNCTION (svldnt1uh_gather, svldnt1_gather_extend_impl, (TYPE_SUFFIX_u16))
1016 FUNCTION (svldnt1uw_gather, svldnt1_gather_extend_impl, (TYPE_SUFFIX_u32))
1017 FUNCTION (svlogb, unspec_based_function, (-1, -1, UNSPEC_COND_FLOGB))
1018 FUNCTION (svmatch, svmatch_svnmatch_impl, (UNSPEC_MATCH))
1019 FUNCTION (svmaxnmp, unspec_based_pred_function, (-1, -1, UNSPEC_FMAXNMP))
1020 FUNCTION (svmaxnmqv, reduction, (-1, -1, UNSPEC_FMAXNMQV))
1021 FUNCTION (svmaxp, unspec_based_pred_function, (UNSPEC_SMAXP, UNSPEC_UMAXP,
1022 UNSPEC_FMAXP))
1023 FUNCTION (svmaxqv, reduction, (UNSPEC_SMAXQV, UNSPEC_UMAXQV, UNSPEC_FMAXQV))
1024 FUNCTION (svminnmp, unspec_based_pred_function, (-1, -1, UNSPEC_FMINNMP))
1025 FUNCTION (svminnmqv, reduction, (-1, -1, UNSPEC_FMINNMQV))
1026 FUNCTION (svminp, unspec_based_pred_function, (UNSPEC_SMINP, UNSPEC_UMINP,
1027 UNSPEC_FMINP))
1028 FUNCTION (svminqv, reduction, (UNSPEC_SMINQV, UNSPEC_UMINQV, UNSPEC_FMINQV))
1029 FUNCTION (svmlalb_lane, unspec_based_mla_lane_function,
1030 (UNSPEC_SMULLB, UNSPEC_UMULLB, UNSPEC_FMLALB,
1031 UNSPEC_FMLALB_FP8))
1032 FUNCTION (svmlalb, unspec_based_mla_function,
1033 (UNSPEC_SMULLB, UNSPEC_UMULLB, UNSPEC_FMLALB,
1034 UNSPEC_FMLALB_FP8))
1035 FUNCTION (svmlallbb_lane, unspec_based_mla_lane_function,
1036 (-1, -1, -1, UNSPEC_FMLALLBB_FP8))
1037 FUNCTION (svmlallbb, unspec_based_mla_function,
1038 (-1, -1, -1, UNSPEC_FMLALLBB_FP8))
1039 FUNCTION (svmlallbt_lane, unspec_based_mla_lane_function,
1040 (-1, -1, -1, UNSPEC_FMLALLBT_FP8))
1041 FUNCTION (svmlallbt, unspec_based_mla_function,
1042 (-1, -1, -1, UNSPEC_FMLALLBT_FP8))
1043 FUNCTION (svmlalltb_lane, unspec_based_mla_lane_function,
1044 (-1, -1, -1, UNSPEC_FMLALLTB_FP8))
1045 FUNCTION (svmlalltb, unspec_based_mla_function,
1046 (-1, -1, -1, UNSPEC_FMLALLTB_FP8))
1047 FUNCTION (svmlalltt_lane, unspec_based_mla_lane_function,
1048 (-1, -1, -1, UNSPEC_FMLALLTT_FP8))
1049 FUNCTION (svmlalltt, unspec_based_mla_function,
1050 (-1, -1, -1, UNSPEC_FMLALLTT_FP8))
1051 FUNCTION (svmlalt_lane, unspec_based_mla_lane_function,
1052 (UNSPEC_SMULLT, UNSPEC_UMULLT, UNSPEC_FMLALT,
1053 UNSPEC_FMLALT_FP8))
1054 FUNCTION (svmlalt, unspec_based_mla_function,
1055 (UNSPEC_SMULLT, UNSPEC_UMULLT, UNSPEC_FMLALT,
1056 UNSPEC_FMLALT_FP8))
1057 FUNCTION (svmlslb, unspec_based_mls_function, (UNSPEC_SMULLB,
1058 UNSPEC_UMULLB, UNSPEC_FMLSLB))
1059 FUNCTION (svmlslb_lane, unspec_based_mls_lane_function, (UNSPEC_SMULLB,
1060 UNSPEC_UMULLB,
1061 UNSPEC_FMLSLB))
1062 FUNCTION (svmlslt, unspec_based_mls_function, (UNSPEC_SMULLT,
1063 UNSPEC_UMULLT, UNSPEC_FMLSLT))
1064 FUNCTION (svmlslt_lane, unspec_based_mls_lane_function, (UNSPEC_SMULLT,
1065 UNSPEC_UMULLT,
1066 UNSPEC_FMLSLT))
1067 FUNCTION (svmovlb, svmovl_lb_impl, (UNSPEC_SSHLLB, UNSPEC_USHLLB, -1))
1068 FUNCTION (svmovlt, svmovl_lb_impl, (UNSPEC_SSHLLT, UNSPEC_USHLLT, -1))
1069 FUNCTION (svmullb, unspec_based_function, (UNSPEC_SMULLB, UNSPEC_UMULLB, -1))
1070 FUNCTION (svmullb_lane, unspec_based_lane_function, (UNSPEC_SMULLB,
1071 UNSPEC_UMULLB, -1))
1072 FUNCTION (svmullt, unspec_based_function, (UNSPEC_SMULLT, UNSPEC_UMULLT, -1))
1073 FUNCTION (svmullt_lane, unspec_based_lane_function, (UNSPEC_SMULLT,
1074 UNSPEC_UMULLT, -1))
1075 FUNCTION (svnbsl, CODE_FOR_MODE0 (aarch64_sve2_nbsl),)
1076 FUNCTION (svnmatch, svmatch_svnmatch_impl, (UNSPEC_NMATCH))
1077 FUNCTION (svorqv, reduction, (UNSPEC_ORQV, UNSPEC_ORQV, -1))
1078 FUNCTION (svpext_lane, svpext_lane_impl,)
1079 FUNCTION (svpmov, svpmov_impl,)
1080 FUNCTION (svpmov_lane, svpmov_lane_impl,)
1081 FUNCTION (svpmul, CODE_FOR_MODE0 (aarch64_sve2_pmul),)
1082 FUNCTION (svpmullb, unspec_based_function, (-1, UNSPEC_PMULLB, -1))
1083 FUNCTION (svpmullb_pair, unspec_based_function, (-1, UNSPEC_PMULLB_PAIR, -1))
1084 FUNCTION (svpmullt, unspec_based_function, (-1, UNSPEC_PMULLT, -1))
1085 FUNCTION (svpmullt_pair, unspec_based_function, (-1, UNSPEC_PMULLT_PAIR, -1))
1086 FUNCTION (svpsel_lane, svpsel_lane_impl,)
1087 FUNCTION (svqabs, rtx_code_function, (SS_ABS, UNKNOWN, UNKNOWN))
1088 FUNCTION (svqcadd, svqcadd_impl,)
1089 FUNCTION (svqcvt, integer_conversion, (UNSPEC_SQCVT, UNSPEC_SQCVTU,
1090 UNSPEC_UQCVT, -1))
1091 FUNCTION (svqcvtn, integer_conversion, (UNSPEC_SQCVTN, UNSPEC_SQCVTUN,
1092 UNSPEC_UQCVTN, -1))
1093 FUNCTION (svqdmlalb, unspec_based_qadd_function, (UNSPEC_SQDMULLB, -1, -1))
1094 FUNCTION (svqdmlalb_lane, unspec_based_qadd_lane_function, (UNSPEC_SQDMULLB,
1095 -1, -1))
1096 FUNCTION (svqdmlalbt, unspec_based_qadd_function, (UNSPEC_SQDMULLBT, -1, -1))
1097 FUNCTION (svqdmlalt, unspec_based_qadd_function, (UNSPEC_SQDMULLT, -1, -1))
1098 FUNCTION (svqdmlalt_lane, unspec_based_qadd_lane_function, (UNSPEC_SQDMULLT,
1099 -1, -1))
1100 FUNCTION (svqdmlslb, unspec_based_qsub_function, (UNSPEC_SQDMULLB, -1, -1))
1101 FUNCTION (svqdmlslb_lane, unspec_based_qsub_lane_function, (UNSPEC_SQDMULLB,
1102 -1, -1))
1103 FUNCTION (svqdmlslbt, unspec_based_qsub_function, (UNSPEC_SQDMULLBT, -1, -1))
1104 FUNCTION (svqdmlslt, unspec_based_qsub_function, (UNSPEC_SQDMULLT, -1, -1))
1105 FUNCTION (svqdmlslt_lane, unspec_based_qsub_lane_function, (UNSPEC_SQDMULLT,
1106 -1, -1))
1107 FUNCTION (svqdmulh, unspec_based_function, (UNSPEC_SQDMULH, -1, -1))
1108 FUNCTION (svqdmulh_lane, unspec_based_lane_function, (UNSPEC_SQDMULH, -1, -1))
1109 FUNCTION (svqdmullb, unspec_based_function, (UNSPEC_SQDMULLB, -1, -1))
1110 FUNCTION (svqdmullb_lane, unspec_based_lane_function, (UNSPEC_SQDMULLB,
1111 -1, -1))
1112 FUNCTION (svqdmullt, unspec_based_function, (UNSPEC_SQDMULLT, -1, -1))
1113 FUNCTION (svqdmullt_lane, unspec_based_lane_function, (UNSPEC_SQDMULLT,
1114 -1, -1))
1115 FUNCTION (svqneg, rtx_code_function, (SS_NEG, UNKNOWN, UNKNOWN))
1116 FUNCTION (svqrdcmlah, svqrdcmlah_impl,)
1117 FUNCTION (svqrdcmlah_lane, svqrdcmlah_lane_impl,)
1118 FUNCTION (svqrdmlah, unspec_based_function, (UNSPEC_SQRDMLAH, -1, -1))
1119 FUNCTION (svqrdmlah_lane, unspec_based_lane_function, (UNSPEC_SQRDMLAH,
1120 -1, -1))
1121 FUNCTION (svqrdmlsh, unspec_based_function, (UNSPEC_SQRDMLSH, -1, -1))
1122 FUNCTION (svqrdmlsh_lane, unspec_based_lane_function, (UNSPEC_SQRDMLSH,
1123 -1, -1))
1124 FUNCTION (svqrdmulh, unspec_based_function, (UNSPEC_SQRDMULH, -1, -1))
1125 FUNCTION (svqrdmulh_lane, unspec_based_lane_function, (UNSPEC_SQRDMULH,
1126 -1, -1))
1127 FUNCTION (svqrshl, svqrshl_impl,)
1128 FUNCTION (svqrshr, unspec_based_uncond_function, (UNSPEC_SQRSHR,
1129 UNSPEC_UQRSHR, -1, -1, 1))
1130 FUNCTION (svqrshrn, unspec_based_uncond_function, (UNSPEC_SQRSHRN,
1131 UNSPEC_UQRSHRN, -1, -1, 1))
1132 FUNCTION (svqrshrnb, unspec_based_function, (UNSPEC_SQRSHRNB,
1133 UNSPEC_UQRSHRNB, -1))
1134 FUNCTION (svqrshrnt, unspec_based_function, (UNSPEC_SQRSHRNT,
1135 UNSPEC_UQRSHRNT, -1))
1136 FUNCTION (svqrshru, unspec_based_uncond_function, (UNSPEC_SQRSHRU, -1, -1, -1, 1))
1137 FUNCTION (svqrshrun, unspec_based_uncond_function, (UNSPEC_SQRSHRUN, -1, -1, -1, 1))
1138 FUNCTION (svqrshrunb, unspec_based_function, (UNSPEC_SQRSHRUNB, -1, -1))
1139 FUNCTION (svqrshrunt, unspec_based_function, (UNSPEC_SQRSHRUNT, -1, -1))
1140 FUNCTION (svqshl, svqshl_impl,)
1141 FUNCTION (svqshlu, unspec_based_function, (UNSPEC_SQSHLU, -1, -1))
1142 FUNCTION (svqshrnb, unspec_based_function, (UNSPEC_SQSHRNB,
1143 UNSPEC_UQSHRNB, -1))
1144 FUNCTION (svqshrnt, unspec_based_function, (UNSPEC_SQSHRNT,
1145 UNSPEC_UQSHRNT, -1))
1146 FUNCTION (svqshrunb, unspec_based_function, (UNSPEC_SQSHRUNB, -1, -1))
1147 FUNCTION (svqshrunt, unspec_based_function, (UNSPEC_SQSHRUNT, -1, -1))
1148 FUNCTION (svqsubr, rtx_code_function_rotated, (SS_MINUS, US_MINUS, -1))
1149 FUNCTION (svqxtnb, unspec_based_function, (UNSPEC_SQXTNB, UNSPEC_UQXTNB, -1))
1150 FUNCTION (svqxtnt, unspec_based_function, (UNSPEC_SQXTNT, UNSPEC_UQXTNT, -1))
1151 FUNCTION (svqxtunb, unspec_based_function, (UNSPEC_SQXTUNB, -1, -1))
1152 FUNCTION (svqxtunt, unspec_based_function, (UNSPEC_SQXTUNT, -1, -1))
1153 FUNCTION (svraddhnb, unspec_based_function, (UNSPEC_RADDHNB,
1154 UNSPEC_RADDHNB, -1))
1155 FUNCTION (svraddhnt, unspec_based_function, (UNSPEC_RADDHNT,
1156 UNSPEC_RADDHNT, -1))
1157 FUNCTION (svrax1, fixed_insn_function, (CODE_FOR_aarch64_sve2_rax1))
1158 FUNCTION (svrevd, unspec_based_function, (UNSPEC_REVD, UNSPEC_REVD,
1159 UNSPEC_REVD))
1160 FUNCTION (svrhadd, unspec_based_function, (UNSPEC_SRHADD, UNSPEC_URHADD, -1))
1161 FUNCTION (svrshl, svrshl_impl,)
1162 FUNCTION (svrshr, unspec_based_function, (UNSPEC_SRSHR, UNSPEC_URSHR, -1))
1163 FUNCTION (svrshrnb, unspec_based_function, (UNSPEC_RSHRNB, UNSPEC_RSHRNB, -1))
1164 FUNCTION (svrshrnt, unspec_based_function, (UNSPEC_RSHRNT, UNSPEC_RSHRNT, -1))
1165 FUNCTION (svrsra, unspec_based_add_function, (UNSPEC_SRSHR, UNSPEC_URSHR, -1))
1166 FUNCTION (svrsubhnb, unspec_based_function, (UNSPEC_RSUBHNB,
1167 UNSPEC_RSUBHNB, -1))
1168 FUNCTION (svrsubhnt, unspec_based_function, (UNSPEC_RSUBHNT,
1169 UNSPEC_RSUBHNT, -1))
1170 FUNCTION (svsbclb, unspec_based_function, (-1, UNSPEC_SBCLB, -1))
1171 FUNCTION (svsbclt, unspec_based_function, (-1, UNSPEC_SBCLT, -1))
1172 FUNCTION (svshllb, unspec_based_function, (UNSPEC_SSHLLB, UNSPEC_USHLLB, -1))
1173 FUNCTION (svshllt, unspec_based_function, (UNSPEC_SSHLLT, UNSPEC_USHLLT, -1))
1174 FUNCTION (svshrnb, unspec_based_function, (UNSPEC_SHRNB, UNSPEC_SHRNB, -1))
1175 FUNCTION (svshrnt, unspec_based_function, (UNSPEC_SHRNT, UNSPEC_SHRNT, -1))
1176 FUNCTION (svsli, unspec_based_function, (UNSPEC_SLI, UNSPEC_SLI, -1))
1177 FUNCTION (svsm4e, fixed_insn_function, (CODE_FOR_aarch64_sve2_sm4e))
1178 FUNCTION (svsm4ekey, fixed_insn_function, (CODE_FOR_aarch64_sve2_sm4ekey))
1179 FUNCTION (svsqadd, svsqadd_impl,)
1180 FUNCTION (svsra, svsra_impl,)
1181 FUNCTION (svsri, unspec_based_function, (UNSPEC_SRI, UNSPEC_SRI, -1))
1182 FUNCTION (svst1dq, svst1xq_impl, (VNx1DImode))
1183 FUNCTION (svst1q_scatter, svst1q_scatter_impl,)
1184 FUNCTION (svst1wq, svst1xq_impl, (VNx1SImode))
1185 FUNCTION (svst2q, svst234q_impl, (2, VNx2TImode))
1186 FUNCTION (svst3q, svst234q_impl, (3, VNx3TImode))
1187 FUNCTION (svst4q, svst234q_impl, (4, VNx4TImode))
1188 FUNCTION (svstnt1_scatter, svstnt1_scatter_impl,)
1189 FUNCTION (svstnt1b_scatter, svstnt1_scatter_truncate_impl, (QImode))
1190 FUNCTION (svstnt1h_scatter, svstnt1_scatter_truncate_impl, (HImode))
1191 FUNCTION (svstnt1w_scatter, svstnt1_scatter_truncate_impl, (SImode))
1192 FUNCTION (svsubhnb, unspec_based_function, (UNSPEC_SUBHNB, UNSPEC_SUBHNB, -1))
1193 FUNCTION (svsubhnt, unspec_based_function, (UNSPEC_SUBHNT, UNSPEC_SUBHNT, -1))
1194 FUNCTION (svsublb, unspec_based_function, (UNSPEC_SSUBLB, UNSPEC_USUBLB, -1))
1195 FUNCTION (svsublbt, unspec_based_function, (UNSPEC_SSUBLBT, -1, -1))
1196 FUNCTION (svsublt, unspec_based_function, (UNSPEC_SSUBLT, UNSPEC_USUBLT, -1))
1197 FUNCTION (svsubltb, unspec_based_function, (UNSPEC_SSUBLTB, -1, -1))
1198 FUNCTION (svsubwb, unspec_based_function, (UNSPEC_SSUBWB, UNSPEC_USUBWB, -1))
1199 FUNCTION (svsubwt, unspec_based_function, (UNSPEC_SSUBWT, UNSPEC_USUBWT, -1))
1200 FUNCTION (svtbl2, svtbl2_impl,)
1201 FUNCTION (svtblq, quiet<unspec_based_uncond_function>, (UNSPEC_TBLQ,
1202 UNSPEC_TBLQ,
1203 UNSPEC_TBLQ))
1204 FUNCTION (svtbx, quiet<unspec_based_uncond_function>, (UNSPEC_TBX, UNSPEC_TBX,
1205 UNSPEC_TBX))
1206 FUNCTION (svtbxq, quiet<unspec_based_uncond_function>, (UNSPEC_TBXQ,
1207 UNSPEC_TBXQ,
1208 UNSPEC_TBXQ))
1209 FUNCTION (svunpk, svunpk_impl,)
1210 FUNCTION (svuqadd, svuqadd_impl,)
1211 FUNCTION (svuzp, multireg_permute, (UNSPEC_UZP))
1212 FUNCTION (svuzpq, multireg_permute, (UNSPEC_UZPQ))
1213 FUNCTION (svuzpq1, svuzpq_impl, (0))
1214 FUNCTION (svuzpq2, svuzpq_impl, (1))
1215 FUNCTION (svwhilege, while_comparison, (UNSPEC_WHILEGE, UNSPEC_WHILEHS))
1216 FUNCTION (svwhilegt, while_comparison, (UNSPEC_WHILEGT, UNSPEC_WHILEHI))
1217 FUNCTION (svwhilerw, svwhilerw_svwhilewr_impl, (UNSPEC_WHILERW))
1218 FUNCTION (svwhilewr, svwhilerw_svwhilewr_impl, (UNSPEC_WHILEWR))
1219 FUNCTION (svxar, svxar_impl,)
1220 FUNCTION (svzip, multireg_permute, (UNSPEC_ZIP))
1221 FUNCTION (svzipq, multireg_permute, (UNSPEC_ZIPQ))
1222 FUNCTION (svzipq1, svzipq_impl, (0))
1223 FUNCTION (svzipq2, svzipq_impl, (1))
1224 FUNCTION (svluti2_lane, svluti_lane_impl, (2))
1225 FUNCTION (svluti4_lane, svluti_lane_impl, (4))
1226
1227 } /* end namespace aarch64_sve */