1 /* ACLE support for AArch64 SVE (function shapes)
2 Copyright (C) 2018-2025 Free Software Foundation, Inc.
4 This file is part of GCC.
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)
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.
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/>. */
20 #ifndef GCC_AARCH64_SVE_BUILTINS_SHAPES_H
21 #define GCC_AARCH64_SVE_BUILTINS_SHAPES_H
25 /* The naming convention is:
27 - to use the name of the function if the rules are very specific to
28 a particular function (e.g. svext, for which the range of the
29 final immediate value is in no way generic).
31 - to use names like "unary" etc. if the rules are somewhat generic,
32 especially if there are no ranges involved.
34 When using generic names, the handling of the final vector argument
35 can be modified as follows:
37 - an "_n" suffix changes the argument from a vector to a scalar.
39 - an "_opt_n" suffix says that there are two forms of each function:
40 one in which the argument is the usual vector, and one in which it
41 is replaced by a scalar.
43 - an "_opt_single" suffix similarly says that the function can take
44 a vector or tuple argument, with the former having a "_single" suffix.
46 - "_int" and "_uint" replace the argument's element type with a
47 signed or unsigned integer of the same width. The suffixes above
48 then indicate whether this final argument is or might be a scalar.
50 - "_int64" and "_uint64" similarly replace the argument's element type
51 with int64_t or uint64_t.
53 - "_wide" replaces the argument's element type with a 64-bit integer
54 of the same signedness. This only makes sense for integer elements.
56 - "_lane" indicates that the argument is indexed by a constant lane
57 number, provided as an immediately-following argument of type uint64_t.
61 - "inherent" means that the function takes no arguments.
63 - "_rotate" means that the final argument is a rotation amount
66 - "_scalar" indicates that all data arguments are scalars rather
69 - in gather/scatter addresses, "sv" stands for "scalar base,
70 vector displacement" while "vs" stands for "vector base,
73 - "_pred" indicates that the function takes an svbool_t argument
74 that does not act as a governing predicate..
76 - "_group_selection" indicates that the function takes an imm integer
77 argument that selects a specific group of elements that fit a 128 bit
81 extern const function_shape
*const adr_index
;
82 extern const function_shape
*const adr_offset
;
83 extern const function_shape
*const binary
;
84 extern const function_shape
*const binary_int_opt_n
;
85 extern const function_shape
*const binary_int_opt_single_n
;
86 extern const function_shape
*const binary_lane
;
87 extern const function_shape
*const binary_long_lane
;
88 extern const function_shape
*const binary_long_opt_n
;
89 extern const function_shape
*const binary_n
;
90 extern const function_shape
*const binary_narrowb_opt_n
;
91 extern const function_shape
*const binary_narrowt_opt_n
;
92 extern const function_shape
*const binary_opt_n
;
93 extern const function_shape
*const binary_opt_single_n
;
94 extern const function_shape
*const binary_pred
;
95 extern const function_shape
*const binary_rotate
;
96 extern const function_shape
*const binary_scalar
;
97 extern const function_shape
*const binary_single
;
98 extern const function_shape
*const binary_to_uint
;
99 extern const function_shape
*const binary_uint
;
100 extern const function_shape
*const binary_uint_n
;
101 extern const function_shape
*const binary_uint_opt_n
;
102 extern const function_shape
*const binary_uint64_n
;
103 extern const function_shape
*const binary_uint64_opt_n
;
104 extern const function_shape
*const binary_wide
;
105 extern const function_shape
*const binary_wide_opt_n
;
106 extern const function_shape
*const binary_za_int_m
;
107 extern const function_shape
*const binary_za_m
;
108 extern const function_shape
*const binary_za_slice_lane
;
109 extern const function_shape
*const binary_za_slice_int_opt_single
;
110 extern const function_shape
*const binary_za_slice_opt_single
;
111 extern const function_shape
*const binary_za_slice_uint_opt_single
;
112 extern const function_shape
*const binary_za_uint_m
;
113 extern const function_shape
*const binaryxn
;
114 extern const function_shape
*const bool_inherent
;
115 extern const function_shape
*const clamp
;
116 extern const function_shape
*const clast
;
117 extern const function_shape
*const compare
;
118 extern const function_shape
*const compare_opt_n
;
119 extern const function_shape
*const compare_ptr
;
120 extern const function_shape
*const compare_scalar
;
121 extern const function_shape
*const compare_scalar_count
;
122 extern const function_shape
*const compare_wide_opt_n
;
123 extern const function_shape
*const count_inherent
;
124 extern const function_shape
*const count_pat
;
125 extern const function_shape
*const count_pred
;
126 extern const function_shape
*const count_pred_c
;
127 extern const function_shape
*const count_vector
;
128 extern const function_shape
*const create
;
129 extern const function_shape
*const dot_za_slice_int_lane
;
130 extern const function_shape
*const dot_za_slice_lane
;
131 extern const function_shape
*const dot_za_slice_uint_lane
;
132 extern const function_shape
*const dupq
;
133 extern const function_shape
*const dup_neonq
;
134 extern const function_shape
*const ext
;
135 extern const function_shape
*const extq
;
136 extern const function_shape
*const extract_pred
;
137 extern const function_shape
*const fold_left
;
138 extern const function_shape
*const get
;
139 extern const function_shape
*const get_neonq
;
140 extern const function_shape
*const inc_dec
;
141 extern const function_shape
*const inc_dec_pat
;
142 extern const function_shape
*const inc_dec_pred
;
143 extern const function_shape
*const inc_dec_pred_scalar
;
144 extern const function_shape
*const inherent
;
145 extern const function_shape
*const inherent_b
;
146 extern const function_shape
*const inherent_za
;
147 extern const function_shape
*const inherent_za_slice
;
148 extern const function_shape
*const inherent_zt
;
149 extern const function_shape
*const inherent_mask_za
;
150 extern const function_shape
*const ldr_zt
;
151 extern const function_shape
*const ldr_za
;
152 extern const function_shape
*const load
;
153 extern const function_shape
*const load_ext
;
154 extern const function_shape
*const load_ext_gather_index
;
155 extern const function_shape
*const load_ext_gather_index_restricted
;
156 extern const function_shape
*const load_ext_gather_offset
;
157 extern const function_shape
*const load_ext_gather_offset_restricted
;
158 extern const function_shape
*const load_gather_sv
;
159 extern const function_shape
*const load_gather_sv_restricted
;
160 extern const function_shape
*const load_gather_vs
;
161 extern const function_shape
*const load_gather64_sv_index
;
162 extern const function_shape
*const load_gather64_sv_offset
;
163 extern const function_shape
*const load_gather64_vs_index
;
164 extern const function_shape
*const load_gather64_vs_offset
;
165 extern const function_shape
*const load_replicate
;
166 extern const function_shape
*const load_za
;
167 extern const function_shape
*const luti2
;
168 extern const function_shape
*const luti4
;
169 extern const function_shape
*const luti2_lane_zt
;
170 extern const function_shape
*const luti4_lane_zt
;
171 extern const function_shape
*const mmla
;
172 extern const function_shape
*const pattern_pred
;
173 extern const function_shape
*const pmov_from_vector
;
174 extern const function_shape
*const pmov_from_vector_lane
;
175 extern const function_shape
*const pmov_to_vector_lane
;
176 extern const function_shape
*const prefetch
;
177 extern const function_shape
*const prefetch_gather_index
;
178 extern const function_shape
*const prefetch_gather_offset
;
179 extern const function_shape
*const ptest
;
180 extern const function_shape
*const rdffr
;
181 extern const function_shape
*const read_za
;
182 extern const function_shape
*const read_za_m
;
183 extern const function_shape
*const read_za_slice
;
184 extern const function_shape
*const reduction
;
185 extern const function_shape
*const reduction_neonq
;
186 extern const function_shape
*const reduction_wide
;
187 extern const function_shape
*const reinterpret
;
188 extern const function_shape
*const select_pred
;
189 extern const function_shape
*const set
;
190 extern const function_shape
*const setffr
;
191 extern const function_shape
*const set_neonq
;
192 extern const function_shape
*const shift_left_imm_long
;
193 extern const function_shape
*const shift_left_imm_to_uint
;
194 extern const function_shape
*const shift_right_imm
;
195 extern const function_shape
*const shift_right_imm_narrowb
;
196 extern const function_shape
*const shift_right_imm_narrowt
;
197 extern const function_shape
*const shift_right_imm_narrowxn
;
198 extern const function_shape
*const shift_right_imm_narrowb_to_uint
;
199 extern const function_shape
*const shift_right_imm_narrowt_to_uint
;
200 extern const function_shape
*const store
;
201 extern const function_shape
*const store_scatter_index
;
202 extern const function_shape
*const store_scatter_index_restricted
;
203 extern const function_shape
*const store_scatter_offset
;
204 extern const function_shape
*const store_scatter_offset_restricted
;
205 extern const function_shape
*const store_scatter64_index
;
206 extern const function_shape
*const store_scatter64_offset
;
207 extern const function_shape
*const store_za
;
208 extern const function_shape
*const storexn
;
209 extern const function_shape
*const str_za
;
210 extern const function_shape
*const str_zt
;
211 extern const function_shape
*const tbl_tuple
;
212 extern const function_shape
*const ternary_bfloat
;
213 extern const function_shape
*const ternary_bfloat_lane
;
214 extern const function_shape
*const ternary_bfloat_lanex2
;
215 extern const function_shape
*const ternary_bfloat_opt_n
;
216 extern const function_shape
*const ternary_intq_uintq_lane
;
217 extern const function_shape
*const ternary_intq_uintq_opt_n
;
218 extern const function_shape
*const ternary_lane
;
219 extern const function_shape
*const ternary_lane_rotate
;
220 extern const function_shape
*const ternary_long_lane
;
221 extern const function_shape
*const ternary_long_opt_n
;
222 extern const function_shape
*const ternary_mfloat8
;
223 extern const function_shape
*const ternary_mfloat8_lane
;
224 extern const function_shape
*const ternary_mfloat8_lane_group_selection
;
225 extern const function_shape
*const ternary_mfloat8_opt_n
;
226 extern const function_shape
*const ternary_opt_n
;
227 extern const function_shape
*const ternary_qq_or_011_lane
;
228 extern const function_shape
*const ternary_qq_lane_rotate
;
229 extern const function_shape
*const ternary_qq_opt_n_or_011
;
230 extern const function_shape
*const ternary_qq_rotate
;
231 extern const function_shape
*const ternary_rotate
;
232 extern const function_shape
*const ternary_shift_left_imm
;
233 extern const function_shape
*const ternary_shift_right_imm
;
234 extern const function_shape
*const ternary_uint
;
235 extern const function_shape
*const ternary_uintq_intq
;
236 extern const function_shape
*const ternary_uintq_intq_lane
;
237 extern const function_shape
*const ternary_uintq_intq_opt_n
;
238 extern const function_shape
*const tmad
;
239 extern const function_shape
*const unary
;
240 extern const function_shape
*const unary_convert
;
241 extern const function_shape
*const unary_convert_narrowt
;
242 extern const function_shape
*const unary_convertxn_narrowt
;
243 extern const function_shape
*const unary_convertxn
;
244 extern const function_shape
*const unary_convertxn_narrow
;
245 extern const function_shape
*const unary_lane
;
246 extern const function_shape
*const unary_long
;
247 extern const function_shape
*const unary_n
;
248 extern const function_shape
*const unary_narrowb
;
249 extern const function_shape
*const unary_narrowt
;
250 extern const function_shape
*const unary_narrowb_to_uint
;
251 extern const function_shape
*const unary_narrowt_to_uint
;
252 extern const function_shape
*const unary_pred
;
253 extern const function_shape
*const unary_to_int
;
254 extern const function_shape
*const unary_to_uint
;
255 extern const function_shape
*const unary_uint
;
256 extern const function_shape
*const unary_widen
;
257 extern const function_shape
*const unary_za_m
;
258 extern const function_shape
*const unary_za_slice
;
259 extern const function_shape
*const unaryxn
;
260 extern const function_shape
*const write_za
;
261 extern const function_shape
*const write_za_m
;
262 extern const function_shape
*const write_za_slice
;