Debian Codegraph @

gcc/config/riscv/riscv-vector-builtins.cc

raw
1 /* Builtins implementation for RISC-V 'V' Extension for GNU compiler.
2 Copyright (C) 2022-2025 Free Software Foundation, Inc.
3 Contributed by Ju-Zhe Zhong ([email protected]), RiVAI Technologies Ltd.
4
5 This file is part of GCC.
6
7 GCC is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
10 any later version.
11
12 GCC is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
20
21 #define IN_TARGET_CODE 1
22
23 #include "config.h"
24 #include "system.h"
25 #include "coretypes.h"
26 #include "tm.h"
27 #include "tree.h"
28 #include "rtl.h"
29 #include "tm_p.h"
30 #include "memmodel.h"
31 #include "insn-codes.h"
32 #include "optabs.h"
33 #include "recog.h"
34 #include "diagnostic.h"
35 #include "expr.h"
36 #include "function.h"
37 #include "fold-const.h"
38 #include "gimplify.h"
39 #include "explow.h"
40 #include "stor-layout.h"
41 #include "alias.h"
42 #include "langhooks.h"
43 #include "stringpool.h"
44 #include "attribs.h"
45 #include "targhooks.h"
46 #include "regs.h"
47 #include "emit-rtl.h"
48 #include "basic-block.h"
49 #include "gimple.h"
50 #include "gimple-iterator.h"
51 #include "riscv-vector-builtins.h"
52 #include "riscv-vector-builtins-shapes.h"
53 #include "riscv-vector-builtins-bases.h"
54 #include "sifive-vector-builtins-bases.h"
55
56 using namespace riscv_vector;
57
58 namespace riscv_vector {
59
60 /* Static information about each vector type. */
61 struct vector_type_info
62 {
63 /* The name of the type as declared by riscv_vector.h
64 which is recommend to use. For example: 'vint32m1_t'. */
65 const char *name;
66
67 /* ABI name of vector type. The type is always available
68 under this name, even when riscv_vector.h isn't included.
69 For example: '__rvv_int32m1_t'. */
70 const char *abi_name;
71
72 /* The C++ mangling of ABI_NAME. */
73 const char *mangled_name;
74 };
75
76 /* Describes a function decl. */
77 class GTY (()) registered_function
78 {
79 public:
80 function_instance GTY ((skip)) instance;
81
82 /* The decl itself. */
83 tree GTY ((skip)) decl;
84
85 /* The overload hash of non-overloaded intrinsic is determined by
86 the overload name and argument list. Adding the overload name to
87 the hash is also to address the following situations:
88 vint16mf4_t __riscv_vreinterpret_i16mf4 (vfloat16mf4_t src);
89 vuint16mf4_t __riscv_vreinterpret_u16mf4 (vfloat16mf4_t src);
90 The base, shape and argument list of the vreinterpret instance are
91 the same, only the overload name is different. Therefore, it is
92 enough to add overload_name and argument list to the hash value.*/
93 const char *overload_name;
94
95 /* The argument list part of the hash value. Add the unsigned/signed type
96 and machine mode of each argument to the hash value. */
97 vec<tree> GTY ((skip)) argument_types;
98
99 /* True if the decl represents an overloaded function that needs to be
100 resolved. */
101 bool overloaded_p;
102
103 /* The hash value to indicate the non-overloaded function. Generate hash value
104 based on overload_name and argument_types. */
105 hashval_t overloaded_hash () const;
106
107 /* Generate hash value based on the overload_name and the argument list passed
108 by the user when calling. */
109 hashval_t overloaded_hash (const vec<tree, va_gc> &);
110
111 /* The required extension for the register function. */
112 enum required_ext required;
113 };
114
115 /* Hash traits for registered_function. */
116 struct registered_function_hasher : nofree_ptr_hash<registered_function>
117 {
118 typedef function_instance compare_type;
119
120 static hashval_t hash (value_type);
121 static bool equal (value_type, const compare_type &);
122 };
123
124 /* Hash traits for overload registered_function. */
125 struct non_overloaded_registered_function_hasher
126 : nofree_ptr_hash<registered_function>
127 {
128 static hashval_t hash (value_type);
129 static bool equal (value_type, const compare_type &);
130 };
131
132 /* Static information about each RVV type. */
133 static CONSTEXPR const vector_type_info vector_types[] = {
134 #define DEF_RVV_TYPE(NAME, NCHARS, ABI_NAME, ARGS...) \
135 {#NAME, #ABI_NAME, "u" #NCHARS #ABI_NAME},
136 #define DEF_RVV_TUPLE_TYPE(NAME, NCHARS, ABI_NAME, ARGS...) \
137 {#NAME, #ABI_NAME, "u" #NCHARS #ABI_NAME},
138 #include "riscv-vector-builtins.def"
139 };
140
141 /* Static information about operand suffix for each RVV type. */
142 const char *const operand_suffixes[NUM_OP_TYPES] = {
143 "", /* OP_TYPE_none. */
144 #define DEF_RVV_OP_TYPE(NAME) "_" # NAME,
145 #include "riscv-vector-builtins.def"
146 };
147
148 /* Static information about type suffix for each RVV type. */
149 const rvv_builtin_suffixes type_suffixes[NUM_VECTOR_TYPES + 1] = {
150 #define DEF_RVV_TYPE(NAME, NCHARS, ABI_NAME, SCALAR_TYPE, VECTOR_MODE, \
151 VECTOR_SUFFIX, SCALAR_SUFFIX, VSETVL_SUFFIX) \
152 {#VECTOR_SUFFIX, #SCALAR_SUFFIX, #VSETVL_SUFFIX},
153 #define DEF_RVV_TUPLE_TYPE(NAME, NCHARS, ABI_NAME, SUBPART_TYPE, SCALAR_TYPE, \
154 NF, VECTOR_SUFFIX) \
155 {#VECTOR_SUFFIX, "", ""},
156 #include "riscv-vector-builtins.def"
157 };
158
159 /* Static information about predication suffix for each RVV type. */
160 const char *const predication_suffixes[NUM_PRED_TYPES] = {
161 "", /* PRED_TYPE_none. */
162 #define DEF_RVV_PRED_TYPE(NAME) "_" # NAME,
163 #include "riscv-vector-builtins.def"
164 };
165
166 /* A list of all signed integer will be registered for intrinsic functions. */
167 static const rvv_type_info none_ops[] = {{NUM_VECTOR_TYPES, 0}};
168
169 /* A list of all signed integer will be registered for intrinsic functions. */
170 static const rvv_type_info i_ops[] = {
171 #define DEF_RVV_I_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
172 #include "riscv-vector-builtins-types.def"
173 {NUM_VECTOR_TYPES, 0}};
174
175 /* A list of all signed integer can be widened will be registered for intrinsic
176 * functions. */
177 static const rvv_type_info wi_ops[] = {
178 #define DEF_RVV_WI_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
179 #include "riscv-vector-builtins-types.def"
180 {NUM_VECTOR_TYPES, 0}};
181
182 /* A list of all unsigned integer can be widened will be registered for
183 * intrinsic functions. */
184 static const rvv_type_info wu_ops[] = {
185 #define DEF_RVV_WU_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
186 #include "riscv-vector-builtins-types.def"
187 {NUM_VECTOR_TYPES, 0}};
188
189 /* A list of all floating-point can be widened will be registered for intrinsic
190 * functions. */
191 static const rvv_type_info wf_ops[] = {
192 #define DEF_RVV_WF_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
193 #include "riscv-vector-builtins-types.def"
194 {NUM_VECTOR_TYPES, 0}};
195
196 /* A list of all signed integer that SEW = 64 require full 'V' extension will be
197 registered for intrinsic functions. */
198 static const rvv_type_info full_v_i_ops[] = {
199 #define DEF_RVV_FULL_V_I_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
200 #include "riscv-vector-builtins-types.def"
201 {NUM_VECTOR_TYPES, 0}};
202
203 /* A list of all unsigned integer that SEW = 64 require full 'V' extension will
204 be registered for intrinsic functions. */
205 static const rvv_type_info full_v_u_ops[] = {
206 #define DEF_RVV_FULL_V_U_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
207 #include "riscv-vector-builtins-types.def"
208 {NUM_VECTOR_TYPES, 0}};
209
210 /* A list of all unsigned integer will be registered for intrinsic functions. */
211 static const rvv_type_info u_ops[] = {
212 #define DEF_RVV_U_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
213 #include "riscv-vector-builtins-types.def"
214 {NUM_VECTOR_TYPES, 0}};
215
216 /* A list of all signed integer will be registered for intrinsic functions. */
217 static const rvv_type_info convert_i_ops[] = {
218 #define DEF_RVV_CONVERT_I_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
219 #include "riscv-vector-builtins-types.def"
220 {NUM_VECTOR_TYPES, 0}};
221
222 /* A list of all unsigned integer will be registered for intrinsic functions. */
223 static const rvv_type_info convert_u_ops[] = {
224 #define DEF_RVV_CONVERT_U_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
225 #include "riscv-vector-builtins-types.def"
226 {NUM_VECTOR_TYPES, 0}};
227
228 /* A list of all signed integer will be registered for intrinsic functions. */
229 static const rvv_type_info wconvert_i_ops[] = {
230 #define DEF_RVV_WCONVERT_I_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
231 #include "riscv-vector-builtins-types.def"
232 {NUM_VECTOR_TYPES, 0}};
233
234 /* A list of all unsigned integer will be registered for intrinsic functions. */
235 static const rvv_type_info wconvert_u_ops[] = {
236 #define DEF_RVV_WCONVERT_U_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
237 #include "riscv-vector-builtins-types.def"
238 {NUM_VECTOR_TYPES, 0}};
239
240 /* A list of all floating-point will be registered for intrinsic functions. */
241 static const rvv_type_info wconvert_f_ops[] = {
242 #define DEF_RVV_WCONVERT_F_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
243 #include "riscv-vector-builtins-types.def"
244 {NUM_VECTOR_TYPES, 0}};
245
246 /* A list of all floating-point will be registered for intrinsic functions. */
247 static const rvv_type_info f32_ops[] = {
248 #define DEF_RVV_F32_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
249 #include "riscv-vector-builtins-types.def"
250 {NUM_VECTOR_TYPES, 0}};
251
252 /* A list of all integer will be registered for intrinsic functions. */
253 static const rvv_type_info iu_ops[] = {
254 #define DEF_RVV_I_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
255 #define DEF_RVV_U_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
256 #include "riscv-vector-builtins-types.def"
257 {NUM_VECTOR_TYPES, 0}};
258
259 /* A list of all types will be registered for intrinsic functions. */
260 static const rvv_type_info all_ops[] = {
261 #define DEF_RVV_I_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
262 #define DEF_RVV_U_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
263 #define DEF_RVV_F_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
264 #include "riscv-vector-builtins-types.def"
265 {NUM_VECTOR_TYPES, 0}};
266
267 /* A list of all types will be registered for intrinsic functions. */
268 static const rvv_type_info ei16_ops[] = {
269 #define DEF_RVV_EI16_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
270 #include "riscv-vector-builtins-types.def"
271 {NUM_VECTOR_TYPES, 0}};
272
273 /* A list of all bool will be registered for intrinsic functions. */
274 static const rvv_type_info b_ops[] = {
275 #define DEF_RVV_B_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
276 #include "riscv-vector-builtins-types.def"
277 {NUM_VECTOR_TYPES, 0}};
278
279 /* A list of all float will be registered for intrinsic functions. */
280 static const rvv_type_info f_ops[] = {
281 #define DEF_RVV_F_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
282 #include "riscv-vector-builtins-types.def"
283 {NUM_VECTOR_TYPES, 0}};
284
285 /* A list of Double-Widening signed integer will be registered for intrinsic
286 * functions. */
287 static const rvv_type_info wexti_ops[] = {
288 #define DEF_RVV_WEXTI_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
289 #include "riscv-vector-builtins-types.def"
290 {NUM_VECTOR_TYPES, 0}};
291
292 /* A list of Double-Widening float will be registered for intrinsic functions.
293 */
294 static const rvv_type_info wextf_ops[] = {
295 #define DEF_RVV_WEXTF_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
296 #include "riscv-vector-builtins-types.def"
297 {NUM_VECTOR_TYPES, 0}};
298
299 /* A list of Quad-Widening signed integer will be registered for intrinsic
300 * functions. */
301 static const rvv_type_info qexti_ops[] = {
302 #define DEF_RVV_QEXTI_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
303 #include "riscv-vector-builtins-types.def"
304 {NUM_VECTOR_TYPES, 0}};
305
306 /* A list of Oct-Widening signed integer will be registered for intrinsic
307 * functions. */
308 static const rvv_type_info oexti_ops[] = {
309 #define DEF_RVV_OEXTI_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
310 #include "riscv-vector-builtins-types.def"
311 {NUM_VECTOR_TYPES, 0}};
312
313 /* A list of Double-Widening unsigned integer will be registered for intrinsic
314 * functions. */
315 static const rvv_type_info wextu_ops[] = {
316 #define DEF_RVV_WEXTU_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
317 #include "riscv-vector-builtins-types.def"
318 {NUM_VECTOR_TYPES, 0}};
319
320 /* A list of Double-Widening all integer will be registered for intrinsic
321 * functions. */
322 static const rvv_type_info wextiu_ops[] = {
323 #define DEF_RVV_WEXTI_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
324 #define DEF_RVV_WEXTU_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
325 #include "riscv-vector-builtins-types.def"
326 {NUM_VECTOR_TYPES, 0}};
327
328 /* A list of Quad-Widening unsigned integer will be registered for intrinsic
329 * functions. */
330 static const rvv_type_info qextu_ops[] = {
331 #define DEF_RVV_QEXTU_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
332 #include "riscv-vector-builtins-types.def"
333 {NUM_VECTOR_TYPES, 0}};
334
335 /* A list of Oct-Widening unsigned integer will be registered for intrinsic
336 * functions. */
337 static const rvv_type_info oextu_ops[] = {
338 #define DEF_RVV_OEXTU_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
339 #include "riscv-vector-builtins-types.def"
340 {NUM_VECTOR_TYPES, 0}};
341
342 /* A list of eew8 interpret will be registered for intrinsic functions. */
343 static const rvv_type_info eew8_interpret_ops[] = {
344 #define DEF_RVV_EEW8_INTERPRET_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
345 #include "riscv-vector-builtins-types.def"
346 {NUM_VECTOR_TYPES, 0}};
347
348 /* A list of eew16 interpret will be registered for intrinsic functions. */
349 static const rvv_type_info eew16_interpret_ops[] = {
350 #define DEF_RVV_EEW16_INTERPRET_OPS(TYPE, REQUIRE) \
351 {VECTOR_TYPE_##TYPE, REQUIRE},
352 #include "riscv-vector-builtins-types.def"
353 {NUM_VECTOR_TYPES, 0}};
354
355 /* A list of eew32 interpret will be registered for intrinsic functions. */
356 static const rvv_type_info eew32_interpret_ops[] = {
357 #define DEF_RVV_EEW32_INTERPRET_OPS(TYPE, REQUIRE) \
358 {VECTOR_TYPE_##TYPE, REQUIRE},
359 #include "riscv-vector-builtins-types.def"
360 {NUM_VECTOR_TYPES, 0}};
361
362 /* A list of eew64 interpret will be registered for intrinsic functions. */
363 static const rvv_type_info eew64_interpret_ops[] = {
364 #define DEF_RVV_EEW64_INTERPRET_OPS(TYPE, REQUIRE) \
365 {VECTOR_TYPE_##TYPE, REQUIRE},
366 #include "riscv-vector-builtins-types.def"
367 {NUM_VECTOR_TYPES, 0}};
368
369 /* A list of bool1 interpret will be registered for intrinsic functions. */
370 static const rvv_type_info bool1_interpret_ops[] = {
371 #define DEF_RVV_BOOL1_INTERPRET_OPS(TYPE, REQUIRE) \
372 {VECTOR_TYPE_##TYPE, REQUIRE},
373 #include "riscv-vector-builtins-types.def"
374 {NUM_VECTOR_TYPES, 0}};
375
376 /* A list of bool2 interpret will be registered for intrinsic functions. */
377 static const rvv_type_info bool2_interpret_ops[] = {
378 #define DEF_RVV_BOOL2_INTERPRET_OPS(TYPE, REQUIRE) \
379 {VECTOR_TYPE_##TYPE, REQUIRE},
380 #include "riscv-vector-builtins-types.def"
381 {NUM_VECTOR_TYPES, 0}};
382
383 /* A list of bool4 interpret will be registered for intrinsic functions. */
384 static const rvv_type_info bool4_interpret_ops[] = {
385 #define DEF_RVV_BOOL4_INTERPRET_OPS(TYPE, REQUIRE) \
386 {VECTOR_TYPE_##TYPE, REQUIRE},
387 #include "riscv-vector-builtins-types.def"
388 {NUM_VECTOR_TYPES, 0}};
389
390 /* A list of bool8 interpret will be registered for intrinsic functions. */
391 static const rvv_type_info bool8_interpret_ops[] = {
392 #define DEF_RVV_BOOL8_INTERPRET_OPS(TYPE, REQUIRE) \
393 {VECTOR_TYPE_##TYPE, REQUIRE},
394 #include "riscv-vector-builtins-types.def"
395 {NUM_VECTOR_TYPES, 0}};
396
397 /* A list of bool16 interpret will be registered for intrinsic functions. */
398 static const rvv_type_info bool16_interpret_ops[] = {
399 #define DEF_RVV_BOOL16_INTERPRET_OPS(TYPE, REQUIRE) \
400 {VECTOR_TYPE_##TYPE, REQUIRE},
401 #include "riscv-vector-builtins-types.def"
402 {NUM_VECTOR_TYPES, 0}};
403
404 /* A list of bool32 interpret will be registered for intrinsic functions. */
405 static const rvv_type_info bool32_interpret_ops[] = {
406 #define DEF_RVV_BOOL32_INTERPRET_OPS(TYPE, REQUIRE) \
407 {VECTOR_TYPE_##TYPE, REQUIRE},
408 #include "riscv-vector-builtins-types.def"
409 {NUM_VECTOR_TYPES, 0}};
410
411 /* A list of bool64 interpret will be registered for intrinsic functions. */
412 static const rvv_type_info bool64_interpret_ops[] = {
413 #define DEF_RVV_BOOL64_INTERPRET_OPS(TYPE, REQUIRE) \
414 {VECTOR_TYPE_##TYPE, REQUIRE},
415 #include "riscv-vector-builtins-types.def"
416 {NUM_VECTOR_TYPES, 0}};
417
418 /* A list of vint8m1 interpret will be registered for intrinsic functions. */
419 static const rvv_type_info signed_eew8_lmul1_interpret_ops[] = {
420 #define DEF_RVV_SIGNED_EEW8_LMUL1_INTERPRET_OPS(TYPE, REQUIRE) \
421 {VECTOR_TYPE_##TYPE, REQUIRE},
422 #include "riscv-vector-builtins-types.def"
423 {NUM_VECTOR_TYPES, 0}};
424
425 /* A list of vint16m1 interpret will be registered for intrinsic functions. */
426 static const rvv_type_info signed_eew16_lmul1_interpret_ops[] = {
427 #define DEF_RVV_SIGNED_EEW16_LMUL1_INTERPRET_OPS(TYPE, REQUIRE) \
428 {VECTOR_TYPE_##TYPE, REQUIRE},
429 #include "riscv-vector-builtins-types.def"
430 {NUM_VECTOR_TYPES, 0}};
431
432 /* A list of vint32m1 interpret will be registered for intrinsic functions. */
433 static const rvv_type_info signed_eew32_lmul1_interpret_ops[] = {
434 #define DEF_RVV_SIGNED_EEW32_LMUL1_INTERPRET_OPS(TYPE, REQUIRE) \
435 {VECTOR_TYPE_##TYPE, REQUIRE},
436 #include "riscv-vector-builtins-types.def"
437 {NUM_VECTOR_TYPES, 0}};
438
439 /* A list of vint64m1 interpret will be registered for intrinsic functions. */
440 static const rvv_type_info signed_eew64_lmul1_interpret_ops[] = {
441 #define DEF_RVV_SIGNED_EEW64_LMUL1_INTERPRET_OPS(TYPE, REQUIRE) \
442 {VECTOR_TYPE_##TYPE, REQUIRE},
443 #include "riscv-vector-builtins-types.def"
444 {NUM_VECTOR_TYPES, 0}};
445
446 /* A list of vuint8m1 interpret will be registered for intrinsic functions. */
447 static const rvv_type_info unsigned_eew8_lmul1_interpret_ops[] = {
448 #define DEF_RVV_UNSIGNED_EEW8_LMUL1_INTERPRET_OPS(TYPE, REQUIRE) \
449 {VECTOR_TYPE_##TYPE, REQUIRE},
450 #include "riscv-vector-builtins-types.def"
451 {NUM_VECTOR_TYPES, 0}};
452
453 /* A list of vuint16m1 interpret will be registered for intrinsic functions. */
454 static const rvv_type_info unsigned_eew16_lmul1_interpret_ops[] = {
455 #define DEF_RVV_UNSIGNED_EEW16_LMUL1_INTERPRET_OPS(TYPE, REQUIRE) \
456 {VECTOR_TYPE_##TYPE, REQUIRE},
457 #include "riscv-vector-builtins-types.def"
458 {NUM_VECTOR_TYPES, 0}};
459
460 /* A list of vuint32m1 interpret will be registered for intrinsic functions. */
461 static const rvv_type_info unsigned_eew32_lmul1_interpret_ops[] = {
462 #define DEF_RVV_UNSIGNED_EEW32_LMUL1_INTERPRET_OPS(TYPE, REQUIRE) \
463 {VECTOR_TYPE_##TYPE, REQUIRE},
464 #include "riscv-vector-builtins-types.def"
465 {NUM_VECTOR_TYPES, 0}};
466
467 /* A list of vuint64m1 interpret will be registered for intrinsic functions. */
468 static const rvv_type_info unsigned_eew64_lmul1_interpret_ops[] = {
469 #define DEF_RVV_UNSIGNED_EEW64_LMUL1_INTERPRET_OPS(TYPE, REQUIRE) \
470 {VECTOR_TYPE_##TYPE, REQUIRE},
471 #include "riscv-vector-builtins-types.def"
472 {NUM_VECTOR_TYPES, 0}};
473
474 /* A list of x2 vlmul ext will be registered for intrinsic functions. */
475 static const rvv_type_info vlmul_ext_x2_ops[] = {
476 #define DEF_RVV_X2_VLMUL_EXT_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
477 #include "riscv-vector-builtins-types.def"
478 {NUM_VECTOR_TYPES, 0}};
479
480 /* A list of x4 vlmul ext will be registered for intrinsic functions. */
481 static const rvv_type_info vlmul_ext_x4_ops[] = {
482 #define DEF_RVV_X4_VLMUL_EXT_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
483 #include "riscv-vector-builtins-types.def"
484 {NUM_VECTOR_TYPES, 0}};
485
486 /* A list of x8 vlmul ext will be registered for intrinsic functions. */
487 static const rvv_type_info vlmul_ext_x8_ops[] = {
488 #define DEF_RVV_X8_VLMUL_EXT_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
489 #include "riscv-vector-builtins-types.def"
490 {NUM_VECTOR_TYPES, 0}};
491
492 /* A list of x16 vlmul ext will be registered for intrinsic functions. */
493 static const rvv_type_info vlmul_ext_x16_ops[] = {
494 #define DEF_RVV_X16_VLMUL_EXT_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
495 #include "riscv-vector-builtins-types.def"
496 {NUM_VECTOR_TYPES, 0}};
497
498 /* A list of x32 vlmul ext will be registered for intrinsic functions. */
499 static const rvv_type_info vlmul_ext_x32_ops[] = {
500 #define DEF_RVV_X32_VLMUL_EXT_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
501 #include "riscv-vector-builtins-types.def"
502 {NUM_VECTOR_TYPES, 0}};
503
504 /* A list of x64 vlmul ext will be registered for intrinsic functions. */
505 static const rvv_type_info vlmul_ext_x64_ops[] = {
506 #define DEF_RVV_X64_VLMUL_EXT_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
507 #include "riscv-vector-builtins-types.def"
508 {NUM_VECTOR_TYPES, 0}};
509
510 /* A list of LMUL1 will be registered for intrinsic functions. */
511 static const rvv_type_info lmul1_ops[] = {
512 #define DEF_RVV_LMUL1_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
513 #include "riscv-vector-builtins-types.def"
514 {NUM_VECTOR_TYPES, 0}};
515
516 /* A list of LMUL2 will be registered for intrinsic functions. */
517 static const rvv_type_info lmul2_ops[] = {
518 #define DEF_RVV_LMUL2_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
519 #include "riscv-vector-builtins-types.def"
520 {NUM_VECTOR_TYPES, 0}};
521
522 /* A list of LMUL4 will be registered for intrinsic functions. */
523 static const rvv_type_info lmul4_ops[] = {
524 #define DEF_RVV_LMUL4_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
525 #include "riscv-vector-builtins-types.def"
526 {NUM_VECTOR_TYPES, 0}};
527
528 /* A list of Tuple types will be registered for intrinsic functions. */
529 static const rvv_type_info tuple_ops[] = {
530 #define DEF_RVV_TUPLE_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
531 #include "riscv-vector-builtins-types.def"
532 {NUM_VECTOR_TYPES, 0}};
533
534 /* Below types will be registered for vector-crypto intrinsic functions*/
535 /* A list of sew32 will be registered for vector-crypto intrinsic functions. */
536 static const rvv_type_info crypto_sew32_ops[] = {
537 #define DEF_RVV_CRYPTO_SEW32_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
538 #include "riscv-vector-builtins-types.def"
539 {NUM_VECTOR_TYPES, 0}};
540
541 /* A list of sew64 will be registered for vector-crypto intrinsic functions. */
542 static const rvv_type_info crypto_sew64_ops[] = {
543 #define DEF_RVV_CRYPTO_SEW64_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
544 #include "riscv-vector-builtins-types.def"
545 {NUM_VECTOR_TYPES, 0}};
546
547 /* A list of signed integer will be registered for intrinsic
548 * functions. */
549 static const rvv_type_info qmacc_ops[] = {
550 #define DEF_RVV_QMACC_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
551 #include "riscv-vector-builtins-types.def"
552 {NUM_VECTOR_TYPES, 0}};
553
554 /* A list of signed integer will be registered for intrinsic functions. */
555 static const rvv_type_info xfqf_ops[] = {
556 #define DEF_RVV_XFQF_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
557 #include "riscv-vector-builtins-types.def"
558 {NUM_VECTOR_TYPES, 0}};
559
560 static CONSTEXPR const rvv_arg_type_info rvv_arg_type_info_end
561 = rvv_arg_type_info (NUM_BASE_TYPES);
562
563 /* A list of args for size_t func () function. */
564 static CONSTEXPR const rvv_arg_type_info void_args[] = {rvv_arg_type_info_end};
565
566 /* A list of args for size_t func () function. */
567 static CONSTEXPR const rvv_arg_type_info end_args[]
568 = {rvv_arg_type_info_end};
569
570 /* A list of args for size_t func (size_t) function. */
571 static CONSTEXPR const rvv_arg_type_info size_args[]
572 = {rvv_arg_type_info (RVV_BASE_size), rvv_arg_type_info_end};
573
574 /* A list of args for vector_type func (const scalar_type *) function. */
575 static CONSTEXPR const rvv_arg_type_info scalar_const_ptr_args[]
576 = {rvv_arg_type_info (RVV_BASE_scalar_const_ptr), rvv_arg_type_info_end};
577
578 /* A list of args for vector_type func (const scalar_type *, size_t *) function.
579 */
580 static CONSTEXPR const rvv_arg_type_info scalar_const_ptr_size_ptr_args[]
581 = {rvv_arg_type_info (RVV_BASE_scalar_const_ptr),
582 rvv_arg_type_info (RVV_BASE_size_ptr), rvv_arg_type_info_end};
583
584 /* A list of args for void func (scalar_type *, vector_type) function. */
585 static CONSTEXPR const rvv_arg_type_info scalar_ptr_args[]
586 = {rvv_arg_type_info (RVV_BASE_scalar_ptr),
587 rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};
588
589 /* A list of args for vector_type func (const scalar_type *, ptrdiff_t)
590 * function. */
591 static CONSTEXPR const rvv_arg_type_info scalar_const_ptr_ptrdiff_args[]
592 = {rvv_arg_type_info (RVV_BASE_scalar_const_ptr),
593 rvv_arg_type_info (RVV_BASE_ptrdiff), rvv_arg_type_info_end};
594
595 /* A list of args for void func (scalar_type *, ptrdiff_t, vector_type)
596 * function. */
597 static CONSTEXPR const rvv_arg_type_info scalar_ptr_ptrdiff_args[]
598 = {rvv_arg_type_info (RVV_BASE_scalar_ptr),
599 rvv_arg_type_info (RVV_BASE_ptrdiff), rvv_arg_type_info (RVV_BASE_vector),
600 rvv_arg_type_info_end};
601
602 /* A list of args for vector_type func (const scalar_type *, eew8_index_type)
603 * function. */
604 static CONSTEXPR const rvv_arg_type_info scalar_const_ptr_eew8_index_args[]
605 = {rvv_arg_type_info (RVV_BASE_scalar_const_ptr),
606 rvv_arg_type_info (RVV_BASE_eew8_index), rvv_arg_type_info_end};
607
608 /* A list of args for vector_type func (const scalar_type *, eew16_index_type)
609 * function. */
610 static CONSTEXPR const rvv_arg_type_info scalar_const_ptr_eew16_index_args[]
611 = {rvv_arg_type_info (RVV_BASE_scalar_const_ptr),
612 rvv_arg_type_info (RVV_BASE_eew16_index), rvv_arg_type_info_end};
613
614 /* A list of args for vector_type func (const scalar_type *, eew32_index_type)
615 * function. */
616 static CONSTEXPR const rvv_arg_type_info scalar_const_ptr_eew32_index_args[]
617 = {rvv_arg_type_info (RVV_BASE_scalar_const_ptr),
618 rvv_arg_type_info (RVV_BASE_eew32_index), rvv_arg_type_info_end};
619
620 /* A list of args for vector_type func (const scalar_type *, eew64_index_type)
621 * function. */
622 static CONSTEXPR const rvv_arg_type_info scalar_const_ptr_eew64_index_args[]
623 = {rvv_arg_type_info (RVV_BASE_scalar_const_ptr),
624 rvv_arg_type_info (RVV_BASE_eew64_index), rvv_arg_type_info_end};
625
626 /* A list of args for void func (scalar_type *, eew8_index_type, vector_type)
627 * function. */
628 static CONSTEXPR const rvv_arg_type_info scalar_ptr_eew8_index_args[]
629 = {rvv_arg_type_info (RVV_BASE_scalar_ptr),
630 rvv_arg_type_info (RVV_BASE_eew8_index),
631 rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};
632
633 /* A list of args for void func (scalar_type *, eew16_index_type, vector_type)
634 * function. */
635 static CONSTEXPR const rvv_arg_type_info scalar_ptr_eew16_index_args[]
636 = {rvv_arg_type_info (RVV_BASE_scalar_ptr),
637 rvv_arg_type_info (RVV_BASE_eew16_index),
638 rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};
639
640 /* A list of args for void func (scalar_type *, eew32_index_type, vector_type)
641 * function. */
642 static CONSTEXPR const rvv_arg_type_info scalar_ptr_eew32_index_args[]
643 = {rvv_arg_type_info (RVV_BASE_scalar_ptr),
644 rvv_arg_type_info (RVV_BASE_eew32_index),
645 rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};
646
647 /* A list of args for void func (scalar_type *, eew64_index_type, vector_type)
648 * function. */
649 static CONSTEXPR const rvv_arg_type_info scalar_ptr_eew64_index_args[]
650 = {rvv_arg_type_info (RVV_BASE_scalar_ptr),
651 rvv_arg_type_info (RVV_BASE_eew64_index),
652 rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};
653
654 /* A list of args for vector_type func (vector_type, vector_type) function. */
655 static CONSTEXPR const rvv_arg_type_info vv_args[]
656 = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info (RVV_BASE_vector),
657 rvv_arg_type_info_end};
658
659 /* A list of args for vector_type func (vector_type, vector_type, vector_type)
660 * function. */
661 static CONSTEXPR const rvv_arg_type_info vvv_args[]
662 = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info (RVV_BASE_vector),
663 rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};
664
665 /* A list of args for vector_type func (vector_type, vector_type, vector_type)
666 * function. */
667 static CONSTEXPR const rvv_arg_type_info vxv_args[]
668 = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info (RVV_BASE_scalar),
669 rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};
670
671 /* A list of args for vector_type func (vector_type, vector_type, mask_type)
672 * function. */
673 static CONSTEXPR const rvv_arg_type_info vvm_args[]
674 = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info (RVV_BASE_vector),
675 rvv_arg_type_info (RVV_BASE_mask), rvv_arg_type_info_end};
676
677 /* A list of args for vector_type func (vector_type, mask_type)
678 * function. */
679 static CONSTEXPR const rvv_arg_type_info vm_args[]
680 = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info (RVV_BASE_mask),
681 rvv_arg_type_info_end};
682
683 /* A list of args for vector_type func (vector_type, scalar_type, mask_type)
684 * function. */
685 static CONSTEXPR const rvv_arg_type_info vxm_args[]
686 = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info (RVV_BASE_scalar),
687 rvv_arg_type_info (RVV_BASE_mask), rvv_arg_type_info_end};
688
689 /* A list of args for vector_type func (signed vector_type, unsigned
690 * vector_type) function. */
691 static CONSTEXPR const rvv_arg_type_info su_vv_args[]
692 = {rvv_arg_type_info (RVV_BASE_vector),
693 rvv_arg_type_info (RVV_BASE_unsigned_vector), rvv_arg_type_info_end};
694
695 /* A list of args for vector_type func (vector_type, scalar_type) function. */
696 static CONSTEXPR const rvv_arg_type_info vx_args[]
697 = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info (RVV_BASE_scalar),
698 rvv_arg_type_info_end};
699
700 /* A list of args for vector_type func (signed vector_type, unsigned
701 * scalar_type) function. */
702 static CONSTEXPR const rvv_arg_type_info su_vx_args[]
703 = {rvv_arg_type_info (RVV_BASE_vector),
704 rvv_arg_type_info (RVV_BASE_unsigned_scalar), rvv_arg_type_info_end};
705
706 /* A list of args for vector_type func (vector_type, shift_type) function. */
707 static CONSTEXPR const rvv_arg_type_info shift_vv_args[]
708 = {rvv_arg_type_info (RVV_BASE_vector),
709 rvv_arg_type_info (RVV_BASE_shift_vector), rvv_arg_type_info_end};
710
711 /* A list of args for vector_type func (vector_type, shift_type) function. */
712 static CONSTEXPR const rvv_arg_type_info gather_vv_args[]
713 = {rvv_arg_type_info (RVV_BASE_vector),
714 rvv_arg_type_info (RVV_BASE_unsigned_vector), rvv_arg_type_info_end};
715
716 /* A list of args for vector_type func (vector_type, shift_type) function. */
717 static CONSTEXPR const rvv_arg_type_info gatherei16_vv_args[]
718 = {rvv_arg_type_info (RVV_BASE_vector),
719 rvv_arg_type_info (RVV_BASE_eew16_index), rvv_arg_type_info_end};
720
721 /* A list of args for double demote type func (vector_type, shift_type)
722 * function. */
723 static CONSTEXPR const rvv_arg_type_info shift_wv_args[]
724 = {rvv_arg_type_info (RVV_BASE_vector),
725 rvv_arg_type_info (RVV_BASE_double_trunc_unsigned_vector),
726 rvv_arg_type_info_end};
727
728 static CONSTEXPR const rvv_arg_type_info clip_args[]
729 = {rvv_arg_type_info (RVV_BASE_xfqf_vector),
730 rvv_arg_type_info (RVV_BASE_xfqf_float),
731 rvv_arg_type_info_end};
732
733 /* A list of args for vector_type func (vector_type) function. */
734 static CONSTEXPR const rvv_arg_type_info v_args[]
735 = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};
736
737 /* A list of args for vector_type func (vector_type) function. */
738 static CONSTEXPR const rvv_arg_type_info v_x2_trunc_args[]
739 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), rvv_arg_type_info_end};
740
741 /* A list of args for vector_type func (vector_type) function. */
742 static CONSTEXPR const rvv_arg_type_info v_x4_trunc_args[]
743 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x4), rvv_arg_type_info_end};
744
745 /* A list of args for vector_type func (vector_type) function. */
746 static CONSTEXPR const rvv_arg_type_info v_x8_trunc_args[]
747 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x8), rvv_arg_type_info_end};
748
749 /* A list of args for vector_type func (vector_type) function. */
750 static CONSTEXPR const rvv_arg_type_info v_x16_trunc_args[]
751 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x16), rvv_arg_type_info_end};
752
753 /* A list of args for vector_type func (vector_type) function. */
754 static CONSTEXPR const rvv_arg_type_info v_x32_trunc_args[]
755 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x32), rvv_arg_type_info_end};
756
757 /* A list of args for vector_type func (vector_type) function. */
758 static CONSTEXPR const rvv_arg_type_info v_x64_trunc_args[]
759 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x64), rvv_arg_type_info_end};
760
761 /* A list of args for vector_type func (vector_type, lmul1_type) function. */
762 static CONSTEXPR const rvv_arg_type_info vs_args[]
763 = {rvv_arg_type_info (RVV_BASE_vector),
764 rvv_arg_type_info (RVV_BASE_lmul1_vector), rvv_arg_type_info_end};
765
766 /* A list of args for vector_type func (vector_type, widen_lmul1_type) function.
767 */
768 static CONSTEXPR const rvv_arg_type_info wvs_args[]
769 = {rvv_arg_type_info (RVV_BASE_vector),
770 rvv_arg_type_info (RVV_BASE_widen_lmul1_vector), rvv_arg_type_info_end};
771
772 /* A list of args for vector_type func (vector_type) function. */
773 static CONSTEXPR const rvv_arg_type_info f_v_args[]
774 = {rvv_arg_type_info (RVV_BASE_float_vector), rvv_arg_type_info_end};
775
776 /* A list of args for vector_type func (vector_type) function. */
777 static CONSTEXPR const rvv_arg_type_info trunc_f_v_args[]
778 = {rvv_arg_type_info (RVV_BASE_double_trunc_float_vector),
779 rvv_arg_type_info_end};
780
781 /* A list of args for vector_type func (vector_type) function. */
782 static CONSTEXPR const rvv_arg_type_info w_v_args[]
783 = {rvv_arg_type_info (RVV_BASE_double_trunc_vector), rvv_arg_type_info_end};
784
785 /* A list of args for vector_type func (vector_type) function. */
786 static CONSTEXPR const rvv_arg_type_info bf_w_v_args[]
787 = {rvv_arg_type_info (RVV_BASE_double_trunc_bfloat_vector),
788 rvv_arg_type_info_end};
789
790 /* A list of args for vector_type func (vector_type) function. */
791 static CONSTEXPR const rvv_arg_type_info bf_wwvv_args[]
792 = {rvv_arg_type_info (RVV_BASE_vector),
793 rvv_arg_type_info (RVV_BASE_double_trunc_bfloat_vector),
794 rvv_arg_type_info (RVV_BASE_double_trunc_bfloat_vector),
795 rvv_arg_type_info_end};
796
797 /* A list of args for vector_type func (vector_type) function. */
798 static CONSTEXPR const rvv_arg_type_info bf_wwxv_args[]
799 = {rvv_arg_type_info (RVV_BASE_vector),
800 rvv_arg_type_info (RVV_BASE_double_trunc_bfloat_scalar),
801 rvv_arg_type_info (RVV_BASE_double_trunc_bfloat_vector),
802 rvv_arg_type_info_end};
803
804 /* A list of args for vector_type func (vector_type) function. */
805 static CONSTEXPR const rvv_arg_type_info m_args[]
806 = {rvv_arg_type_info (RVV_BASE_mask), rvv_arg_type_info_end};
807
808 /* A list of args for vector_type func (scalar_type) function. */
809 static CONSTEXPR const rvv_arg_type_info x_args[]
810 = {rvv_arg_type_info (RVV_BASE_scalar), rvv_arg_type_info_end};
811
812 /* A list of args for vector_type func (vector_type, size) function. */
813 static CONSTEXPR const rvv_arg_type_info v_size_args[]
814 = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info (RVV_BASE_size),
815 rvv_arg_type_info_end};
816
817 /* A list of args for vector_type func (double demote_type, size_t) function. */
818 static CONSTEXPR const rvv_arg_type_info wv_size_args[]
819 = {rvv_arg_type_info (RVV_BASE_double_trunc_vector),
820 rvv_arg_type_info (RVV_BASE_size),rvv_arg_type_info_end};
821
822 /* A list of args for vector_type func (vector_type, vector_type, size)
823 * function. */
824 static CONSTEXPR const rvv_arg_type_info vv_size_args[]
825 = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info (RVV_BASE_vector),
826 rvv_arg_type_info (RVV_BASE_size), rvv_arg_type_info_end};
827
828 /* A list of args for vector_type func (double demote type) function. */
829 static CONSTEXPR const rvv_arg_type_info vf2_args[]
830 = {rvv_arg_type_info (RVV_BASE_double_trunc_vector), rvv_arg_type_info_end};
831
832 /* A list of args for vector_type func (double demote type, double demote type)
833 * function. */
834 static CONSTEXPR const rvv_arg_type_info wvv_args[]
835 = {rvv_arg_type_info (RVV_BASE_double_trunc_vector),
836 rvv_arg_type_info (RVV_BASE_double_trunc_vector), rvv_arg_type_info_end};
837
838 /* A list of args for vector_type func (vector_type, double demote type, double
839 * demote type) function. */
840 static CONSTEXPR const rvv_arg_type_info wwvv_args[]
841 = {rvv_arg_type_info (RVV_BASE_vector),
842 rvv_arg_type_info (RVV_BASE_double_trunc_vector),
843 rvv_arg_type_info (RVV_BASE_double_trunc_vector), rvv_arg_type_info_end};
844
845 /* A list of args for vector_type func (vector_type, double demote type, double
846 * demote type) function. */
847 static CONSTEXPR const rvv_arg_type_info wwxv_args[]
848 = {rvv_arg_type_info (RVV_BASE_vector),
849 rvv_arg_type_info (RVV_BASE_double_trunc_scalar),
850 rvv_arg_type_info (RVV_BASE_double_trunc_vector), rvv_arg_type_info_end};
851
852 /* A list of args for vector_type func (vector_type, double demote type, double
853 * demote type) function. */
854 static CONSTEXPR const rvv_arg_type_info su_wwvv_args[]
855 = {rvv_arg_type_info (RVV_BASE_vector),
856 rvv_arg_type_info (RVV_BASE_double_trunc_vector),
857 rvv_arg_type_info (RVV_BASE_double_trunc_unsigned_vector),
858 rvv_arg_type_info_end};
859
860 /* A list of args for vector_type func (vector_type, double demote type, double
861 * demote type) function. */
862 static CONSTEXPR const rvv_arg_type_info su_wwxv_args[]
863 = {rvv_arg_type_info (RVV_BASE_vector),
864 rvv_arg_type_info (RVV_BASE_double_trunc_scalar),
865 rvv_arg_type_info (RVV_BASE_double_trunc_unsigned_vector),
866 rvv_arg_type_info_end};
867
868 /* A list of args for vector_type func (vector_type, double demote type, double
869 * demote type) function. */
870 static CONSTEXPR const rvv_arg_type_info us_wwxv_args[]
871 = {rvv_arg_type_info (RVV_BASE_vector),
872 rvv_arg_type_info (RVV_BASE_double_trunc_unsigned_scalar),
873 rvv_arg_type_info (RVV_BASE_double_trunc_vector),
874 rvv_arg_type_info_end};
875
876 /* A static operand information for vector_type func (vector_type, quad lmul1
877 * type, quad half lmul type) function registration. */
878 static CONSTEXPR const rvv_arg_type_info qqvv_args[]
879 = {rvv_arg_type_info (RVV_BASE_vector),
880 rvv_arg_type_info (RVV_BASE_quad_lmul1_vector),
881 rvv_arg_type_info (RVV_BASE_quad_emul_vector), rvv_arg_type_info_end};
882
883 static CONSTEXPR const rvv_arg_type_info uqqvv_args[]
884 = {rvv_arg_type_info (RVV_BASE_vector),
885 rvv_arg_type_info (RVV_BASE_quad_lmul1_unsigned_vector),
886 rvv_arg_type_info (RVV_BASE_quad_emul_unsigned_vector),
887 rvv_arg_type_info_end};
888
889 static CONSTEXPR const rvv_arg_type_info su_qqvv_args[]
890 = {rvv_arg_type_info (RVV_BASE_vector),
891 rvv_arg_type_info (RVV_BASE_quad_lmul1_vector),
892 rvv_arg_type_info (RVV_BASE_quad_emul_unsigned_vector),
893 rvv_arg_type_info_end};
894
895 static CONSTEXPR const rvv_arg_type_info us_qqvv_args[]
896 = {rvv_arg_type_info (RVV_BASE_vector),
897 rvv_arg_type_info (RVV_BASE_quad_lmul1_unsigned_vector),
898 rvv_arg_type_info (RVV_BASE_quad_emul_vector), rvv_arg_type_info_end};
899
900 /* A static operand information for vector_type func (vector_type, quad lmul1
901 * type, quad emul type) function registration. */
902 static CONSTEXPR const rvv_arg_type_info qdvv_args[]
903 = {rvv_arg_type_info (RVV_BASE_vector),
904 rvv_arg_type_info (RVV_BASE_quad_lmul1_vector),
905 rvv_arg_type_info (RVV_BASE_quad_fixed_vector), rvv_arg_type_info_end};
906
907 static CONSTEXPR const rvv_arg_type_info uqdvv_args[]
908 = {rvv_arg_type_info (RVV_BASE_vector),
909 rvv_arg_type_info (RVV_BASE_quad_lmul1_unsigned_vector),
910 rvv_arg_type_info (RVV_BASE_quad_fixed_unsigned_vector),
911 rvv_arg_type_info_end};
912
913 static CONSTEXPR const rvv_arg_type_info su_qdvv_args[]
914 = {rvv_arg_type_info (RVV_BASE_vector),
915 rvv_arg_type_info (RVV_BASE_quad_lmul1_vector),
916 rvv_arg_type_info (RVV_BASE_quad_fixed_unsigned_vector),
917 rvv_arg_type_info_end};
918
919 static CONSTEXPR const rvv_arg_type_info us_qdvv_args[]
920 = {rvv_arg_type_info (RVV_BASE_vector),
921 rvv_arg_type_info (RVV_BASE_quad_lmul1_unsigned_vector),
922 rvv_arg_type_info (RVV_BASE_quad_fixed_vector), rvv_arg_type_info_end};
923
924 /* A list of args for vector_type func (signed double demote type,
925 * unsigneddouble demote type) function. */
926 static CONSTEXPR const rvv_arg_type_info su_wvv_args[]
927 = {rvv_arg_type_info (RVV_BASE_double_trunc_vector),
928 rvv_arg_type_info (RVV_BASE_double_trunc_unsigned_vector), rvv_arg_type_info_end};
929
930 /* A list of args for vector_type func (double demote type, double demote type)
931 * function. */
932 static CONSTEXPR const rvv_arg_type_info wvx_args[]
933 = {rvv_arg_type_info (RVV_BASE_double_trunc_vector),
934 rvv_arg_type_info (RVV_BASE_double_trunc_scalar), rvv_arg_type_info_end};
935
936 /* A list of args for vector_type func (signed double demote type, unsigned
937 * double demote type) function. */
938 static CONSTEXPR const rvv_arg_type_info su_wvx_args[]
939 = {rvv_arg_type_info (RVV_BASE_double_trunc_vector),
940 rvv_arg_type_info (RVV_BASE_double_trunc_unsigned_scalar),
941 rvv_arg_type_info_end};
942
943 /* A list of args for vector_type func (double demote type, double demote type)
944 * function. */
945 static CONSTEXPR const rvv_arg_type_info wwv_args[]
946 = {rvv_arg_type_info (RVV_BASE_vector),
947 rvv_arg_type_info (RVV_BASE_double_trunc_vector), rvv_arg_type_info_end};
948
949 /* A list of args for vector_type func (double demote type, double demote type)
950 * function. */
951 static CONSTEXPR const rvv_arg_type_info wwx_args[]
952 = {rvv_arg_type_info (RVV_BASE_vector),
953 rvv_arg_type_info (RVV_BASE_double_trunc_scalar), rvv_arg_type_info_end};
954
955 /* A list of args for vector_type func (quad demote type) function. */
956 static CONSTEXPR const rvv_arg_type_info vf4_args[]
957 = {rvv_arg_type_info (RVV_BASE_quad_trunc_vector), rvv_arg_type_info_end};
958
959 /* A list of args for vector_type func (oct demote type) function. */
960 static CONSTEXPR const rvv_arg_type_info vf8_args[]
961 = {rvv_arg_type_info (RVV_BASE_oct_trunc_vector), rvv_arg_type_info_end};
962
963 /* A list of args for vector_type func (double demote type) function. */
964 static CONSTEXPR const rvv_arg_type_info x_x_v_args[]
965 = {rvv_arg_type_info (RVV_BASE_double_trunc_vector), rvv_arg_type_info_end};
966
967 /* A list of args for vector_type func (vector_type) function. */
968 static CONSTEXPR const rvv_arg_type_info x_v_args[]
969 = {rvv_arg_type_info (RVV_BASE_signed_vector), rvv_arg_type_info_end};
970
971 /* A list of args for vector_type func (vector_type) function. */
972 static CONSTEXPR const rvv_arg_type_info xu_v_args[]
973 = {rvv_arg_type_info (RVV_BASE_unsigned_vector), rvv_arg_type_info_end};
974
975 /* A list of args for vector_type func (vector_type) function. */
976 static CONSTEXPR const rvv_arg_type_info w_x_v_args[]
977 = {rvv_arg_type_info (RVV_BASE_double_trunc_signed_vector),
978 rvv_arg_type_info_end};
979
980 /* A list of args for vector_type func (vector_type) function. */
981 static CONSTEXPR const rvv_arg_type_info w_xu_v_args[]
982 = {rvv_arg_type_info (RVV_BASE_double_trunc_unsigned_vector),
983 rvv_arg_type_info_end};
984
985 /* A list of args for vector_type func (vector_type) function. */
986 static CONSTEXPR const rvv_arg_type_info ext_x2_vset_args[]
987 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x2),
988 rvv_arg_type_info (RVV_BASE_size), rvv_arg_type_info (RVV_BASE_vector),
989 rvv_arg_type_info_end};
990
991 /* A list of args for vector_type func (vector_type) function. */
992 static CONSTEXPR const rvv_arg_type_info ext_x4_vset_args[]
993 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x4),
994 rvv_arg_type_info (RVV_BASE_size), rvv_arg_type_info (RVV_BASE_vector),
995 rvv_arg_type_info_end};
996
997 /* A list of args for vector_type func (vector_type) function. */
998 static CONSTEXPR const rvv_arg_type_info ext_x8_vset_args[]
999 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x8),
1000 rvv_arg_type_info (RVV_BASE_size), rvv_arg_type_info (RVV_BASE_vector),
1001 rvv_arg_type_info_end};
1002
1003 /* A list of args for vector_type func (vector_type) function. */
1004 static CONSTEXPR const rvv_arg_type_info ext_x2_vget_args[]
1005 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x2),
1006 rvv_arg_type_info (RVV_BASE_size), rvv_arg_type_info_end};
1007
1008 /* A list of args for vector_type func (vector_type) function. */
1009 static CONSTEXPR const rvv_arg_type_info ext_x4_vget_args[]
1010 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x4),
1011 rvv_arg_type_info (RVV_BASE_size), rvv_arg_type_info_end};
1012
1013 /* A list of args for vector_type func (vector_type) function. */
1014 static CONSTEXPR const rvv_arg_type_info ext_x8_vget_args[]
1015 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x8),
1016 rvv_arg_type_info (RVV_BASE_size), rvv_arg_type_info_end};
1017
1018 /* A list of args for vector_type func (vector_type) function. */
1019 static CONSTEXPR const rvv_arg_type_info tuple_vset_args[]
1020 = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info (RVV_BASE_size),
1021 rvv_arg_type_info (RVV_BASE_tuple_subpart), rvv_arg_type_info_end};
1022
1023 /* A list of args for vector_type func (vector_type) function. */
1024 static CONSTEXPR const rvv_arg_type_info tuple_vcreate_args[]
1025 = {rvv_arg_type_info (RVV_BASE_tuple_subpart), rvv_arg_type_info_end};
1026
1027 /* A list of args for vector_type func (vector_type) function. */
1028 static CONSTEXPR const rvv_arg_type_info ext_vcreate_args[]
1029 = {rvv_arg_type_info (RVV_BASE_vector),
1030 rvv_arg_type_info_end};
1031
1032 /* A list of args for vector_type func (const scalar_type *, size_t)
1033 * function. */
1034 static CONSTEXPR const rvv_arg_type_info scalar_const_ptr_size_args[]
1035 = {rvv_arg_type_info (RVV_BASE_scalar_const_ptr),
1036 rvv_arg_type_info (RVV_BASE_size), rvv_arg_type_info_end};
1037
1038 /* A list of args for vector_type func (const scalar_type *, eew8_index_type)
1039 * function. */
1040 static CONSTEXPR const rvv_arg_type_info scalar_const_ptr_index_args[]
1041 = {rvv_arg_type_info (RVV_BASE_scalar_const_ptr),
1042 rvv_arg_type_info (RVV_BASE_unsigned_vector), rvv_arg_type_info_end};
1043
1044 /* A list of args for void func (scalar_type *, eew8_index_type, vector_type)
1045 * function. */
1046 static CONSTEXPR const rvv_arg_type_info scalar_ptr_index_args[]
1047 = {rvv_arg_type_info (RVV_BASE_scalar_ptr),
1048 rvv_arg_type_info (RVV_BASE_unsigned_vector),
1049 rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};
1050
1051 /* A list of args for void func (scalar_type *, size_t, vector_type)
1052 * function. */
1053 static CONSTEXPR const rvv_arg_type_info scalar_ptr_size_args[]
1054 = {rvv_arg_type_info (RVV_BASE_scalar_ptr),
1055 rvv_arg_type_info (RVV_BASE_size), rvv_arg_type_info (RVV_BASE_vector),
1056 rvv_arg_type_info_end};
1057
1058 /* A list of none preds that will be registered for intrinsic functions. */
1059 static CONSTEXPR const predication_type_index none_preds[]
1060 = {PRED_TYPE_none, NUM_PRED_TYPES};
1061
1062 /* vop/vop_m/vop_tu/vop_tum/vop_tumu/vop_mu will be registered. */
1063 static CONSTEXPR const predication_type_index full_preds[]
1064 = {PRED_TYPE_none, PRED_TYPE_m, PRED_TYPE_tu, PRED_TYPE_tum,
1065 PRED_TYPE_tumu, PRED_TYPE_mu, NUM_PRED_TYPES};
1066
1067 /* vop/vop_m/vop_tu/vop_tum/ will be registered. */
1068 static CONSTEXPR const predication_type_index no_mu_preds[]
1069 = {PRED_TYPE_none, PRED_TYPE_m, PRED_TYPE_tu, PRED_TYPE_tum, NUM_PRED_TYPES};
1070
1071 /* vop/vop_tu will be registered. */
1072 static CONSTEXPR const predication_type_index none_tu_preds[]
1073 = {PRED_TYPE_none, PRED_TYPE_tu, NUM_PRED_TYPES};
1074
1075 /* vop/vop_m will be registered. */
1076 static CONSTEXPR const predication_type_index none_m_preds[]
1077 = {PRED_TYPE_none, PRED_TYPE_m, NUM_PRED_TYPES};
1078
1079 /* vop/vop_m/vop_mu will be registered. */
1080 static CONSTEXPR const predication_type_index none_m_mu_preds[]
1081 = {PRED_TYPE_none, PRED_TYPE_m, PRED_TYPE_mu, NUM_PRED_TYPES};
1082
1083 /* A static operand information for size_t func () function registration. */
1084 static CONSTEXPR const rvv_op_info i_none_size_void_ops
1085 = {i_ops, /* Types */
1086 OP_TYPE_none, /* Suffix */
1087 rvv_arg_type_info (RVV_BASE_size), /* Return type */
1088 void_args /* Args */};
1089
1090 /* A static operand information for size_t func (size_t) function registration.
1091 */
1092 static CONSTEXPR const rvv_op_info i_none_size_size_ops
1093 = {i_ops, /* Types */
1094 OP_TYPE_none, /* Suffix */
1095 rvv_arg_type_info (RVV_BASE_size), /* Return type */
1096 size_args /* Args */};
1097
1098 /* A static operand information for vector_type func () function registration.
1099 */
1100 static CONSTEXPR const rvv_op_info all_none_void_ops
1101 = {all_ops, /* Types */
1102 OP_TYPE_none, /* Suffix */
1103 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1104 void_args /* Args */};
1105
1106 /* A static operand information for vector_type func (const scalar_type *)
1107 * function registration. */
1108 static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_ops
1109 = {all_ops, /* Types */
1110 OP_TYPE_v, /* Suffix */
1111 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1112 scalar_const_ptr_args /* Args */};
1113
1114 /* A static operand information for vector_type func (const scalar_type *)
1115 * function registration. */
1116 static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_size_ptr_ops
1117 = {all_ops, /* Types */
1118 OP_TYPE_v, /* Suffix */
1119 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1120 scalar_const_ptr_size_ptr_args /* Args */};
1121
1122 /* A static operand information for void func (scalar_type *, vector_type)
1123 * function registration. */
1124 static CONSTEXPR const rvv_op_info all_v_scalar_ptr_ops
1125 = {all_ops, /* Types */
1126 OP_TYPE_v, /* Suffix */
1127 rvv_arg_type_info (RVV_BASE_void), /* Return type */
1128 scalar_ptr_args /* Args */};
1129
1130 /* A static operand information for vector_type func (const scalar_type *)
1131 * function registration. */
1132 static CONSTEXPR const rvv_op_info b_v_scalar_const_ptr_ops
1133 = {b_ops, /* Types */
1134 OP_TYPE_v, /* Suffix */
1135 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1136 scalar_const_ptr_args /* Args */};
1137
1138 /* A static operand information for void func (scalar_type *, vector_type)
1139 * function registration. */
1140 static CONSTEXPR const rvv_op_info b_v_scalar_ptr_ops
1141 = {b_ops, /* Types */
1142 OP_TYPE_v, /* Suffix */
1143 rvv_arg_type_info (RVV_BASE_void), /* Return type */
1144 scalar_ptr_args /* Args */};
1145
1146 /* A static operand information for vector_type func (vector_type, vector_type)
1147 * function registration. */
1148 static CONSTEXPR const rvv_op_info b_mmm_ops
1149 = {b_ops, /* Types */
1150 OP_TYPE_mm, /* Suffix */
1151 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1152 vv_args /* Args */};
1153
1154 /* A static operand information for vector_type func (vector_type)
1155 * function registration. */
1156 static CONSTEXPR const rvv_op_info b_mm_ops
1157 = {b_ops, /* Types */
1158 OP_TYPE_m, /* Suffix */
1159 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1160 v_args /* Args */};
1161
1162 /* A static operand information for vector_type func (vector_type)
1163 * function registration. */
1164 static CONSTEXPR const rvv_op_info u_vm_ops
1165 = {u_ops, /* Types */
1166 OP_TYPE_m, /* Suffix */
1167 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1168 m_args /* Args */};
1169
1170 /* A static operand information for vector_type func ()
1171 * function registration. */
1172 static CONSTEXPR const rvv_op_info b_m_ops
1173 = {b_ops, /* Types */
1174 OP_TYPE_m, /* Suffix */
1175 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1176 end_args /* Args */};
1177
1178 /* A static operand information for vector_type func ()
1179 * function registration. */
1180 static CONSTEXPR const rvv_op_info u_v_ops
1181 = {u_ops, /* Types */
1182 OP_TYPE_v, /* Suffix */
1183 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1184 end_args /* Args */};
1185
1186 /* A static operand information for vector_type func (vector_type)
1187 * function registration. */
1188 static CONSTEXPR const rvv_op_info u_vv_ops
1189 = {u_ops, /* Types */
1190 OP_TYPE_v, /* Suffix */
1191 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1192 v_args /* Args */};
1193
1194 /* A static operand information for unsigned long func (vector_type)
1195 * function registration. */
1196 static CONSTEXPR const rvv_op_info b_ulong_m_ops
1197 = {b_ops, /* Types */
1198 OP_TYPE_m, /* Suffix */
1199 rvv_arg_type_info (RVV_BASE_unsigned_long), /* Return type */
1200 v_args /* Args */};
1201
1202 /* A static operand information for long func (vector_type)
1203 * function registration. */
1204 static CONSTEXPR const rvv_op_info b_long_m_ops
1205 = {b_ops, /* Types */
1206 OP_TYPE_m, /* Suffix */
1207 rvv_arg_type_info (RVV_BASE_long), /* Return type */
1208 v_args /* Args */};
1209
1210 /* A static operand information for vector_type func (const scalar_type *,
1211 * ptrdiff_t) function registration. */
1212 static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_ptrdiff_ops
1213 = {all_ops, /* Types */
1214 OP_TYPE_v, /* Suffix */
1215 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1216 scalar_const_ptr_ptrdiff_args /* Args */};
1217
1218 /* A static operand information for vector_type func (const scalar_type *,
1219 * eew8_index_type) function registration. */
1220 static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_eew8_index_ops
1221 = {all_ops, /* Types */
1222 OP_TYPE_v, /* Suffix */
1223 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1224 scalar_const_ptr_eew8_index_args /* Args */};
1225
1226 /* A static operand information for vector_type func (const scalar_type *,
1227 * eew16_index_type) function registration. */
1228 static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_eew16_index_ops
1229 = {all_ops, /* Types */
1230 OP_TYPE_v, /* Suffix */
1231 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1232 scalar_const_ptr_eew16_index_args /* Args */};
1233
1234 /* A static operand information for vector_type func (const scalar_type *,
1235 * eew32_index_type) function registration. */
1236 static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_eew32_index_ops
1237 = {all_ops, /* Types */
1238 OP_TYPE_v, /* Suffix */
1239 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1240 scalar_const_ptr_eew32_index_args /* Args */};
1241
1242 /* A static operand information for vector_type func (const scalar_type *,
1243 * eew64_index_type) function registration. */
1244 static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_eew64_index_ops
1245 = {all_ops, /* Types */
1246 OP_TYPE_v, /* Suffix */
1247 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1248 scalar_const_ptr_eew64_index_args /* Args */};
1249
1250 /* A static operand information for void func (scalar_type *, ptrdiff_t,
1251 * vector_type) function registration. */
1252 static CONSTEXPR const rvv_op_info all_v_scalar_ptr_ptrdiff_ops
1253 = {all_ops, /* Types */
1254 OP_TYPE_v, /* Suffix */
1255 rvv_arg_type_info (RVV_BASE_void), /* Return type */
1256 scalar_ptr_ptrdiff_args /* Args */};
1257
1258 /* A static operand information for void func (scalar_type *, eew8_index_type,
1259 * vector_type) function registration. */
1260 static CONSTEXPR const rvv_op_info all_v_scalar_ptr_eew8_index_ops
1261 = {all_ops, /* Types */
1262 OP_TYPE_v, /* Suffix */
1263 rvv_arg_type_info (RVV_BASE_void), /* Return type */
1264 scalar_ptr_eew8_index_args /* Args */};
1265
1266 /* A static operand information for void func (scalar_type *, eew16_index_type,
1267 * vector_type) function registration. */
1268 static CONSTEXPR const rvv_op_info all_v_scalar_ptr_eew16_index_ops
1269 = {all_ops, /* Types */
1270 OP_TYPE_v, /* Suffix */
1271 rvv_arg_type_info (RVV_BASE_void), /* Return type */
1272 scalar_ptr_eew16_index_args /* Args */};
1273
1274 /* A static operand information for void func (scalar_type *, eew32_index_type,
1275 * vector_type) function registration. */
1276 static CONSTEXPR const rvv_op_info all_v_scalar_ptr_eew32_index_ops
1277 = {all_ops, /* Types */
1278 OP_TYPE_v, /* Suffix */
1279 rvv_arg_type_info (RVV_BASE_void), /* Return type */
1280 scalar_ptr_eew32_index_args /* Args */};
1281
1282 /* A static operand information for void func (scalar_type *, eew64_index_type,
1283 * vector_type) function registration. */
1284 static CONSTEXPR const rvv_op_info all_v_scalar_ptr_eew64_index_ops
1285 = {all_ops, /* Types */
1286 OP_TYPE_v, /* Suffix */
1287 rvv_arg_type_info (RVV_BASE_void), /* Return type */
1288 scalar_ptr_eew64_index_args /* Args */};
1289
1290 /* A static operand information for vector_type func (vector_type, vector_type)
1291 * function registration. */
1292 static CONSTEXPR const rvv_op_info iu_vvv_ops
1293 = {iu_ops, /* Types */
1294 OP_TYPE_vv, /* Suffix */
1295 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1296 vv_args /* Args */};
1297
1298 /* A static operand information for vector_type func (vector_type, vector_type,
1299 * vector_type) function registration. */
1300 static CONSTEXPR const rvv_op_info iu_vvvv_ops
1301 = {iu_ops, /* Types */
1302 OP_TYPE_vv, /* Suffix */
1303 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1304 vvv_args /* Args */};
1305
1306 /* A static operand information for vector_type func (vector_type, scalar_type,
1307 * vector_type) function registration. */
1308 static CONSTEXPR const rvv_op_info iu_vvxv_ops
1309 = {iu_ops, /* Types */
1310 OP_TYPE_vx, /* Suffix */
1311 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1312 vxv_args /* Args */};
1313
1314 /* A static operand information for vector_type func (vector_type, vector_type,
1315 * vector_type) function registration. */
1316 static CONSTEXPR const rvv_op_info f_vvvv_ops
1317 = {f_ops, /* Types */
1318 OP_TYPE_vv, /* Suffix */
1319 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1320 vvv_args /* Args */};
1321
1322 /* A static operand information for vector_type func (vector_type, scalar_type,
1323 * vector_type) function registration. */
1324 static CONSTEXPR const rvv_op_info f_vvfv_ops
1325 = {f_ops, /* Types */
1326 OP_TYPE_vf, /* Suffix */
1327 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1328 vxv_args /* Args */};
1329
1330 /* A static operand information for vector_type func (vector_type, vector_type,
1331 * mask_type) function registration. */
1332 static CONSTEXPR const rvv_op_info iu_vvvm_ops
1333 = {iu_ops, /* Types */
1334 OP_TYPE_vvm, /* Suffix */
1335 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1336 vvm_args /* Args */};
1337
1338 /* A static operand information for vector_type func (vector_type, vector_type,
1339 * mask_type) function registration. */
1340 static CONSTEXPR const rvv_op_info all_vvvm_ops
1341 = {all_ops, /* Types */
1342 OP_TYPE_vvm, /* Suffix */
1343 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1344 vvm_args /* Args */};
1345
1346 /* A static operand information for vector_type func (vector_type, vector_type,
1347 * mask_type) function registration. */
1348 static CONSTEXPR const rvv_op_info all_vvm_ops
1349 = {all_ops, /* Types */
1350 OP_TYPE_vm, /* Suffix */
1351 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1352 vm_args /* Args */};
1353
1354 /* A static operand information for vector_type func (vector_type, scalar_type,
1355 * mask_type) function registration. */
1356 static CONSTEXPR const rvv_op_info iu_vvxm_ops
1357 = {iu_ops, /* Types */
1358 OP_TYPE_vxm, /* Suffix */
1359 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1360 vxm_args /* Args */};
1361
1362 /* A static operand information for vector_type func (vector_type, scalar_type,
1363 * mask_type) function registration. */
1364 static CONSTEXPR const rvv_op_info f_vvfm_ops
1365 = {f_ops, /* Types */
1366 OP_TYPE_vfm, /* Suffix */
1367 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1368 vxm_args /* Args */};
1369
1370 /* A static operand information for mask_type func (vector_type, vector_type,
1371 * mask_type) function registration. */
1372 static CONSTEXPR const rvv_op_info iu_mvvm_ops
1373 = {iu_ops, /* Types */
1374 OP_TYPE_vvm, /* Suffix */
1375 rvv_arg_type_info (RVV_BASE_mask), /* Return type */
1376 vvm_args /* Args */};
1377
1378 /* A static operand information for mask_type func (vector_type, scalar_type,
1379 * mask_type) function registration. */
1380 static CONSTEXPR const rvv_op_info iu_mvxm_ops
1381 = {iu_ops, /* Types */
1382 OP_TYPE_vxm, /* Suffix */
1383 rvv_arg_type_info (RVV_BASE_mask), /* Return type */
1384 vxm_args /* Args */};
1385
1386 /* A static operand information for mask_type func (vector_type, vector_type)
1387 * function registration. */
1388 static CONSTEXPR const rvv_op_info iu_mvv_ops
1389 = {iu_ops, /* Types */
1390 OP_TYPE_vv, /* Suffix */
1391 rvv_arg_type_info (RVV_BASE_mask), /* Return type */
1392 vv_args /* Args */};
1393
1394 /* A static operand information for mask_type func (vector_type, vector_type)
1395 * function registration. */
1396 static CONSTEXPR const rvv_op_info i_mvv_ops
1397 = {i_ops, /* Types */
1398 OP_TYPE_vv, /* Suffix */
1399 rvv_arg_type_info (RVV_BASE_mask), /* Return type */
1400 vv_args /* Args */};
1401
1402 /* A static operand information for mask_type func (vector_type, vector_type)
1403 * function registration. */
1404 static CONSTEXPR const rvv_op_info u_mvv_ops
1405 = {u_ops, /* Types */
1406 OP_TYPE_vv, /* Suffix */
1407 rvv_arg_type_info (RVV_BASE_mask), /* Return type */
1408 vv_args /* Args */};
1409
1410 /* A static operand information for mask_type func (vector_type, vector_type)
1411 * function registration. */
1412 static CONSTEXPR const rvv_op_info f_mvv_ops
1413 = {f_ops, /* Types */
1414 OP_TYPE_vv, /* Suffix */
1415 rvv_arg_type_info (RVV_BASE_mask), /* Return type */
1416 vv_args /* Args */};
1417
1418 /* A static operand information for mask_type func (vector_type, scalar_type)
1419 * function registration. */
1420 static CONSTEXPR const rvv_op_info iu_mvx_ops
1421 = {iu_ops, /* Types */
1422 OP_TYPE_vx, /* Suffix */
1423 rvv_arg_type_info (RVV_BASE_mask), /* Return type */
1424 vx_args /* Args */};
1425
1426 /* A static operand information for mask_type func (vector_type, scalar_type)
1427 * function registration. */
1428 static CONSTEXPR const rvv_op_info i_mvx_ops
1429 = {i_ops, /* Types */
1430 OP_TYPE_vx, /* Suffix */
1431 rvv_arg_type_info (RVV_BASE_mask), /* Return type */
1432 vx_args /* Args */};
1433
1434 /* A static operand information for mask_type func (vector_type, scalar_type)
1435 * function registration. */
1436 static CONSTEXPR const rvv_op_info u_mvx_ops
1437 = {u_ops, /* Types */
1438 OP_TYPE_vx, /* Suffix */
1439 rvv_arg_type_info (RVV_BASE_mask), /* Return type */
1440 vx_args /* Args */};
1441
1442 /* A static operand information for mask_type func (vector_type, scalar_type)
1443 * function registration. */
1444 static CONSTEXPR const rvv_op_info f_mvf_ops
1445 = {f_ops, /* Types */
1446 OP_TYPE_vf, /* Suffix */
1447 rvv_arg_type_info (RVV_BASE_mask), /* Return type */
1448 vx_args /* Args */};
1449
1450 /* A static operand information for vector_type func (vector_type, vector_type)
1451 * function registration. */
1452 static CONSTEXPR const rvv_op_info i_vvv_ops
1453 = {i_ops, /* Types */
1454 OP_TYPE_vv, /* Suffix */
1455 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1456 vv_args /* Args */};
1457
1458 /* A static operand information for vector_type func (vector_type, vector_type)
1459 * function registration. */
1460 static CONSTEXPR const rvv_op_info u_vvv_ops
1461 = {u_ops, /* Types */
1462 OP_TYPE_vv, /* Suffix */
1463 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1464 vv_args /* Args */};
1465
1466 /* A static operand information for vector_type func (vector_type, vector_type)
1467 * function registration. */
1468 static CONSTEXPR const rvv_op_info f_vvv_ops
1469 = {f_ops, /* Types */
1470 OP_TYPE_vv, /* Suffix */
1471 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1472 vv_args /* Args */};
1473
1474 /* A static operand information for vector_type func (vector_type, vector_type)
1475 * function registration. */
1476 static CONSTEXPR const rvv_op_info f_vvf_ops
1477 = {f_ops, /* Types */
1478 OP_TYPE_vf, /* Suffix */
1479 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1480 vx_args /* Args */};
1481
1482 /* A static operand information for vector_type func (vector_type, vector_type)
1483 * function registration. */
1484 static CONSTEXPR const rvv_op_info full_v_i_vvv_ops
1485 = {full_v_i_ops, /* Types */
1486 OP_TYPE_vv, /* Suffix */
1487 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1488 vv_args /* Args */};
1489
1490 /* A static operand information for vector_type func (vector_type, vector_type)
1491 * function registration. */
1492 static CONSTEXPR const rvv_op_info full_v_u_vvv_ops
1493 = {full_v_u_ops, /* Types */
1494 OP_TYPE_vv, /* Suffix */
1495 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1496 vv_args /* Args */};
1497
1498 /* A static operand information for vector_type func (signed vector_type,
1499 * unsigned vector_type) function registration. */
1500 static CONSTEXPR const rvv_op_info full_v_i_su_vvv_ops
1501 = {full_v_i_ops, /* Types */
1502 OP_TYPE_vv, /* Suffix */
1503 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1504 su_vv_args /* Args */};
1505
1506 /* A static operand information for vector_type func (vector_type, scalar_type)
1507 * function registration. */
1508 static CONSTEXPR const rvv_op_info iu_vvx_ops
1509 = {iu_ops, /* Types */
1510 OP_TYPE_vx, /* Suffix */
1511 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1512 vx_args /* Args */};
1513
1514 /* A static operand information for vector_type func (vector_type, scalar_type)
1515 * function registration. */
1516 static CONSTEXPR const rvv_op_info all_vvx_ops
1517 = {all_ops, /* Types */
1518 OP_TYPE_vx, /* Suffix */
1519 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1520 v_size_args /* Args */};
1521
1522 /* A static operand information for vector_type func (vector_type, vector_type,
1523 * scalar_type) function registration. */
1524 static CONSTEXPR const rvv_op_info all_vvvx_ops
1525 = {all_ops, /* Types */
1526 OP_TYPE_vx, /* Suffix */
1527 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1528 vv_size_args /* Args */};
1529
1530 /* A static operand information for vector_type func (vector_type, scalar_type)
1531 * function registration. */
1532 static CONSTEXPR const rvv_op_info i_vvx_ops
1533 = {i_ops, /* Types */
1534 OP_TYPE_vx, /* Suffix */
1535 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1536 vx_args /* Args */};
1537
1538 /* A static operand information for vector_type func (vector_type, scalar_type)
1539 * function registration. */
1540 static CONSTEXPR const rvv_op_info u_vvx_ops
1541 = {u_ops, /* Types */
1542 OP_TYPE_vx, /* Suffix */
1543 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1544 vx_args /* Args */};
1545
1546 /* A static operand information for vector_type func (vector_type, scalar_type)
1547 * function registration that require full 'V' extension. */
1548 static CONSTEXPR const rvv_op_info full_v_i_vvx_ops
1549 = {full_v_i_ops, /* Types */
1550 OP_TYPE_vx, /* Suffix */
1551 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1552 vx_args /* Args */};
1553
1554 /* A static operand information for vector_type func (vector_type, scalar_type)
1555 * function registration that require full 'V' extension. */
1556 static CONSTEXPR const rvv_op_info full_v_u_vvx_ops
1557 = {full_v_u_ops, /* Types */
1558 OP_TYPE_vx, /* Suffix */
1559 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1560 vx_args /* Args */};
1561
1562 /* A static operand information for vector_type func (signed vector_type,
1563 * unsigned scalar_type) function registration that require full 'V' extension.
1564 */
1565 static CONSTEXPR const rvv_op_info full_v_i_su_vvx_ops
1566 = {full_v_i_ops, /* Types */
1567 OP_TYPE_vx, /* Suffix */
1568 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1569 su_vx_args /* Args */};
1570
1571 /* A static operand information for vector_type func (vector_type, shift_type)
1572 * function registration. */
1573 static CONSTEXPR const rvv_op_info iu_shift_vvv_ops
1574 = {iu_ops, /* Types */
1575 OP_TYPE_vv, /* Suffix */
1576 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1577 shift_vv_args /* Args */};
1578
1579 /* A static operand information for scalar_type func (vector_type, size_t)
1580 * function registration. */
1581 static CONSTEXPR const rvv_op_info iu_x_s_u_ops
1582 = {iu_ops, /* Types */
1583 OP_TYPE_vx, /* Suffix */
1584 rvv_arg_type_info (RVV_BASE_scalar), /* Return type */
1585 v_size_args /* Args */};
1586
1587 /* A static operand information for vector_type func (vector_type, size_t)
1588 * function registration. */
1589 static CONSTEXPR const rvv_op_info iu_shift_vvx_ops
1590 = {iu_ops, /* Types */
1591 OP_TYPE_vx, /* Suffix */
1592 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1593 v_size_args /* Args */};
1594
1595 /* A static operand information for vector_type func (vector_type, shift_type)
1596 * function registration. */
1597 static CONSTEXPR const rvv_op_info i_shift_vvv_ops
1598 = {i_ops, /* Types */
1599 OP_TYPE_vv, /* Suffix */
1600 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1601 shift_vv_args /* Args */};
1602
1603 /* A static operand information for vector_type func (vector_type, size_t)
1604 * function registration. */
1605 static CONSTEXPR const rvv_op_info i_shift_vvx_ops
1606 = {i_ops, /* Types */
1607 OP_TYPE_vx, /* Suffix */
1608 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1609 v_size_args /* Args */};
1610
1611 /* A static operand information for vector_type func (vector_type, shift_type)
1612 * function registration. */
1613 static CONSTEXPR const rvv_op_info u_shift_vvv_ops
1614 = {u_ops, /* Types */
1615 OP_TYPE_vv, /* Suffix */
1616 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1617 shift_vv_args /* Args */};
1618
1619 /* A static operand information for vector_type func (vector_type, size_t)
1620 * function registration. */
1621 static CONSTEXPR const rvv_op_info u_shift_vvx_ops
1622 = {u_ops, /* Types */
1623 OP_TYPE_vx, /* Suffix */
1624 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1625 v_size_args /* Args */};
1626
1627 /* A static operand information for vector_type func (vector_type, index_type)
1628 * function registration. */
1629 static CONSTEXPR const rvv_op_info all_gather_vvv_ops
1630 = {all_ops, /* Types */
1631 OP_TYPE_vv, /* Suffix */
1632 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1633 gather_vv_args /* Args */};
1634
1635 /* A static operand information for vector_type func (vector_type, size_t)
1636 * function registration. */
1637 static CONSTEXPR const rvv_op_info all_gather_vvx_ops
1638 = {all_ops, /* Types */
1639 OP_TYPE_vx, /* Suffix */
1640 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1641 v_size_args /* Args */};
1642
1643 /* A static operand information for vector_type func (vector_type, index_type)
1644 * function registration. */
1645 static CONSTEXPR const rvv_op_info all_gatherei16_vvv_ops
1646 = {ei16_ops, /* Types */
1647 OP_TYPE_vv, /* Suffix */
1648 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1649 gatherei16_vv_args /* Args */};
1650
1651 /* A static operand information for vector_type func (vector_type)
1652 * function registration. */
1653 static CONSTEXPR const rvv_op_info iu_v_ops
1654 = {iu_ops, /* Types */
1655 OP_TYPE_v, /* Suffix */
1656 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1657 v_args /* Args */};
1658
1659 /* A static operand information for scalar_type func (vector_type)
1660 * function registration. */
1661 static CONSTEXPR const rvv_op_info iu_x_s_ops
1662 = {iu_ops, /* Types */
1663 OP_TYPE_s, /* Suffix */
1664 rvv_arg_type_info (RVV_BASE_scalar), /* Return type */
1665 v_args /* Args */};
1666
1667 /* A static operand information for scalar_type func (vector_type)
1668 * function registration. */
1669 static CONSTEXPR const rvv_op_info f_f_s_ops
1670 = {f_ops, /* Types */
1671 OP_TYPE_s, /* Suffix */
1672 rvv_arg_type_info (RVV_BASE_scalar), /* Return type */
1673 v_args /* Args */};
1674
1675 /* A static operand information for vector_type func (vector_type)
1676 * function registration. */
1677 static CONSTEXPR const rvv_op_info iu_vs_ops
1678 = {iu_ops, /* Types */
1679 OP_TYPE_vs, /* Suffix */
1680 rvv_arg_type_info (RVV_BASE_lmul1_vector), /* Return type */
1681 vs_args /* Args */};
1682
1683 /* A static operand information for vector_type func (vector_type)
1684 * function registration. */
1685 static CONSTEXPR const rvv_op_info f_vs_ops
1686 = {f_ops, /* Types */
1687 OP_TYPE_vs, /* Suffix */
1688 rvv_arg_type_info (RVV_BASE_lmul1_vector), /* Return type */
1689 vs_args /* Args */};
1690
1691 /* A static operand information for vector_type func (vector_type)
1692 * function registration. */
1693 static CONSTEXPR const rvv_op_info wi_vs_ops
1694 = {wi_ops, /* Types */
1695 OP_TYPE_vs, /* Suffix */
1696 rvv_arg_type_info (RVV_BASE_widen_lmul1_vector), /* Return type */
1697 wvs_args /* Args */};
1698
1699 /* A static operand information for vector_type func (vector_type)
1700 * function registration. */
1701 static CONSTEXPR const rvv_op_info wu_vs_ops
1702 = {wu_ops, /* Types */
1703 OP_TYPE_vs, /* Suffix */
1704 rvv_arg_type_info (RVV_BASE_widen_lmul1_vector), /* Return type */
1705 wvs_args /* Args */};
1706
1707 /* A static operand information for vector_type func (vector_type)
1708 * function registration. */
1709 static CONSTEXPR const rvv_op_info wf_vs_ops
1710 = {wf_ops, /* Types */
1711 OP_TYPE_vs, /* Suffix */
1712 rvv_arg_type_info (RVV_BASE_widen_lmul1_vector), /* Return type */
1713 wvs_args /* Args */};
1714
1715 /* A static operand information for vector_type func (vector_type)
1716 * function registration. */
1717 static CONSTEXPR const rvv_op_info f_v_ops
1718 = {f_ops, /* Types */
1719 OP_TYPE_v, /* Suffix */
1720 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1721 v_args /* Args */};
1722
1723 /* A static operand information for vector_type func (vector_type)
1724 * function registration. */
1725 static CONSTEXPR const rvv_op_info f_to_u_v_ops
1726 = {convert_u_ops, /* Types */
1727 OP_TYPE_v, /* Suffix */
1728 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1729 f_v_args /* Args */};
1730
1731 /* A static operand information for vector_type func (vector_type)
1732 * function registration. */
1733 static CONSTEXPR const rvv_op_info f_to_i_f_v_ops
1734 = {convert_i_ops, /* Types */
1735 OP_TYPE_f_v, /* Suffix */
1736 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1737 f_v_args /* Args */};
1738
1739 /* A static operand information for vector_type func (vector_type)
1740 * function registration. */
1741 static CONSTEXPR const rvv_op_info f_to_wi_f_v_ops
1742 = {wconvert_i_ops, /* Types */
1743 OP_TYPE_f_v, /* Suffix */
1744 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1745 trunc_f_v_args /* Args */};
1746
1747 /* A static operand information for vector_type func (vector_type)
1748 * function registration. */
1749 static CONSTEXPR const rvv_op_info f_to_ni_f_w_ops
1750 = {f_ops, /* Types */
1751 OP_TYPE_f_w, /* Suffix */
1752 rvv_arg_type_info (RVV_BASE_double_trunc_signed_vector), /* Return type */
1753 v_args /* Args */};
1754
1755 /* A static operand information for vector_type func (vector_type)
1756 * function registration. */
1757 static CONSTEXPR const rvv_op_info f_to_nu_f_w_ops
1758 = {f_ops, /* Types */
1759 OP_TYPE_f_w, /* Suffix */
1760 rvv_arg_type_info (
1761 RVV_BASE_double_trunc_unsigned_vector), /* Return type */
1762 v_args /* Args */};
1763
1764 /* A static operand information for vector_type func (vector_type)
1765 * function registration. */
1766 static CONSTEXPR const rvv_op_info i_to_f_x_v_ops
1767 = {f_ops, /* Types */
1768 OP_TYPE_x_v, /* Suffix */
1769 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1770 x_v_args /* Args */};
1771
1772 /* A static operand information for vector_type func (vector_type)
1773 * function registration. */
1774 static CONSTEXPR const rvv_op_info u_to_f_xu_v_ops
1775 = {f_ops, /* Types */
1776 OP_TYPE_xu_v, /* Suffix */
1777 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1778 xu_v_args /* Args */};
1779
1780 /* A static operand information for vector_type func (vector_type)
1781 * function registration. */
1782 static CONSTEXPR const rvv_op_info i_to_wf_x_v_ops
1783 = {f_ops, /* Types */
1784 OP_TYPE_x_v, /* Suffix */
1785 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1786 w_x_v_args /* Args */};
1787
1788 /* A static operand information for vector_type func (vector_type)
1789 * function registration. */
1790 static CONSTEXPR const rvv_op_info u_to_wf_xu_v_ops
1791 = {f_ops, /* Types */
1792 OP_TYPE_xu_v, /* Suffix */
1793 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1794 w_xu_v_args /* Args */};
1795
1796 /* A static operand information for vector_type func (vector_type)
1797 * function registration. */
1798 static CONSTEXPR const rvv_op_info i_to_nf_x_w_ops
1799 = {wconvert_i_ops, /* Types */
1800 OP_TYPE_x_w, /* Suffix */
1801 rvv_arg_type_info (RVV_BASE_double_trunc_float_vector), /* Return type */
1802 v_args /* Args */};
1803
1804 /* A static operand information for vector_type func (vector_type)
1805 * function registration. */
1806 static CONSTEXPR const rvv_op_info u_to_nf_xu_w_ops
1807 = {wconvert_u_ops, /* Types */
1808 OP_TYPE_xu_w, /* Suffix */
1809 rvv_arg_type_info (RVV_BASE_double_trunc_float_vector), /* Return type */
1810 v_args /* Args */};
1811
1812 /* A static operand information for vector_type func (vector_type)
1813 * function registration. */
1814 static CONSTEXPR const rvv_op_info f_to_u_f_v_ops
1815 = {convert_u_ops, /* Types */
1816 OP_TYPE_f_v, /* Suffix */
1817 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1818 f_v_args /* Args */};
1819
1820 /* A static operand information for vector_type func (vector_type)
1821 * function registration. */
1822 static CONSTEXPR const rvv_op_info f_to_wu_f_v_ops
1823 = {wconvert_u_ops, /* Types */
1824 OP_TYPE_f_v, /* Suffix */
1825 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1826 trunc_f_v_args /* Args */};
1827
1828 /* A static operand information for vector_type func (vector_type)
1829 * function registration. */
1830 static CONSTEXPR const rvv_op_info f_to_wf_f_v_ops
1831 = {f_ops, /* Types */
1832 OP_TYPE_f_v, /* Suffix */
1833 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1834 w_v_args /* Args */};
1835
1836 /* A static operand information for vector_type func (vector_type)
1837 * function registration. */
1838 static CONSTEXPR const rvv_op_info f_to_nf_f_w_ops
1839 = {wconvert_f_ops, /* Types */
1840 OP_TYPE_f_w, /* Suffix */
1841 rvv_arg_type_info (RVV_BASE_double_trunc_float_vector), /* Return type */
1842 v_args /* Args */};
1843
1844 /* A static operand information for vector_type func (vector_type)
1845 * function registration. */
1846 static CONSTEXPR const rvv_op_info f32_to_bf16_f_w_ops
1847 = {f32_ops, /* Types */
1848 OP_TYPE_f_w, /* Suffix */
1849 rvv_arg_type_info (RVV_BASE_double_trunc_bfloat_vector), /* Return type */
1850 v_args /* Args */};
1851
1852 /* A static operand information for vector_type func (vector_type)
1853 * function registration. */
1854 static CONSTEXPR const rvv_op_info bf16_to_f32_f_v_ops
1855 = {f32_ops, /* Types */
1856 OP_TYPE_f_v, /* Suffix */
1857 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1858 bf_w_v_args /* Args */};
1859
1860 /* A static operand information for vector_type func (vector_type, double demote
1861 * type, double demote type) function registration. */
1862 static CONSTEXPR const rvv_op_info f32_wwvv_ops
1863 = {f32_ops, /* Types */
1864 OP_TYPE_vv, /* Suffix */
1865 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1866 bf_wwvv_args /* Args */};
1867
1868 /* A static operand information for vector_type func (vector_type, double demote
1869 * scalar_type, double demote type) function registration. */
1870 static CONSTEXPR const rvv_op_info f32_wwfv_ops
1871 = {f32_ops, /* Types */
1872 OP_TYPE_vf, /* Suffix */
1873 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1874 bf_wwxv_args /* Args */};
1875
1876 /* A static operand information for vector_type func (vector_type)
1877 * function registration. */
1878 static CONSTEXPR const rvv_op_info all_v_ops
1879 = {all_ops, /* Types */
1880 OP_TYPE_v, /* Suffix */
1881 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1882 v_args /* Args */};
1883
1884 /* A static operand information for vector_type func (vector_type)
1885 * function registration. */
1886 static CONSTEXPR const rvv_op_info i_v_u_ops
1887 = {i_ops, /* Types */
1888 OP_TYPE_v, /* Suffix */
1889 rvv_arg_type_info (RVV_BASE_unsigned_vector), /* Return type */
1890 v_args /* Args */};
1891
1892 /* A static operand information for vector_type func (vector_type)
1893 * function registration. */
1894 static CONSTEXPR const rvv_op_info u_v_i_ops
1895 = {u_ops, /* Types */
1896 OP_TYPE_v, /* Suffix */
1897 rvv_arg_type_info (RVV_BASE_signed_vector), /* Return type */
1898 v_args /* Args */};
1899
1900 /* A static operand information for vector_type func (vector_type)
1901 * function registration. */
1902 static CONSTEXPR const rvv_op_info iu_v_eew8_interpret_ops
1903 = {eew8_interpret_ops, /* Types */
1904 OP_TYPE_v, /* Suffix */
1905 rvv_arg_type_info (RVV_BASE_eew8_interpret), /* Return type */
1906 v_args /* Args */};
1907
1908 /* A static operand information for vector_type func (vector_type)
1909 * function registration. */
1910 static CONSTEXPR const rvv_op_info iu_v_eew16_interpret_ops
1911 = {eew16_interpret_ops, /* Types */
1912 OP_TYPE_v, /* Suffix */
1913 rvv_arg_type_info (RVV_BASE_eew16_interpret), /* Return type */
1914 v_args /* Args */};
1915
1916 /* A static operand information for vector_type func (vector_type)
1917 * function registration. */
1918 static CONSTEXPR const rvv_op_info iu_v_eew32_interpret_ops
1919 = {eew32_interpret_ops, /* Types */
1920 OP_TYPE_v, /* Suffix */
1921 rvv_arg_type_info (RVV_BASE_eew32_interpret), /* Return type */
1922 v_args /* Args */};
1923
1924 /* A static operand information for vector_type func (vector_type)
1925 * function registration. */
1926 static CONSTEXPR const rvv_op_info iu_v_eew64_interpret_ops
1927 = {eew64_interpret_ops, /* Types */
1928 OP_TYPE_v, /* Suffix */
1929 rvv_arg_type_info (RVV_BASE_eew64_interpret), /* Return type */
1930 v_args /* Args */};
1931
1932 /* A static operand information for vbool1_t func (vector_type)
1933 * function registration. */
1934 static CONSTEXPR const rvv_op_info iu_v_bool1_interpret_ops
1935 = {bool1_interpret_ops, /* Types */
1936 OP_TYPE_v, /* Suffix */
1937 rvv_arg_type_info (RVV_BASE_bool1_interpret), /* Return type */
1938 v_args /* Args */};
1939
1940 /* A static operand information for vbool2_t func (vector_type)
1941 * function registration. */
1942 static CONSTEXPR const rvv_op_info iu_v_bool2_interpret_ops
1943 = {bool2_interpret_ops, /* Types */
1944 OP_TYPE_v, /* Suffix */
1945 rvv_arg_type_info (RVV_BASE_bool2_interpret), /* Return type */
1946 v_args /* Args */};
1947
1948 /* A static operand information for vbool4_t func (vector_type)
1949 * function registration. */
1950 static CONSTEXPR const rvv_op_info iu_v_bool4_interpret_ops
1951 = {bool4_interpret_ops, /* Types */
1952 OP_TYPE_v, /* Suffix */
1953 rvv_arg_type_info (RVV_BASE_bool4_interpret), /* Return type */
1954 v_args /* Args */};
1955
1956 /* A static operand information for vbool8_t func (vector_type)
1957 * function registration. */
1958 static CONSTEXPR const rvv_op_info iu_v_bool8_interpret_ops
1959 = {bool8_interpret_ops, /* Types */
1960 OP_TYPE_v, /* Suffix */
1961 rvv_arg_type_info (RVV_BASE_bool8_interpret), /* Return type */
1962 v_args /* Args */};
1963
1964 /* A static operand information for vbool16_t func (vector_type)
1965 * function registration. */
1966 static CONSTEXPR const rvv_op_info iu_v_bool16_interpret_ops
1967 = {bool16_interpret_ops, /* Types */
1968 OP_TYPE_v, /* Suffix */
1969 rvv_arg_type_info (RVV_BASE_bool16_interpret), /* Return type */
1970 v_args /* Args */};
1971
1972 /* A static operand information for vbool32_t func (vector_type)
1973 * function registration. */
1974 static CONSTEXPR const rvv_op_info iu_v_bool32_interpret_ops
1975 = {bool32_interpret_ops, /* Types */
1976 OP_TYPE_v, /* Suffix */
1977 rvv_arg_type_info (RVV_BASE_bool32_interpret), /* Return type */
1978 v_args /* Args */};
1979
1980 /* A static operand information for vbool64_t func (vector_type)
1981 * function registration. */
1982 static CONSTEXPR const rvv_op_info iu_v_bool64_interpret_ops
1983 = {bool64_interpret_ops, /* Types */
1984 OP_TYPE_v, /* Suffix */
1985 rvv_arg_type_info (RVV_BASE_bool64_interpret), /* Return type */
1986 v_args /* Args */};
1987
1988 /* A static operand information for vint8_t func (vector_type)
1989 * function registration. */
1990 static CONSTEXPR const rvv_op_info b_v_signed_eew8_lmul1_interpret_ops
1991 = {signed_eew8_lmul1_interpret_ops, /* Types */
1992 OP_TYPE_v, /* Suffix */
1993 rvv_arg_type_info (RVV_BASE_signed_eew8_lmul1_interpret),/* Return type */
1994 v_args /* Args */};
1995
1996 /* A static operand information for vint16_t func (vector_type)
1997 * function registration. */
1998 static CONSTEXPR const rvv_op_info b_v_signed_eew16_lmul1_interpret_ops
1999 = {signed_eew16_lmul1_interpret_ops, /* Types */
2000 OP_TYPE_v, /* Suffix */
2001 rvv_arg_type_info (RVV_BASE_signed_eew16_lmul1_interpret),/* Return type */
2002 v_args /* Args */};
2003
2004 /* A static operand information for vint32_t func (vector_type)
2005 * function registration. */
2006 static CONSTEXPR const rvv_op_info b_v_signed_eew32_lmul1_interpret_ops
2007 = {signed_eew32_lmul1_interpret_ops, /* Types */
2008 OP_TYPE_v, /* Suffix */
2009 rvv_arg_type_info (RVV_BASE_signed_eew32_lmul1_interpret),/* Return type */
2010 v_args /* Args */};
2011
2012 /* A static operand information for vint64_t func (vector_type)
2013 * function registration. */
2014 static CONSTEXPR const rvv_op_info b_v_signed_eew64_lmul1_interpret_ops
2015 = {signed_eew64_lmul1_interpret_ops, /* Types */
2016 OP_TYPE_v, /* Suffix */
2017 rvv_arg_type_info (RVV_BASE_signed_eew64_lmul1_interpret),/* Return type */
2018 v_args /* Args */};
2019
2020 /* A static operand information for vuint8_t func (vector_type)
2021 * function registration. */
2022 static CONSTEXPR const rvv_op_info b_v_unsigned_eew8_lmul1_interpret_ops
2023 = {unsigned_eew8_lmul1_interpret_ops, /* Types */
2024 OP_TYPE_v, /* Suffix */
2025 rvv_arg_type_info (RVV_BASE_unsigned_eew8_lmul1_interpret),/* Return type */
2026 v_args /* Args */};
2027
2028 /* A static operand information for vuint16_t func (vector_type)
2029 * function registration. */
2030 static CONSTEXPR const rvv_op_info b_v_unsigned_eew16_lmul1_interpret_ops
2031 = {unsigned_eew16_lmul1_interpret_ops, /* Types */
2032 OP_TYPE_v, /* Suffix */
2033 rvv_arg_type_info (RVV_BASE_unsigned_eew16_lmul1_interpret),/* Return type */
2034 v_args /* Args */};
2035
2036 /* A static operand information for vuint32_t func (vector_type)
2037 * function registration. */
2038 static CONSTEXPR const rvv_op_info b_v_unsigned_eew32_lmul1_interpret_ops
2039 = {unsigned_eew32_lmul1_interpret_ops, /* Types */
2040 OP_TYPE_v, /* Suffix */
2041 rvv_arg_type_info (RVV_BASE_unsigned_eew32_lmul1_interpret),/* Return type */
2042 v_args /* Args */};
2043
2044 /* A static operand information for vuint64_t func (vector_type)
2045 * function registration. */
2046 static CONSTEXPR const rvv_op_info b_v_unsigned_eew64_lmul1_interpret_ops
2047 = {unsigned_eew64_lmul1_interpret_ops, /* Types */
2048 OP_TYPE_v, /* Suffix */
2049 rvv_arg_type_info (RVV_BASE_unsigned_eew64_lmul1_interpret),/* Return type */
2050 v_args /* Args */};
2051
2052 /* A static operand information for vector_type func (vector_type)
2053 * function registration. */
2054 static CONSTEXPR const rvv_op_info all_v_vlmul_ext_x2_ops
2055 = {vlmul_ext_x2_ops, /* Types */
2056 OP_TYPE_v, /* Suffix */
2057 rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), /* Return type */
2058 v_args /* Args */};
2059
2060 /* A static operand information for vector_type func (vector_type)
2061 * function registration. */
2062 static CONSTEXPR const rvv_op_info all_v_vlmul_ext_x4_ops
2063 = {vlmul_ext_x4_ops, /* Types */
2064 OP_TYPE_v, /* Suffix */
2065 rvv_arg_type_info (RVV_BASE_vlmul_ext_x4), /* Return type */
2066 v_args /* Args */};
2067
2068 /* A static operand information for vector_type func (vector_type)
2069 * function registration. */
2070 static CONSTEXPR const rvv_op_info all_v_vlmul_ext_x8_ops
2071 = {vlmul_ext_x8_ops, /* Types */
2072 OP_TYPE_v, /* Suffix */
2073 rvv_arg_type_info (RVV_BASE_vlmul_ext_x8), /* Return type */
2074 v_args /* Args */};
2075
2076 /* A static operand information for vector_type func (vector_type)
2077 * function registration. */
2078 static CONSTEXPR const rvv_op_info all_v_vlmul_ext_x16_ops
2079 = {vlmul_ext_x16_ops, /* Types */
2080 OP_TYPE_v, /* Suffix */
2081 rvv_arg_type_info (RVV_BASE_vlmul_ext_x16), /* Return type */
2082 v_args /* Args */};
2083
2084 /* A static operand information for vector_type func (vector_type)
2085 * function registration. */
2086 static CONSTEXPR const rvv_op_info all_v_vlmul_ext_x32_ops
2087 = {vlmul_ext_x32_ops, /* Types */
2088 OP_TYPE_v, /* Suffix */
2089 rvv_arg_type_info (RVV_BASE_vlmul_ext_x32), /* Return type */
2090 v_args /* Args */};
2091
2092 /* A static operand information for vector_type func (vector_type)
2093 * function registration. */
2094 static CONSTEXPR const rvv_op_info all_v_vlmul_ext_x64_ops
2095 = {vlmul_ext_x64_ops, /* Types */
2096 OP_TYPE_v, /* Suffix */
2097 rvv_arg_type_info (RVV_BASE_vlmul_ext_x64), /* Return type */
2098 v_args /* Args */};
2099
2100 /* A static operand information for vector_type func (vector_type)
2101 * function registration. */
2102 static CONSTEXPR const rvv_op_info all_v_vlmul_trunc_x2_ops
2103 = {vlmul_ext_x2_ops, /* Types */
2104 OP_TYPE_v, /* Suffix */
2105 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2106 v_x2_trunc_args /* Args */};
2107
2108 /* A static operand information for vector_type func (vector_type)
2109 * function registration. */
2110 static CONSTEXPR const rvv_op_info all_v_vlmul_trunc_x4_ops
2111 = {vlmul_ext_x4_ops, /* Types */
2112 OP_TYPE_v, /* Suffix */
2113 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2114 v_x4_trunc_args /* Args */};
2115
2116 /* A static operand information for vector_type func (vector_type)
2117 * function registration. */
2118 static CONSTEXPR const rvv_op_info all_v_vlmul_trunc_x8_ops
2119 = {vlmul_ext_x8_ops, /* Types */
2120 OP_TYPE_v, /* Suffix */
2121 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2122 v_x8_trunc_args /* Args */};
2123
2124 /* A static operand information for vector_type func (vector_type)
2125 * function registration. */
2126 static CONSTEXPR const rvv_op_info all_v_vlmul_trunc_x16_ops
2127 = {vlmul_ext_x16_ops, /* Types */
2128 OP_TYPE_v, /* Suffix */
2129 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2130 v_x16_trunc_args /* Args */};
2131
2132 /* A static operand information for vector_type func (vector_type)
2133 * function registration. */
2134 static CONSTEXPR const rvv_op_info all_v_vlmul_trunc_x32_ops
2135 = {vlmul_ext_x32_ops, /* Types */
2136 OP_TYPE_v, /* Suffix */
2137 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2138 v_x32_trunc_args /* Args */};
2139
2140 /* A static operand information for vector_type func (vector_type)
2141 * function registration. */
2142 static CONSTEXPR const rvv_op_info all_v_vlmul_trunc_x64_ops
2143 = {vlmul_ext_x64_ops, /* Types */
2144 OP_TYPE_v, /* Suffix */
2145 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2146 v_x64_trunc_args /* Args */};
2147
2148 /* A static operand information for vector_type func (vector_type)
2149 * function registration. */
2150 static CONSTEXPR const rvv_op_info f_v_i_ops
2151 = {f_ops, /* Types */
2152 OP_TYPE_v, /* Suffix */
2153 rvv_arg_type_info (RVV_BASE_signed_vector), /* Return type */
2154 v_args /* Args */};
2155
2156 /* A static operand information for vector_type func (vector_type)
2157 * function registration. */
2158 static CONSTEXPR const rvv_op_info f_v_u_ops
2159 = {f_ops, /* Types */
2160 OP_TYPE_v, /* Suffix */
2161 rvv_arg_type_info (RVV_BASE_unsigned_vector), /* Return type */
2162 v_args /* Args */};
2163
2164 /* A static operand information for vector_type func (vector_type)
2165 * function registration. */
2166 static CONSTEXPR const rvv_op_info i_v_f_ops
2167 = {f_ops, /* Types */
2168 OP_TYPE_v, /* Suffix */
2169 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2170 x_v_args /* Args */};
2171
2172 /* A static operand information for vector_type func (vector_type)
2173 * function registration. */
2174 static CONSTEXPR const rvv_op_info u_v_f_ops
2175 = {f_ops, /* Types */
2176 OP_TYPE_v, /* Suffix */
2177 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2178 xu_v_args /* Args */};
2179
2180 /* A static operand information for vector_type func (scalar_type)
2181 * function registration. */
2182 static CONSTEXPR const rvv_op_info iu_x_ops
2183 = {iu_ops, /* Types */
2184 OP_TYPE_x, /* Suffix */
2185 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2186 x_args /* Args */};
2187
2188 /* A static operand information for vector_type func (scalar_type)
2189 * function registration. */
2190 static CONSTEXPR const rvv_op_info iu_s_x_ops
2191 = {iu_ops, /* Types */
2192 OP_TYPE_x, /* Suffix */
2193 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2194 x_args /* Args */};
2195
2196 /* A static operand information for vector_type func (scalar_type)
2197 * function registration. */
2198 static CONSTEXPR const rvv_op_info f_f_ops
2199 = {f_ops, /* Types */
2200 OP_TYPE_f, /* Suffix */
2201 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2202 x_args /* Args */};
2203
2204 /* A static operand information for vector_type func (scalar_type)
2205 * function registration. */
2206 static CONSTEXPR const rvv_op_info f_s_f_ops
2207 = {f_ops, /* Types */
2208 OP_TYPE_f, /* Suffix */
2209 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2210 x_args /* Args */};
2211
2212 /* A static operand information for vector_type func (double demote type)
2213 * function registration. */
2214 static CONSTEXPR const rvv_op_info i_vf2_ops
2215 = {wexti_ops, /* Types */
2216 OP_TYPE_vf2, /* Suffix */
2217 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2218 vf2_args /* Args */};
2219
2220 /* A static operand information for vector_type func (quad demote type)
2221 * function registration. */
2222 static CONSTEXPR const rvv_op_info i_vf4_ops
2223 = {qexti_ops, /* Types */
2224 OP_TYPE_vf4, /* Suffix */
2225 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2226 vf4_args /* Args */};
2227
2228 /* A static operand information for vector_type func (oct demote type)
2229 * function registration. */
2230 static CONSTEXPR const rvv_op_info i_vf8_ops
2231 = {oexti_ops, /* Types */
2232 OP_TYPE_vf8, /* Suffix */
2233 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2234 vf8_args /* Args */};
2235
2236 /* A static operand information for vector_type func (double demote type)
2237 * function registration. */
2238 static CONSTEXPR const rvv_op_info u_vf2_ops
2239 = {wextu_ops, /* Types */
2240 OP_TYPE_vf2, /* Suffix */
2241 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2242 vf2_args /* Args */};
2243
2244 /* A static operand information for vector_type func (quad demote type)
2245 * function registration. */
2246 static CONSTEXPR const rvv_op_info u_vf4_ops
2247 = {qextu_ops, /* Types */
2248 OP_TYPE_vf4, /* Suffix */
2249 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2250 vf4_args /* Args */};
2251
2252 /* A static operand information for vector_type func (oct demote type)
2253 * function registration. */
2254 static CONSTEXPR const rvv_op_info u_vf8_ops
2255 = {oextu_ops, /* Types */
2256 OP_TYPE_vf8, /* Suffix */
2257 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2258 vf8_args /* Args */};
2259
2260 /* A static operand information for vector_type func (double demote type, double
2261 * demote type) function registration. */
2262 static CONSTEXPR const rvv_op_info i_wvv_ops
2263 = {wexti_ops, /* Types */
2264 OP_TYPE_vv, /* Suffix */
2265 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2266 wvv_args /* Args */};
2267
2268 /* A static operand information for vector_type func (double demote type, double
2269 * demote type) function registration. */
2270 static CONSTEXPR const rvv_op_info f_wvv_ops
2271 = {wextf_ops, /* Types */
2272 OP_TYPE_vv, /* Suffix */
2273 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2274 wvv_args /* Args */};
2275
2276 /* A static operand information for vector_type func (vector_type, double demote
2277 * type, double demote type) function registration. */
2278 static CONSTEXPR const rvv_op_info i_wwvv_ops
2279 = {wexti_ops, /* Types */
2280 OP_TYPE_vv, /* Suffix */
2281 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2282 wwvv_args /* Args */};
2283
2284 /* A static operand information for vector_type func (vector_type, double demote
2285 * scalar_type, double demote type) function registration. */
2286 static CONSTEXPR const rvv_op_info i_wwxv_ops
2287 = {wexti_ops, /* Types */
2288 OP_TYPE_vx, /* Suffix */
2289 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2290 wwxv_args /* Args */};
2291
2292 /* A static operand information for vector_type func (vector_type, double demote
2293 * type, double demote type) function registration. */
2294 static CONSTEXPR const rvv_op_info f_wwvv_ops
2295 = {wextf_ops, /* Types */
2296 OP_TYPE_vv, /* Suffix */
2297 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2298 wwvv_args /* Args */};
2299
2300 /* A static operand information for vector_type func (vector_type, double demote
2301 * scalar_type, double demote type) function registration. */
2302 static CONSTEXPR const rvv_op_info f_wwfv_ops
2303 = {wextf_ops, /* Types */
2304 OP_TYPE_vf, /* Suffix */
2305 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2306 wwxv_args /* Args */};
2307
2308 /* A static operand information for vector_type func (vector_type, double demote
2309 * type, double demote type) function registration. */
2310 static CONSTEXPR const rvv_op_info u_wwvv_ops
2311 = {wextu_ops, /* Types */
2312 OP_TYPE_vv, /* Suffix */
2313 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2314 wwvv_args /* Args */};
2315
2316 /* A static operand information for vector_type func (vector_type, double demote
2317 * scalar_type, double demote type) function registration. */
2318 static CONSTEXPR const rvv_op_info u_wwxv_ops
2319 = {wextu_ops, /* Types */
2320 OP_TYPE_vx, /* Suffix */
2321 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2322 wwxv_args /* Args */};
2323
2324 /* A static operand information for vector_type func (vector_type, double demote
2325 * type, double demote type) function registration. */
2326 static CONSTEXPR const rvv_op_info i_su_wwvv_ops
2327 = {wexti_ops, /* Types */
2328 OP_TYPE_vv, /* Suffix */
2329 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2330 su_wwvv_args /* Args */};
2331
2332 /* A static operand information for vector_type func (vector_type, double demote
2333 * scalar_type, double demote type) function registration. */
2334 static CONSTEXPR const rvv_op_info i_su_wwxv_ops
2335 = {wexti_ops, /* Types */
2336 OP_TYPE_vx, /* Suffix */
2337 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2338 su_wwxv_args /* Args */};
2339
2340 /* A static operand information for vector_type func (vector_type, double demote
2341 * scalar_type, double demote type) function registration. */
2342 static CONSTEXPR const rvv_op_info i_us_wwxv_ops
2343 = {wexti_ops, /* Types */
2344 OP_TYPE_vx, /* Suffix */
2345 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2346 us_wwxv_args /* Args */};
2347
2348 /* A static operand information for vector_type func (vector_type, quad demote
2349 * type, quad demote type) function registration. */
2350 static CONSTEXPR const rvv_op_info i_qqvv_ops
2351 = {qmacc_ops, /* Types */
2352 OP_TYPE_4x8x4, /* Suffix */
2353 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2354 qqvv_args /* Args */};
2355
2356 /* A static operand information for vector_type func (vector_type, quad demote
2357 * type, quad demote type) function registration. */
2358 static CONSTEXPR const rvv_op_info u_qqvv_ops
2359 = {qmacc_ops, /* Types */
2360 OP_TYPE_4x8x4, /* Suffix */
2361 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2362 uqqvv_args /* Args */};
2363
2364 /* A static operand information for vector_type func (vector_type, quad demote
2365 * type, quad demote type) function registration. */
2366 static CONSTEXPR const rvv_op_info i_su_qqvv_ops
2367 = {qmacc_ops, /* Types */
2368 OP_TYPE_4x8x4, /* Suffix */
2369 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2370 su_qqvv_args /* Args */};
2371
2372 /* A static operand information for vector_type func (vector_type, quad demote
2373 * type, quad demote type) function registration. */
2374 static CONSTEXPR const rvv_op_info i_us_qqvv_ops
2375 = {qmacc_ops, /* Types */
2376 OP_TYPE_4x8x4, /* Suffix */
2377 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2378 us_qqvv_args /* Args */};
2379
2380 /* A static operand information for vector_type func (vector_type, quad demote
2381 * type, quad demote type) function registration. */
2382 static CONSTEXPR const rvv_op_info i_qdvv_ops
2383 = {qmacc_ops, /* Types */
2384 OP_TYPE_2x8x2, /* Suffix */
2385 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2386 qdvv_args /* Args */};
2387
2388 /* A static operand information for vector_type func (vector_type, quad demote
2389 * type, quad demote type) function registration. */
2390 static CONSTEXPR const rvv_op_info u_qdvv_ops
2391 = {qmacc_ops, /* Types */
2392 OP_TYPE_2x8x2, /* Suffix */
2393 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2394 uqdvv_args /* Args */};
2395
2396 /* A static operand information for vector_type func (vector_type, quad demote
2397 * type, quad demote type) function registration. */
2398 static CONSTEXPR const rvv_op_info i_su_qdvv_ops
2399 = {qmacc_ops, /* Types */
2400 OP_TYPE_2x8x2, /* Suffix */
2401 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2402 su_qdvv_args /* Args */};
2403
2404 /* A static operand information for vector_type func (vector_type, quad demote
2405 * type, quad demote type) function registration. */
2406 static CONSTEXPR const rvv_op_info i_us_qdvv_ops
2407 = {qmacc_ops, /* Types */
2408 OP_TYPE_2x8x2, /* Suffix */
2409 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2410 us_qdvv_args /* Args */};
2411
2412 /* A static operand information for vector_type func (signed double demote type,
2413 * unsigned double demote type) function registration. */
2414 static CONSTEXPR const rvv_op_info i_su_wvv_ops
2415 = {wexti_ops, /* Types */
2416 OP_TYPE_vv, /* Suffix */
2417 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2418 su_wvv_args /* Args */};
2419
2420 /* A static operand information for vector_type func (double demote type, double
2421 * demote type) function registration. */
2422 static CONSTEXPR const rvv_op_info u_wvv_ops
2423 = {wextu_ops, /* Types */
2424 OP_TYPE_vv, /* Suffix */
2425 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2426 wvv_args /* Args */};
2427
2428 /* A static operand information for vector_type func (double demote type, size type)
2429 * function registration. */
2430 static CONSTEXPR const rvv_op_info u_shift_wvx_ops
2431 = {wextu_ops, /* Types */
2432 OP_TYPE_vx, /* Suffix */
2433 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2434 wv_size_args /* Args */};
2435
2436 /* A static operand information for vector_type func (double demote type, double
2437 * demote scalar_type) function registration. */
2438 static CONSTEXPR const rvv_op_info i_wvx_ops
2439 = {wexti_ops, /* Types */
2440 OP_TYPE_vx, /* Suffix */
2441 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2442 wvx_args /* Args */};
2443
2444 /* A static operand information for vector_type func (double demote type, double
2445 * demote scalar_type) function registration. */
2446 static CONSTEXPR const rvv_op_info f_wvf_ops
2447 = {wextf_ops, /* Types */
2448 OP_TYPE_vf, /* Suffix */
2449 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2450 wvx_args /* Args */};
2451
2452 /* A static operand information for vector_type func (signed double demote type,
2453 * unsigned double demote scalar_type) function registration. */
2454 static CONSTEXPR const rvv_op_info i_su_wvx_ops
2455 = {wexti_ops, /* Types */
2456 OP_TYPE_vx, /* Suffix */
2457 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2458 su_wvx_args /* Args */};
2459
2460 /* A static operand information for vector_type func (vector_type, double
2461 * demote type) function registration. */
2462 static CONSTEXPR const rvv_op_info i_wwv_ops
2463 = {wexti_ops, /* Types */
2464 OP_TYPE_wv, /* Suffix */
2465 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2466 wwv_args /* Args */};
2467
2468 /* A static operand information for vector_type func (vector_type, double
2469 * demote type) function registration. */
2470 static CONSTEXPR const rvv_op_info f_wwv_ops
2471 = {wextf_ops, /* Types */
2472 OP_TYPE_wv, /* Suffix */
2473 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2474 wwv_args /* Args */};
2475
2476 /* A static operand information for vector_type func (vector_type, double
2477 * demote scalar_type) function registration. */
2478 static CONSTEXPR const rvv_op_info i_wwx_ops
2479 = {wexti_ops, /* Types */
2480 OP_TYPE_wx, /* Suffix */
2481 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2482 wwx_args /* Args */};
2483
2484 /* A static operand information for vector_type func (vector_type, double
2485 * demote scalar_type) function registration. */
2486 static CONSTEXPR const rvv_op_info f_wwf_ops
2487 = {wextf_ops, /* Types */
2488 OP_TYPE_wf, /* Suffix */
2489 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2490 wwx_args /* Args */};
2491
2492 /* A static operand information for vector_type func (vector_type, double
2493 * demote type) function registration. */
2494 static CONSTEXPR const rvv_op_info u_wwv_ops
2495 = {wextu_ops, /* Types */
2496 OP_TYPE_wv, /* Suffix */
2497 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2498 wwv_args /* Args */};
2499
2500 /* A static operand information for vector_type func (vector_type, double
2501 * demote scalar_type) function registration. */
2502 static CONSTEXPR const rvv_op_info u_wwx_ops
2503 = {wextu_ops, /* Types */
2504 OP_TYPE_wx, /* Suffix */
2505 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2506 wwx_args /* Args */};
2507
2508 /* A static operand information for vector_type func (double demote type, double
2509 * demote scalar_type) function registration. */
2510 static CONSTEXPR const rvv_op_info u_wvx_ops
2511 = {wextu_ops, /* Types */
2512 OP_TYPE_vx, /* Suffix */
2513 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2514 wvx_args /* Args */};
2515
2516 /* A static operand information for vector_type func (double demote type)
2517 * function registration. */
2518 static CONSTEXPR const rvv_op_info i_x_x_v_ops
2519 = {wexti_ops, /* Types */
2520 OP_TYPE_x_v, /* Suffix */
2521 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2522 x_x_v_args /* Args */};
2523
2524 /* A static operand information for vector_type func (unsigned double demote
2525 * type) function registration. */
2526 static CONSTEXPR const rvv_op_info u_x_x_v_ops
2527 = {wextu_ops, /* Types */
2528 OP_TYPE_x_v, /* Suffix */
2529 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2530 x_x_v_args /* Args */};
2531
2532 /* A static operand information for double demote type func (vector_type,
2533 * shift_type) function registration. */
2534 static CONSTEXPR const rvv_op_info i_narrow_shift_vwv_ops
2535 = {wexti_ops, /* Types */
2536 OP_TYPE_wv, /* Suffix */
2537 rvv_arg_type_info (RVV_BASE_double_trunc_vector), /* Return type */
2538 shift_wv_args /* Args */};
2539
2540 /* A static operand information for double demote type func (vector_type,
2541 * shift_type) function registration. */
2542 static CONSTEXPR const rvv_op_info u_narrow_shift_vwv_ops
2543 = {wextu_ops, /* Types */
2544 OP_TYPE_wv, /* Suffix */
2545 rvv_arg_type_info (RVV_BASE_double_trunc_vector), /* Return type */
2546 shift_wv_args /* Args */};
2547
2548 /* A static operand information for double demote type func (vector_type,
2549 * size_t) function registration. */
2550 static CONSTEXPR const rvv_op_info i_narrow_shift_vwx_ops
2551 = {wexti_ops, /* Types */
2552 OP_TYPE_wx, /* Suffix */
2553 rvv_arg_type_info (RVV_BASE_double_trunc_vector), /* Return type */
2554 v_size_args /* Args */};
2555
2556 /* A static operand information for double demote type func (vector_type,
2557 * shift_type) function registration. */
2558 static CONSTEXPR const rvv_op_info u_clip_qf_ops
2559 = {xfqf_ops, /* Types */
2560 OP_TYPE_none, /* Suffix */
2561 rvv_arg_type_info (RVV_BASE_unsigned_vector), /* Return type */
2562 clip_args /* Args */};
2563
2564 /* A static operand information for double demote type func (vector_type,
2565 * shift_type) function registration. */
2566 static CONSTEXPR const rvv_op_info i_clip_qf_ops
2567 = {xfqf_ops, /* Types */
2568 OP_TYPE_none, /* Suffix */
2569 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2570 clip_args /* Args */};
2571
2572 /* A static operand information for double demote type func (vector_type,
2573 * size_t) function registration. */
2574 static CONSTEXPR const rvv_op_info u_narrow_shift_vwx_ops
2575 = {wextu_ops, /* Types */
2576 OP_TYPE_wx, /* Suffix */
2577 rvv_arg_type_info (RVV_BASE_double_trunc_vector), /* Return type */
2578 v_size_args /* Args */};
2579
2580 /* A static operand information for double demote type func (vector_type)
2581 * function registration. */
2582 static CONSTEXPR const rvv_op_info iu_trunc_ops
2583 = {wextiu_ops, /* Types */
2584 OP_TYPE_x_w, /* Suffix */
2585 rvv_arg_type_info (RVV_BASE_double_trunc_vector), /* Return type */
2586 v_args /* Args */};
2587
2588 /* A static operand information for vector_type func (vector_type)
2589 * function registration. */
2590 static CONSTEXPR const rvv_op_info all_v_vset_lmul1_x2_ops
2591 = {lmul1_ops, /* Types */
2592 OP_TYPE_v, /* Suffix */
2593 rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), /* Return type */
2594 ext_x2_vset_args /* Args */};
2595
2596 /* A static operand information for vector_type func (vector_type)
2597 * function registration. */
2598 static CONSTEXPR const rvv_op_info all_v_vset_lmul1_x4_ops
2599 = {lmul1_ops, /* Types */
2600 OP_TYPE_v, /* Suffix */
2601 rvv_arg_type_info (RVV_BASE_vlmul_ext_x4), /* Return type */
2602 ext_x4_vset_args /* Args */};
2603
2604 /* A static operand information for vector_type func (vector_type)
2605 * function registration. */
2606 static CONSTEXPR const rvv_op_info all_v_vset_lmul1_x8_ops
2607 = {lmul1_ops, /* Types */
2608 OP_TYPE_v, /* Suffix */
2609 rvv_arg_type_info (RVV_BASE_vlmul_ext_x8), /* Return type */
2610 ext_x8_vset_args /* Args */};
2611
2612 /* A static operand information for vector_type func (vector_type)
2613 * function registration. */
2614 static CONSTEXPR const rvv_op_info all_v_vset_lmul2_x2_ops
2615 = {lmul2_ops, /* Types */
2616 OP_TYPE_v, /* Suffix */
2617 rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), /* Return type */
2618 ext_x2_vset_args /* Args */};
2619
2620 /* A static operand information for vector_type func (vector_type)
2621 * function registration. */
2622 static CONSTEXPR const rvv_op_info all_v_vset_lmul2_x4_ops
2623 = {lmul2_ops, /* Types */
2624 OP_TYPE_v, /* Suffix */
2625 rvv_arg_type_info (RVV_BASE_vlmul_ext_x4), /* Return type */
2626 ext_x4_vset_args /* Args */};
2627
2628 /* A static operand information for vector_type func (vector_type)
2629 * function registration. */
2630 static CONSTEXPR const rvv_op_info all_v_vset_lmul4_x2_ops
2631 = {lmul4_ops, /* Types */
2632 OP_TYPE_v, /* Suffix */
2633 rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), /* Return type */
2634 ext_x2_vset_args /* Args */};
2635
2636 /* A static operand information for vector_type func (vector_type)
2637 * function registration. */
2638 static CONSTEXPR const rvv_op_info all_v_vget_lmul1_x2_ops
2639 = {lmul1_ops, /* Types */
2640 OP_TYPE_v, /* Suffix */
2641 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2642 ext_x2_vget_args /* Args */};
2643
2644 /* A static operand information for vector_type func (vector_type)
2645 * function registration. */
2646 static CONSTEXPR const rvv_op_info all_v_vget_lmul1_x4_ops
2647 = {lmul1_ops, /* Types */
2648 OP_TYPE_v, /* Suffix */
2649 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2650 ext_x4_vget_args /* Args */};
2651
2652 /* A static operand information for vector_type func (vector_type)
2653 * function registration. */
2654 static CONSTEXPR const rvv_op_info all_v_vget_lmul1_x8_ops
2655 = {lmul1_ops, /* Types */
2656 OP_TYPE_v, /* Suffix */
2657 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2658 ext_x8_vget_args /* Args */};
2659
2660 /* A static operand information for vector_type func (vector_type)
2661 * function registration. */
2662 static CONSTEXPR const rvv_op_info all_v_vget_lmul2_x2_ops
2663 = {lmul2_ops, /* Types */
2664 OP_TYPE_v, /* Suffix */
2665 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2666 ext_x2_vget_args /* Args */};
2667
2668 /* A static operand information for vector_type func (vector_type)
2669 * function registration. */
2670 static CONSTEXPR const rvv_op_info all_v_vget_lmul2_x4_ops
2671 = {lmul2_ops, /* Types */
2672 OP_TYPE_v, /* Suffix */
2673 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2674 ext_x4_vget_args /* Args */};
2675
2676 /* A static operand information for vector_type func (vector_type)
2677 * function registration. */
2678 static CONSTEXPR const rvv_op_info all_v_vget_lmul4_x2_ops
2679 = {lmul4_ops, /* Types */
2680 OP_TYPE_v, /* Suffix */
2681 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2682 ext_x2_vget_args /* Args */};
2683
2684 /* A static operand information for size_t func () function registration. */
2685 static CONSTEXPR const rvv_op_info p_none_void_ops
2686 = {none_ops, /* Types */
2687 OP_TYPE_none, /* Suffix */
2688 rvv_arg_type_info (RVV_BASE_size), /* Return type */
2689 void_args /* Args */};
2690
2691 /* A static operand information for unsigned long func () function registration. */
2692 static CONSTEXPR const rvv_op_info ul_none_void_ops
2693 = {none_ops, /* Types */
2694 OP_TYPE_none, /* Suffix */
2695 rvv_arg_type_info (RVV_BASE_unsigned_long), /* Return type */
2696 void_args /* Args */};
2697
2698 /* A static operand information for vector_type func (vector_type)
2699 * function registration. */
2700 static CONSTEXPR const rvv_op_info all_v_vset_tuple_ops
2701 = {tuple_ops, /* Types */
2702 OP_TYPE_v, /* Suffix */
2703 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2704 tuple_vset_args /* Args */};
2705
2706 /* A static operand information for vector_type func (vector_type)
2707 * function registration. */
2708 static CONSTEXPR const rvv_op_info all_v_vget_tuple_ops
2709 = {tuple_ops, /* Types */
2710 OP_TYPE_v, /* Suffix */
2711 rvv_arg_type_info (RVV_BASE_tuple_subpart), /* Return type */
2712 v_size_args /* Args */};
2713
2714 /* A static operand information for vector_type func (const scalar_type *)
2715 * function registration. */
2716 static CONSTEXPR const rvv_op_info tuple_v_scalar_const_ptr_ops
2717 = {tuple_ops, /* Types */
2718 OP_TYPE_v, /* Suffix */
2719 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2720 scalar_const_ptr_args /* Args */};
2721
2722 /* A static operand information for void func (scalar_type *, vector_type)
2723 * function registration. */
2724 static CONSTEXPR const rvv_op_info tuple_v_scalar_ptr_ops
2725 = {tuple_ops, /* Types */
2726 OP_TYPE_v, /* Suffix */
2727 rvv_arg_type_info (RVV_BASE_void), /* Return type */
2728 scalar_ptr_args /* Args */};
2729
2730 /* A static operand information for vector_type func (const scalar_type *,
2731 * ptrdiff_t) function registration. */
2732 static CONSTEXPR const rvv_op_info tuple_v_scalar_const_ptr_ptrdiff_ops
2733 = {tuple_ops, /* Types */
2734 OP_TYPE_v, /* Suffix */
2735 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2736 scalar_const_ptr_ptrdiff_args /* Args */};
2737
2738 /* A static operand information for void func (scalar_type *, ptrdiff_t,
2739 * vector_type) function registration. */
2740 static CONSTEXPR const rvv_op_info tuple_v_scalar_ptr_ptrdiff_ops
2741 = {tuple_ops, /* Types */
2742 OP_TYPE_v, /* Suffix */
2743 rvv_arg_type_info (RVV_BASE_void), /* Return type */
2744 scalar_ptr_ptrdiff_args /* Args */};
2745
2746 /* A static operand information for vector_type func (const scalar_type *,
2747 * eew8_index_type) function registration. */
2748 static CONSTEXPR const rvv_op_info tuple_v_scalar_const_ptr_eew8_index_ops
2749 = {tuple_ops, /* Types */
2750 OP_TYPE_v, /* Suffix */
2751 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2752 scalar_const_ptr_eew8_index_args /* Args */};
2753
2754 /* A static operand information for vector_type func (const scalar_type *,
2755 * eew16_index_type) function registration. */
2756 static CONSTEXPR const rvv_op_info tuple_v_scalar_const_ptr_eew16_index_ops
2757 = {tuple_ops, /* Types */
2758 OP_TYPE_v, /* Suffix */
2759 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2760 scalar_const_ptr_eew16_index_args /* Args */};
2761
2762 /* A static operand information for vector_type func (const scalar_type *,
2763 * eew32_index_type) function registration. */
2764 static CONSTEXPR const rvv_op_info tuple_v_scalar_const_ptr_eew32_index_ops
2765 = {tuple_ops, /* Types */
2766 OP_TYPE_v, /* Suffix */
2767 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2768 scalar_const_ptr_eew32_index_args /* Args */};
2769
2770 /* A static operand information for vector_type func (const scalar_type *,
2771 * eew64_index_type) function registration. */
2772 static CONSTEXPR const rvv_op_info tuple_v_scalar_const_ptr_eew64_index_ops
2773 = {tuple_ops, /* Types */
2774 OP_TYPE_v, /* Suffix */
2775 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2776 scalar_const_ptr_eew64_index_args /* Args */};
2777
2778 /* A static operand information for void func (scalar_type *, eew8_index_type,
2779 * vector_type) function registration. */
2780 static CONSTEXPR const rvv_op_info tuple_v_scalar_ptr_eew8_index_ops
2781 = {tuple_ops, /* Types */
2782 OP_TYPE_v, /* Suffix */
2783 rvv_arg_type_info (RVV_BASE_void), /* Return type */
2784 scalar_ptr_eew8_index_args /* Args */};
2785
2786 /* A static operand information for void func (scalar_type *, eew16_index_type,
2787 * vector_type) function registration. */
2788 static CONSTEXPR const rvv_op_info tuple_v_scalar_ptr_eew16_index_ops
2789 = {tuple_ops, /* Types */
2790 OP_TYPE_v, /* Suffix */
2791 rvv_arg_type_info (RVV_BASE_void), /* Return type */
2792 scalar_ptr_eew16_index_args /* Args */};
2793
2794 /* A static operand information for void func (scalar_type *, eew32_index_type,
2795 * vector_type) function registration. */
2796 static CONSTEXPR const rvv_op_info tuple_v_scalar_ptr_eew32_index_ops
2797 = {tuple_ops, /* Types */
2798 OP_TYPE_v, /* Suffix */
2799 rvv_arg_type_info (RVV_BASE_void), /* Return type */
2800 scalar_ptr_eew32_index_args /* Args */};
2801
2802 /* A static operand information for void func (scalar_type *, eew64_index_type,
2803 * vector_type) function registration. */
2804 static CONSTEXPR const rvv_op_info tuple_v_scalar_ptr_eew64_index_ops
2805 = {tuple_ops, /* Types */
2806 OP_TYPE_v, /* Suffix */
2807 rvv_arg_type_info (RVV_BASE_void), /* Return type */
2808 scalar_ptr_eew64_index_args /* Args */};
2809
2810 /* A static operand information for vector_type func (const scalar_type *)
2811 * function registration. */
2812 static CONSTEXPR const rvv_op_info tuple_v_scalar_const_ptr_size_ptr_ops
2813 = {tuple_ops, /* Types */
2814 OP_TYPE_v, /* Suffix */
2815 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2816 scalar_const_ptr_size_ptr_args /* Args */};
2817
2818 /* A static operand information for vector_type func (vector_type)
2819 * function registration. */
2820 static CONSTEXPR const rvv_op_info all_v_vcreate_tuple_ops
2821 = {tuple_ops, /* Types */
2822 OP_TYPE_v, /* Suffix */
2823 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2824 tuple_vcreate_args /* Args */};
2825
2826 /* A static operand information for vector_type func () function registration.
2827 */
2828 static CONSTEXPR const rvv_op_info all_none_void_tuple_ops
2829 = {tuple_ops, /* Types */
2830 OP_TYPE_none, /* Suffix */
2831 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2832 void_args /* Args */};
2833
2834 /* A static operand information for vector_type func (vector_type)
2835 * function registration. */
2836 static CONSTEXPR const rvv_op_info all_v_vcreate_lmul1_x2_ops
2837 = {lmul1_ops, /* Types */
2838 OP_TYPE_v, /* Suffix */
2839 rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), /* Return type */
2840 ext_vcreate_args /* Args */};
2841
2842 /* A static operand information for vector_type func (vector_type)
2843 * function registration. */
2844 static CONSTEXPR const rvv_op_info all_v_vcreate_lmul1_x4_ops
2845 = {lmul1_ops, /* Types */
2846 OP_TYPE_v, /* Suffix */
2847 rvv_arg_type_info (RVV_BASE_vlmul_ext_x4), /* Return type */
2848 ext_vcreate_args /* Args */};
2849
2850 /* A static operand information for vector_type func (vector_type)
2851 * function registration. */
2852 static CONSTEXPR const rvv_op_info all_v_vcreate_lmul1_x8_ops
2853 = {lmul1_ops, /* Types */
2854 OP_TYPE_v, /* Suffix */
2855 rvv_arg_type_info (RVV_BASE_vlmul_ext_x8), /* Return type */
2856 ext_vcreate_args /* Args */};
2857
2858 /* A static operand information for vector_type func (vector_type)
2859 * function registration. */
2860 static CONSTEXPR const rvv_op_info all_v_vcreate_lmul2_x2_ops
2861 = {lmul2_ops, /* Types */
2862 OP_TYPE_v, /* Suffix */
2863 rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), /* Return type */
2864 ext_vcreate_args /* Args */};
2865
2866 /* A static operand information for vector_type func (vector_type)
2867 * function registration. */
2868 static CONSTEXPR const rvv_op_info all_v_vcreate_lmul2_x4_ops
2869 = {lmul2_ops, /* Types */
2870 OP_TYPE_v, /* Suffix */
2871 rvv_arg_type_info (RVV_BASE_vlmul_ext_x4), /* Return type */
2872 ext_vcreate_args /* Args */};
2873
2874 /* A static operand information for vector_type func (vector_type)
2875 * function registration. */
2876 static CONSTEXPR const rvv_op_info all_v_vcreate_lmul4_x2_ops
2877 = {lmul4_ops, /* Types */
2878 OP_TYPE_v, /* Suffix */
2879 rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), /* Return type */
2880 ext_vcreate_args /* Args */};
2881
2882 /* A static operand information for vector_type func (const scalar_type *,
2883 * size_t) function registration. */
2884 static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_size_ops
2885 = {all_ops, /* Types */
2886 OP_TYPE_v, /* Suffix */
2887 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2888 scalar_const_ptr_size_args /* Args */};
2889
2890 /* A static operand information for void func (scalar_type *, size_t,
2891 * vector_type) function registration. */
2892 static CONSTEXPR const rvv_op_info all_v_scalar_ptr_size_ops
2893 = {all_ops, /* Types */
2894 OP_TYPE_v, /* Suffix */
2895 rvv_arg_type_info (RVV_BASE_void), /* Return type */
2896 scalar_ptr_size_args /* Args */};
2897
2898 /* A static operand information for vector_type func (const scalar_type *,
2899 * index_type) function registration. */
2900 static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_index_ops
2901 = {all_ops, /* Types */
2902 OP_TYPE_v, /* Suffix */
2903 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2904 scalar_const_ptr_index_args /* Args */};
2905
2906 /* A static operand information for void func (scalar_type *, index_type,
2907 * vector_type) function registration. */
2908 static CONSTEXPR const rvv_op_info all_v_scalar_ptr_index_ops
2909 = {all_ops, /* Types */
2910 OP_TYPE_v, /* Suffix */
2911 rvv_arg_type_info (RVV_BASE_void), /* Return type */
2912 scalar_ptr_index_args /* Args */};
2913
2914 /* A static operand information for vector_type func (vector_type).
2915 Some insns just supports SEW=32, such as the crypto vector Zvkg extension.
2916 * function registration. */
2917 static CONSTEXPR const rvv_arg_type_info vs_lmul_x2_args[]
2918 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x2),
2919 rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};
2920
2921 static CONSTEXPR const rvv_arg_type_info vs_lmul_x4_args[]
2922 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x4),
2923 rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};
2924
2925 static CONSTEXPR const rvv_arg_type_info vs_lmul_x8_args[]
2926 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x8),
2927 rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};
2928
2929 static CONSTEXPR const rvv_arg_type_info vs_lmul_x16_args[]
2930 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x16),
2931 rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};
2932
2933 static CONSTEXPR const rvv_op_info u_vvv_crypto_sew32_ops
2934 = {crypto_sew32_ops, /* Types */
2935 OP_TYPE_vv, /* Suffix */
2936 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2937 vv_args /* Args */};
2938
2939 static CONSTEXPR const rvv_op_info u_vvvv_crypto_sew32_ops
2940 = {crypto_sew32_ops, /* Types */
2941 OP_TYPE_vv, /* Suffix */
2942 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2943 vvv_args /* Args */};
2944
2945 static CONSTEXPR const rvv_op_info u_vvv_size_crypto_sew32_ops
2946 = {crypto_sew32_ops, /* Types */
2947 OP_TYPE_vi, /* Suffix */
2948 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2949 vv_size_args /* Args */};
2950
2951 static CONSTEXPR const rvv_op_info u_vv_size_crypto_sew32_ops
2952 = {crypto_sew32_ops, /* Types */
2953 OP_TYPE_vi, /* Suffix */
2954 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2955 v_size_args /* Args */};
2956
2957 static CONSTEXPR const rvv_op_info u_vvs_crypto_sew32_ops
2958 = {crypto_sew32_ops, /* Types */
2959 OP_TYPE_vs, /* Suffix */
2960 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2961 vv_args /* Args */};
2962
2963 static CONSTEXPR const rvv_op_info u_vvs_crypto_sew32_lmul_x2_ops
2964 = {crypto_sew32_ops, /* Types */
2965 OP_TYPE_vs, /* Suffix */
2966 rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), /* Return type */
2967 vs_lmul_x2_args /* Args */};
2968
2969 static CONSTEXPR const rvv_op_info u_vvs_crypto_sew32_lmul_x4_ops
2970 = {crypto_sew32_ops, /* Types */
2971 OP_TYPE_vs, /* Suffix */
2972 rvv_arg_type_info (RVV_BASE_vlmul_ext_x4), /* Return type */
2973 vs_lmul_x4_args /* Args */};
2974
2975 static CONSTEXPR const rvv_op_info u_vvs_crypto_sew32_lmul_x8_ops
2976 = {crypto_sew32_ops, /* Types */
2977 OP_TYPE_vs, /* Suffix */
2978 rvv_arg_type_info (RVV_BASE_vlmul_ext_x8), /* Return type */
2979 vs_lmul_x8_args /* Args */};
2980
2981 static CONSTEXPR const rvv_op_info u_vvs_crypto_sew32_lmul_x16_ops
2982 = {crypto_sew32_ops, /* Types */
2983 OP_TYPE_vs, /* Suffix */
2984 rvv_arg_type_info (RVV_BASE_vlmul_ext_x16), /* Return type */
2985 vs_lmul_x16_args /* Args */};
2986
2987 /* A static operand information for vector_type func (vector_type).
2988 Some insns just supports SEW=64, such as the crypto vector Zvbc extension
2989 vclmul.vv, vclmul.vx.
2990 * function registration. */
2991 static CONSTEXPR const rvv_op_info u_vvv_crypto_sew64_ops
2992 = {crypto_sew64_ops, /* Types */
2993 OP_TYPE_vv, /* Suffix */
2994 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2995 vv_args /* Args */};
2996
2997 static CONSTEXPR const rvv_op_info u_vvx_crypto_sew64_ops
2998 = {crypto_sew64_ops, /* Types */
2999 OP_TYPE_vx, /* Suffix */
3000 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
3001 vx_args /* Args */};
3002
3003 static CONSTEXPR const rvv_op_info u_vvvv_crypto_sew64_ops
3004 = {crypto_sew64_ops, /* Types */
3005 OP_TYPE_vv, /* Suffix */
3006 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
3007 vvv_args /* Args */};
3008
3009 /* A list of all RVV base function types. */
3010 static CONSTEXPR const function_type_info function_types[] = {
3011 #define DEF_RVV_TYPE_INDEX( \
3012 VECTOR, MASK, SIGNED, UNSIGNED, SIGNED_EEW8_INDEX, EEW8_INDEX, EEW16_INDEX, \
3013 EEW32_INDEX, EEW64_INDEX, SHIFT, DOUBLE_TRUNC, QUAD_TRUNC, QUAD_EMUL, \
3014 QUAD_EMUL_SIGNED, QUAD_EMUL_UNSIGNED, QUAD_FIX, QUAD_FIX_SIGNED, \
3015 QUAD_FIX_UNSIGNED, OCT_TRUNC, DOUBLE_TRUNC_SCALAR, DOUBLE_TRUNC_SIGNED, \
3016 DOUBLE_TRUNC_UNSIGNED, DOUBLE_TRUNC_UNSIGNED_SCALAR, \
3017 DOUBLE_TRUNC_BFLOAT_SCALAR, DOUBLE_TRUNC_BFLOAT, DOUBLE_TRUNC_FLOAT, FLOAT, \
3018 LMUL1, WLMUL1, QLMUL1, QLMUL1_SIGNED, QLMUL1_UNSIGNED, XFQF, EEW8_INTERPRET, \
3019 EEW16_INTERPRET, EEW32_INTERPRET, EEW64_INTERPRET, BOOL1_INTERPRET, \
3020 BOOL2_INTERPRET, BOOL4_INTERPRET, BOOL8_INTERPRET, BOOL16_INTERPRET, \
3021 BOOL32_INTERPRET, BOOL64_INTERPRET, SIGNED_EEW8_LMUL1_INTERPRET, \
3022 SIGNED_EEW16_LMUL1_INTERPRET, SIGNED_EEW32_LMUL1_INTERPRET, \
3023 SIGNED_EEW64_LMUL1_INTERPRET, UNSIGNED_EEW8_LMUL1_INTERPRET, \
3024 UNSIGNED_EEW16_LMUL1_INTERPRET, UNSIGNED_EEW32_LMUL1_INTERPRET, \
3025 UNSIGNED_EEW64_LMUL1_INTERPRET, X2_VLMUL_EXT, X4_VLMUL_EXT, X8_VLMUL_EXT, \
3026 X16_VLMUL_EXT, X32_VLMUL_EXT, X64_VLMUL_EXT, TUPLE_SUBPART) \
3027 { \
3028 VECTOR_TYPE_##VECTOR, \
3029 VECTOR_TYPE_INVALID, \
3030 VECTOR_TYPE_##MASK, \
3031 VECTOR_TYPE_##SIGNED, \
3032 VECTOR_TYPE_##UNSIGNED, \
3033 VECTOR_TYPE_INVALID, \
3034 VECTOR_TYPE_INVALID, \
3035 VECTOR_TYPE_INVALID, \
3036 VECTOR_TYPE_INVALID, \
3037 VECTOR_TYPE_INVALID, \
3038 VECTOR_TYPE_INVALID, \
3039 VECTOR_TYPE_INVALID, \
3040 VECTOR_TYPE_INVALID, \
3041 VECTOR_TYPE_INVALID, \
3042 VECTOR_TYPE_##SIGNED_EEW8_INDEX, \
3043 VECTOR_TYPE_##EEW8_INDEX, \
3044 VECTOR_TYPE_##EEW16_INDEX, \
3045 VECTOR_TYPE_##EEW32_INDEX, \
3046 VECTOR_TYPE_##EEW64_INDEX, \
3047 VECTOR_TYPE_##SHIFT, \
3048 VECTOR_TYPE_##DOUBLE_TRUNC, \
3049 VECTOR_TYPE_##QUAD_TRUNC, \
3050 VECTOR_TYPE_##QUAD_EMUL, \
3051 VECTOR_TYPE_##QUAD_EMUL_SIGNED, \
3052 VECTOR_TYPE_##QUAD_EMUL_UNSIGNED, \
3053 VECTOR_TYPE_##QUAD_FIX, \
3054 VECTOR_TYPE_##QUAD_FIX_SIGNED, \
3055 VECTOR_TYPE_##QUAD_FIX_UNSIGNED, \
3056 VECTOR_TYPE_##OCT_TRUNC, \
3057 VECTOR_TYPE_##DOUBLE_TRUNC_SCALAR, \
3058 VECTOR_TYPE_##DOUBLE_TRUNC_SIGNED, \
3059 VECTOR_TYPE_##DOUBLE_TRUNC_UNSIGNED, \
3060 VECTOR_TYPE_##DOUBLE_TRUNC_UNSIGNED_SCALAR, \
3061 VECTOR_TYPE_##DOUBLE_TRUNC_BFLOAT_SCALAR, \
3062 VECTOR_TYPE_##DOUBLE_TRUNC_BFLOAT, \
3063 VECTOR_TYPE_##DOUBLE_TRUNC_FLOAT, \
3064 VECTOR_TYPE_##FLOAT, \
3065 VECTOR_TYPE_##LMUL1, \
3066 VECTOR_TYPE_##WLMUL1, \
3067 VECTOR_TYPE_##QLMUL1, \
3068 VECTOR_TYPE_##QLMUL1_SIGNED, \
3069 VECTOR_TYPE_##QLMUL1_UNSIGNED, \
3070 VECTOR_TYPE_##XFQF, \
3071 VECTOR_TYPE_##EEW8_INTERPRET, \
3072 VECTOR_TYPE_##EEW16_INTERPRET, \
3073 VECTOR_TYPE_##EEW32_INTERPRET, \
3074 VECTOR_TYPE_##EEW64_INTERPRET, \
3075 VECTOR_TYPE_##BOOL1_INTERPRET, \
3076 VECTOR_TYPE_##BOOL2_INTERPRET, \
3077 VECTOR_TYPE_##BOOL4_INTERPRET, \
3078 VECTOR_TYPE_##BOOL8_INTERPRET, \
3079 VECTOR_TYPE_##BOOL16_INTERPRET, \
3080 VECTOR_TYPE_##BOOL32_INTERPRET, \
3081 VECTOR_TYPE_##BOOL64_INTERPRET, \
3082 VECTOR_TYPE_##SIGNED_EEW8_LMUL1_INTERPRET, \
3083 VECTOR_TYPE_##SIGNED_EEW16_LMUL1_INTERPRET, \
3084 VECTOR_TYPE_##SIGNED_EEW32_LMUL1_INTERPRET, \
3085 VECTOR_TYPE_##SIGNED_EEW64_LMUL1_INTERPRET, \
3086 VECTOR_TYPE_##UNSIGNED_EEW8_LMUL1_INTERPRET, \
3087 VECTOR_TYPE_##UNSIGNED_EEW16_LMUL1_INTERPRET, \
3088 VECTOR_TYPE_##UNSIGNED_EEW32_LMUL1_INTERPRET, \
3089 VECTOR_TYPE_##UNSIGNED_EEW64_LMUL1_INTERPRET, \
3090 VECTOR_TYPE_##X2_VLMUL_EXT, \
3091 VECTOR_TYPE_##X4_VLMUL_EXT, \
3092 VECTOR_TYPE_##X8_VLMUL_EXT, \
3093 VECTOR_TYPE_##X16_VLMUL_EXT, \
3094 VECTOR_TYPE_##X32_VLMUL_EXT, \
3095 VECTOR_TYPE_##X64_VLMUL_EXT, \
3096 VECTOR_TYPE_INVALID, \
3097 VECTOR_TYPE_##TUPLE_SUBPART, \
3098 },
3099 #include "riscv-vector-builtins.def"
3100 }; // namespace riscv_vector
3101
3102 /* A list of all RVV intrinsic functions. */
3103 static function_group_info function_groups[] = {
3104 #define DEF_RVV_FUNCTION(NAME, SHAPE, PREDS, OPS_INFO) \
3105 {#NAME, &bases::NAME, &shapes::SHAPE, PREDS, OPS_INFO, REQUIRED_EXTENSIONS},
3106 #include "riscv-vector-builtins-functions.def"
3107 #undef DEF_RVV_FUNCTION
3108 #define DEF_RVV_FUNCTION(NAME, SHAPE, PREDS, OPS_INFO) \
3109 {#NAME, &bases::NAME, &shapes::SHAPE, PREDS, OPS_INFO, REQUIRED_EXTENSIONS},
3110 #include "thead-vector-builtins-functions.def"
3111 #define DEF_RVV_FUNCTION(NAME, SHAPE, PREDS, OPS_INFO) \
3112 {#NAME, &bases::NAME, &shapes::SHAPE, PREDS, OPS_INFO, REQUIRED_EXTENSIONS},
3113 #include "sifive-vector-builtins-functions.def"
3114 };
3115
3116 /* The RVV types, with their built-in
3117 "__rvv..._t" name. Allow an index of NUM_VECTOR_TYPES, which always
3118 yields a null tree. */
3119 static GTY (()) tree abi_vector_types[NUM_VECTOR_TYPES + 1];
3120
3121 /* Same, but with the riscv_vector.h "v..._t" name. */
3122 extern GTY (()) rvv_builtin_types_t builtin_types[NUM_VECTOR_TYPES + 1];
3123 rvv_builtin_types_t builtin_types[NUM_VECTOR_TYPES + 1];
3124
3125 /* The list of all registered function decls, indexed by code. */
3126 static GTY (()) vec<registered_function *, va_gc> *registered_functions;
3127
3128 /* All registered function decls, hashed on the function_instance
3129 that they implement. This is used for looking up implementations of
3130 overloaded functions. */
3131 static hash_table<registered_function_hasher> *function_table;
3132
3133 /* All registered function decls, hashed on overload_name and argument list
3134 of the registered_function. This is used for looking up implementations
3135 of non-overloaded functions. */
3136 static hash_table<non_overloaded_registered_function_hasher>
3137 *non_overloaded_function_table;
3138
3139 struct pragma_intrinsic_flags
3140 {
3141 int intrinsic_target_flags;
3142
3143 int intrinsic_riscv_vector_elen_flags;
3144 int intrinsic_riscv_zvl_flags;
3145 };
3146
3147 static void
3148 riscv_pragma_intrinsic_flags_pollute (struct pragma_intrinsic_flags *flags)
3149 {
3150 /* We already defer the required extension checking to expantion time, so we
3151 only need to pollute those flags that might affect the type registration.
3152
3153 e.g. zvfbmin and zvfhmin are required to define the vector bf16 and f16,
3154 and VECTOR_ELEN* also required for vector interger and floating
3155 type. */
3156 flags->intrinsic_target_flags = target_flags;
3157 flags->intrinsic_riscv_vector_elen_flags = riscv_vector_elen_flags;
3158 flags->intrinsic_riscv_zvl_flags = riscv_zvl_flags;
3159
3160 target_flags = target_flags
3161 | MASK_VECTOR;
3162
3163 riscv_zvl_flags = riscv_zvl_flags
3164 | MASK_ZVL32B
3165 | MASK_ZVL64B
3166 | MASK_ZVL128B
3167 | MASK_ZVL256B
3168 | MASK_ZVL512B
3169 | MASK_ZVL1024B
3170 | MASK_ZVL2048B
3171 | MASK_ZVL4096B;
3172
3173 riscv_vector_elen_flags = riscv_vector_elen_flags
3174 | MASK_VECTOR_ELEN_32
3175 | MASK_VECTOR_ELEN_64
3176 | MASK_VECTOR_ELEN_FP_16
3177 | MASK_VECTOR_ELEN_BF_16
3178 | MASK_VECTOR_ELEN_FP_32
3179 | MASK_VECTOR_ELEN_FP_64;
3180 }
3181
3182 static void
3183 riscv_pragma_intrinsic_flags_restore (struct pragma_intrinsic_flags *flags)
3184 {
3185 target_flags = flags->intrinsic_target_flags;
3186
3187 riscv_vector_elen_flags = flags->intrinsic_riscv_vector_elen_flags;
3188 riscv_zvl_flags = flags->intrinsic_riscv_zvl_flags;
3189 }
3190
3191 /* RAII class for enabling enough RVV features to define the built-in
3192 types and implement the riscv_vector.h pragma.
3193
3194 Note: According to 'TYPE_MODE' macro implementation, we need set
3195 have_regs_of_mode[mode] to be true if we want to get the exact mode
3196 from 'TYPE_MODE'. However, have_regs_of_mode has not been set yet in
3197 targetm.init_builtins (). We need rvv_switcher to set have_regs_of_mode
3198 before targetm.init_builtins () and recover back have_regs_of_mode
3199 after targetm.init_builtins (). */
3200 class rvv_switcher
3201 {
3202 public:
3203 rvv_switcher (bool pollute_flags = true);
3204 ~rvv_switcher ();
3205
3206 private:
3207 bool m_old_have_regs_of_mode[MAX_MACHINE_MODE];
3208 struct pragma_intrinsic_flags backup_flags;
3209 bool m_pollute_flags;
3210 };
3211
3212 static void
3213 register_builtin_types_on_null ();
3214
3215 rvv_switcher::rvv_switcher (bool pollute_flags)
3216 : m_pollute_flags (pollute_flags)
3217 {
3218 if (m_pollute_flags)
3219 {
3220 riscv_pragma_intrinsic_flags_pollute (&backup_flags);
3221 riscv_option_override ();
3222 }
3223
3224 /* Allow all vector modes during builtin registration so that
3225 vector_mode_supported_p does not reject fractional LMUL modes
3226 for xtheadvector. */
3227 riscv_registering_builtins = true;
3228
3229 /* Set have_regs_of_mode before targetm.init_builtins (). */
3230 memcpy (m_old_have_regs_of_mode, have_regs_of_mode,
3231 sizeof (have_regs_of_mode));
3232 for (int i = 0; i < NUM_MACHINE_MODES; ++i)
3233 if (riscv_v_ext_vector_mode_p ((machine_mode) i))
3234 have_regs_of_mode[i] = true;
3235
3236 /* Not necessary to adjust mode and register type if we don't pollute
3237 flags. */
3238 if (m_pollute_flags)
3239 {
3240 init_adjust_machine_modes ();
3241
3242 register_builtin_types_on_null ();
3243 }
3244 }
3245
3246 rvv_switcher::~rvv_switcher ()
3247 {
3248 riscv_registering_builtins = false;
3249
3250 /* Recover back have_regs_of_mode. */
3251 memcpy (have_regs_of_mode, m_old_have_regs_of_mode,
3252 sizeof (have_regs_of_mode));
3253
3254 if (m_pollute_flags)
3255 {
3256 riscv_pragma_intrinsic_flags_restore (&backup_flags);
3257
3258 /* Re-initialize after the flags are restored. */
3259 riscv_option_override ();
3260 init_adjust_machine_modes ();
3261 }
3262 }
3263
3264 /* Add attribute NAME to ATTRS. */
3265 static tree
3266 add_attribute (const char *name, tree attrs)
3267 {
3268 return tree_cons (get_identifier (name), NULL_TREE, attrs);
3269 }
3270
3271 /* Add type attributes to builtin type tree, currently only the mangled name. */
3272 static void
3273 add_vector_type_attribute (tree type, const char *mangled_name)
3274 {
3275 tree mangled_name_tree = get_identifier (mangled_name);
3276 tree value = tree_cons (NULL_TREE, mangled_name_tree, NULL_TREE);
3277 TYPE_ATTRIBUTES (type)
3278 = tree_cons (get_identifier ("RVV type"), value, TYPE_ATTRIBUTES (type));
3279 }
3280
3281 /* Force TYPE to be a sizeless type. */
3282 static void
3283 make_type_sizeless (tree type)
3284 {
3285 TYPE_ATTRIBUTES (type) = tree_cons (get_identifier ("RVV sizeless type"),
3286 NULL_TREE, TYPE_ATTRIBUTES (type));
3287 }
3288
3289 /* Return true if TYPE is a sizeless type. */
3290 static bool
3291 sizeless_type_p (const_tree type)
3292 {
3293 if (type == error_mark_node)
3294 return NULL_TREE;
3295 return lookup_attribute ("RVV sizeless type", TYPE_ATTRIBUTES (type));
3296 }
3297
3298 /* If TYPE is an ABI-defined RVV type, return its attribute descriptor,
3299 otherwise return null. */
3300 tree
3301 lookup_vector_type_attribute (const_tree type)
3302 {
3303 if (type == error_mark_node)
3304 return NULL_TREE;
3305 return lookup_attribute ("RVV type", TYPE_ATTRIBUTES (type));
3306 }
3307
3308 /* Return a representation of "const T *". */
3309 static tree
3310 build_const_pointer (tree t)
3311 {
3312 return build_pointer_type (build_qualified_type (t, TYPE_QUAL_CONST));
3313 }
3314
3315 /* Helper function for register a single built-in RVV ABI type. */
3316 static void
3317 register_builtin_type (vector_type_index type, tree eltype, machine_mode mode)
3318 {
3319 builtin_types[type].scalar = eltype;
3320 builtin_types[type].scalar_ptr = build_pointer_type (eltype);
3321 builtin_types[type].scalar_const_ptr = build_const_pointer (eltype);
3322 /* TODO: We currently just skip the register of the illegal RVV type.
3323 Ideally, we should report error message more friendly instead of
3324 reporting "unknown" type. Support more friendly error message in
3325 the future. */
3326 if (!riscv_v_ext_vector_mode_p (mode))
3327 return;
3328
3329 tree vectype = build_vector_type_for_mode (eltype, mode);
3330 gcc_assert (VECTOR_MODE_P (TYPE_MODE (vectype)) && TYPE_MODE (vectype) == mode
3331 && TYPE_MODE_RAW (vectype) == mode && TYPE_ALIGN (vectype) <= 128
3332 && known_eq (tree_to_poly_uint64 (TYPE_SIZE (vectype)),
3333 GET_MODE_BITSIZE (mode)));
3334 vectype = build_distinct_type_copy (vectype);
3335 gcc_assert (vectype == TYPE_MAIN_VARIANT (vectype));
3336 SET_TYPE_STRUCTURAL_EQUALITY (vectype);
3337 TYPE_ARTIFICIAL (vectype) = 1;
3338 TYPE_INDIVISIBLE_P (vectype) = 1;
3339 add_vector_type_attribute (vectype, vector_types[type].mangled_name);
3340 make_type_sizeless (vectype);
3341 abi_vector_types[type] = vectype;
3342 lang_hooks.types.register_builtin_type (vectype, vector_types[type].abi_name);
3343 }
3344
3345 /* Register the tuple type that contains NUM_VECTORS vectors of type TYPE. */
3346 static void
3347 register_tuple_type (vector_type_index type, vector_type_index subpart_type,
3348 tree eltype, unsigned int nf)
3349 {
3350 /* TODO: We currently just skip the register of the illegal RVV type.
3351 Ideally, we should report error message more friendly instead of
3352 reporting "unknown" type. Support more friendly error message in
3353 the future. */
3354 if (!abi_vector_types[subpart_type])
3355 return;
3356 tree tuple_type = lang_hooks.types.make_type (RECORD_TYPE);
3357
3358 /* The contents of the type are opaque, so we can define them in any
3359 way that maps to the correct ABI type.
3360
3361 Here we choose to use the same layout as for riscv_vector.h, with
3362 "__val":
3363
3364 struct vfooxN_t { vfoo_t __val[N]; };
3365
3366 (It wouldn't be possible to write that directly in C or C++ for
3367 sizeless types, but that's not a problem for this function.)
3368
3369 Using arrays simplifies the handling of vget and vset for variable
3370 arguments. */
3371 tree array_type = build_array_type_nelts (abi_vector_types[subpart_type], nf);
3372 gcc_assert (array_type);
3373 gcc_assert (VECTOR_MODE_P (TYPE_MODE (array_type))
3374 && TYPE_MODE_RAW (array_type) == TYPE_MODE (array_type));
3375
3376 tree field = build_decl (input_location, FIELD_DECL, get_identifier ("__val"),
3377 array_type);
3378 DECL_FIELD_CONTEXT (field) = tuple_type;
3379 TYPE_FIELDS (tuple_type) = field;
3380 add_vector_type_attribute (tuple_type, vector_types[type].mangled_name);
3381 make_type_sizeless (tuple_type);
3382 layout_type (tuple_type);
3383 gcc_assert (VECTOR_MODE_P (TYPE_MODE (tuple_type))
3384 && TYPE_MODE_RAW (tuple_type) == TYPE_MODE (tuple_type));
3385
3386 tree decl
3387 = build_decl (input_location, TYPE_DECL,
3388 get_identifier (vector_types[type].abi_name), tuple_type);
3389 TYPE_NAME (tuple_type) = decl;
3390 TYPE_STUB_DECL (tuple_type) = decl;
3391 lang_hooks.decls.pushdecl (decl);
3392 /* ??? Undo the effect of set_underlying_type for C. The C frontend
3393 doesn't recognize DECL as a built-in because (as intended) the decl has
3394 a real location instead of BUILTINS_LOCATION. The frontend therefore
3395 treats the decl like a normal C "typedef struct foo foo;", expecting
3396 the type for tag "struct foo" to have a dummy unnamed TYPE_DECL instead
3397 of the named one we attached above. It then sets DECL_ORIGINAL_TYPE
3398 on the supposedly unnamed decl, creating a circularity that upsets
3399 dwarf2out.
3400
3401 We don't want to follow the normal C model and create "struct foo"
3402 tags for tuple types since (a) the types are supposed to be opaque
3403 and (b) they couldn't be defined as a real struct anyway. Treating
3404 the TYPE_DECLs as "typedef struct foo foo;" without creating
3405 "struct foo" would lead to confusing error messages. */
3406 DECL_ORIGINAL_TYPE (decl) = NULL_TREE;
3407
3408 builtin_types[type].scalar = eltype;
3409 builtin_types[type].scalar_ptr = build_pointer_type (eltype);
3410 builtin_types[type].scalar_const_ptr = build_const_pointer (eltype);
3411 abi_vector_types[type] = tuple_type;
3412 }
3413
3414 /* Register the built-in RVV ABI types, such as __rvv_int32m1_t. */
3415 static void
3416 register_builtin_types ()
3417 {
3418 /* Don't pollute flags at this stage to make sure we only register type with
3419 what we want so far, we will register all type if necessary later. */
3420 rvv_switcher rvv (/* pollute_flags */ false);
3421 register_builtin_types_on_null ();
3422 }
3423
3424 /* Similar as register_builtin_types but perform the registration if and
3425 only if the element of abi_vector_type is NULL_TREE. */
3426 static void
3427 register_builtin_types_on_null ()
3428 {
3429 /* Get type node from get_typenode_from_name to prevent we have different type
3430 node define in different target libraries, e.g. int32_t defined as
3431 `long` in RV32/newlib-stdint, but `int` for RV32/glibc-stdint.h.
3432 NOTE: uint[16|32|64]_type_node already defined in tree.h. */
3433 tree int8_type_node = get_typenode_from_name (INT8_TYPE);
3434 tree uint8_type_node = get_typenode_from_name (UINT8_TYPE);
3435 tree int16_type_node = get_typenode_from_name (INT16_TYPE);
3436 tree int32_type_node = get_typenode_from_name (INT32_TYPE);
3437 tree int64_type_node = get_typenode_from_name (INT64_TYPE);
3438
3439 machine_mode mode;
3440 #define DEF_RVV_TYPE(NAME, NCHARS, ABI_NAME, SCALAR_TYPE, VECTOR_MODE, \
3441 ARGS...) \
3442 mode = VECTOR_MODE##mode; \
3443 if (abi_vector_types[VECTOR_TYPE_##NAME] == NULL_TREE) \
3444 register_builtin_type (VECTOR_TYPE_##NAME, SCALAR_TYPE##_type_node, mode);
3445
3446 #define DEF_RVV_TUPLE_TYPE(NAME, NCHARS, ABI_NAME, SUBPART_TYPE, SCALAR_TYPE, \
3447 NF, VECTOR_SUFFIX) \
3448 if (abi_vector_types[VECTOR_TYPE_##NAME] == NULL_TREE) \
3449 register_tuple_type (VECTOR_TYPE_##NAME, VECTOR_TYPE_##SUBPART_TYPE, \
3450 SCALAR_TYPE##_type_node, NF);
3451 #include "riscv-vector-builtins.def"
3452 }
3453
3454 /* Register vector type TYPE under its riscv_vector.h name. */
3455 static void
3456 register_vector_type (vector_type_index type)
3457 {
3458 tree vectype = abi_vector_types[type];
3459
3460 /* When vectype is NULL, the corresponding builtin type
3461 is disabled according to '-march'. */
3462 /* TODO: We currently just skip the register of the illegal RVV type.
3463 Ideally, we should report error message more friendly instead of
3464 reporting "unknown" type. Support more friendly error message in
3465 the future. */
3466 if (!vectype)
3467 return;
3468 tree id = get_identifier (vector_types[type].name);
3469 tree decl = build_decl (input_location, TYPE_DECL, id, vectype);
3470 decl = lang_hooks.decls.pushdecl (decl);
3471
3472 /* Record the new RVV type if pushdecl succeeded without error. Use
3473 the ABI type otherwise, so that the type we record at least has the
3474 right form, even if it doesn't have the right name. This should give
3475 better error recovery behavior than installing error_mark_node or
3476 installing an incorrect type. */
3477 if (decl && TREE_CODE (decl) == TYPE_DECL
3478 && TREE_TYPE (decl) != error_mark_node
3479 && TYPE_MAIN_VARIANT (TREE_TYPE (decl)) == vectype)
3480 vectype = TREE_TYPE (decl);
3481
3482 builtin_types[type].vector = vectype;
3483 builtin_types[type].vector_ptr = build_pointer_type (vectype);
3484 }
3485
3486 /* Return true if the type has required_extensions. */
3487 static bool
3488 required_extensions_p (enum rvv_base_type type)
3489 {
3490 switch (type)
3491 {
3492 case RVV_BASE_eew8_index:
3493 case RVV_BASE_eew16_index:
3494 case RVV_BASE_eew32_index:
3495 case RVV_BASE_eew64_index:
3496 case RVV_BASE_float_vector:
3497 case RVV_BASE_double_trunc_float_vector:
3498 case RVV_BASE_double_trunc_vector:
3499 case RVV_BASE_widen_lmul1_vector:
3500 case RVV_BASE_eew8_interpret:
3501 case RVV_BASE_eew16_interpret:
3502 case RVV_BASE_eew32_interpret:
3503 case RVV_BASE_eew64_interpret:
3504 case RVV_BASE_bool1_interpret:
3505 case RVV_BASE_bool2_interpret:
3506 case RVV_BASE_bool4_interpret:
3507 case RVV_BASE_bool8_interpret:
3508 case RVV_BASE_bool16_interpret:
3509 case RVV_BASE_bool32_interpret:
3510 case RVV_BASE_bool64_interpret:
3511 case RVV_BASE_signed_eew8_lmul1_interpret:
3512 case RVV_BASE_signed_eew16_lmul1_interpret:
3513 case RVV_BASE_signed_eew32_lmul1_interpret:
3514 case RVV_BASE_signed_eew64_lmul1_interpret:
3515 case RVV_BASE_unsigned_eew8_lmul1_interpret:
3516 case RVV_BASE_unsigned_eew16_lmul1_interpret:
3517 case RVV_BASE_unsigned_eew32_lmul1_interpret:
3518 case RVV_BASE_unsigned_eew64_lmul1_interpret:
3519 case RVV_BASE_vlmul_ext_x2:
3520 case RVV_BASE_vlmul_ext_x4:
3521 case RVV_BASE_vlmul_ext_x8:
3522 case RVV_BASE_vlmul_ext_x16:
3523 case RVV_BASE_vlmul_ext_x32:
3524 case RVV_BASE_vlmul_ext_x64:
3525 return true;
3526 default:
3527 return false;
3528 }
3529
3530 gcc_unreachable ();
3531 }
3532
3533 /* Check whether all the RVV_REQUIRE_* values in REQUIRED_EXTENSIONS are
3534 enabled.
3535 TODO: We defer the required extensions to expantion time, this function is
3536 only doing the legality now, and we may rename this function and moving
3537 to another layer. */
3538 static bool
3539 check_required_extensions (const function_instance &instance)
3540 {
3541 rvv_type_info type_info = instance.type;
3542 const rvv_op_info *op_info = instance.op_info;
3543
3544 if (required_extensions_p (op_info->ret.base_type))
3545 {
3546 enum vector_type_index ret_type_idx
3547 = op_info->ret.get_function_type_index (type_info.index);
3548 if (ret_type_idx == NUM_VECTOR_TYPES)
3549 return false;
3550 }
3551
3552 for (unsigned i = 0; op_info->args[i].base_type != NUM_BASE_TYPES; ++i)
3553 {
3554 if (!required_extensions_p (op_info->args[i].base_type))
3555 continue;
3556 enum vector_type_index vector_type
3557 = op_info->args[i].get_function_type_index (type_info.index);
3558 if (vector_type == NUM_VECTOR_TYPES)
3559 return false;
3560 }
3561
3562 return true;
3563 }
3564
3565 /* Return true if predication is using a real mask operand. */
3566 static bool
3567 use_real_mask_p (enum predication_type_index pred)
3568 {
3569 return pred == PRED_TYPE_m || pred == PRED_TYPE_tum || pred == PRED_TYPE_tumu
3570 || pred == PRED_TYPE_mu;
3571 }
3572
3573 /* Return true if predication is using a real merge operand. */
3574 static bool
3575 use_real_merge_p (enum predication_type_index pred)
3576 {
3577 return pred == PRED_TYPE_tu || pred == PRED_TYPE_tum || pred == PRED_TYPE_tumu
3578 || pred == PRED_TYPE_mu;
3579 }
3580
3581 /* Get TAIL policy for predication. If predication indicates TU, return the TU.
3582 Otherwise, return the prefer default configuration. */
3583 static rtx
3584 get_tail_policy_for_pred (enum predication_type_index pred)
3585 {
3586 if (pred == PRED_TYPE_tu || pred == PRED_TYPE_tum || pred == PRED_TYPE_tumu)
3587 return gen_int_mode (TAIL_UNDISTURBED, Pmode);
3588 return gen_int_mode (get_prefer_tail_policy (), Pmode);
3589 }
3590
3591 /* Get MASK policy for predication. If predication indicates MU, return the MU.
3592 Otherwise, return the prefer default configuration. */
3593 static rtx
3594 get_mask_policy_for_pred (enum predication_type_index pred)
3595 {
3596 if (pred == PRED_TYPE_tumu || pred == PRED_TYPE_mu)
3597 return gen_int_mode (MASK_UNDISTURBED, Pmode);
3598 return gen_int_mode (get_prefer_mask_policy (), Pmode);
3599 }
3600
3601 tree
3602 rvv_arg_type_info::get_scalar_ptr_type (vector_type_index type_idx) const
3603 {
3604 /* According to the latest rvv-intrinsic-doc, it defines vsm.v intrinsic:
3605 __riscv_vsm (uint8_t *base, vbool1_t value, size_t vl). */
3606 if (type_idx >= VECTOR_TYPE_vbool64_t && type_idx <= VECTOR_TYPE_vbool1_t)
3607 return builtin_types[VECTOR_TYPE_vuint8mf8_t].scalar_ptr;
3608 else
3609 return builtin_types[type_idx].scalar_ptr;
3610 }
3611
3612 tree
3613 rvv_arg_type_info::get_scalar_const_ptr_type (vector_type_index type_idx) const
3614 {
3615 /* According to the latest rvv-intrinsic-doc, it defines vlm.v intrinsic:
3616 __riscv_vlm_v_b1 (const uint8_t *base, size_t vl). */
3617 if (type_idx >= VECTOR_TYPE_vbool64_t && type_idx <= VECTOR_TYPE_vbool1_t)
3618 return builtin_types[VECTOR_TYPE_vuint8mf8_t].scalar_const_ptr;
3619 else
3620 return builtin_types[type_idx].scalar_const_ptr;
3621 }
3622
3623 tree
3624 rvv_arg_type_info::get_xfqf_float_type (vector_type_index type_idx) const
3625 {
3626 /* Convert vint8 types into float types.
3627 Note:
3628 - According to riscv-vector-builtins-types.def, the index of an unsigned
3629 type is always one greater than its corresponding signed type. */
3630 if (type_idx >= VECTOR_TYPE_vint8mf8_t && type_idx <= VECTOR_TYPE_vuint8m2_t)
3631 return builtin_types[VECTOR_TYPE_vfloat32m1_t].scalar;
3632 else
3633 return NULL_TREE;
3634 }
3635
3636 vector_type_index
3637 rvv_arg_type_info::get_function_type_index (vector_type_index type_idx) const
3638 {
3639 tree type
3640 = builtin_types[function_types[type_idx].type_indexes[base_type]].vector;
3641 return type ? function_types[type_idx].type_indexes[base_type]
3642 : NUM_VECTOR_TYPES;
3643 }
3644
3645 tree
3646 rvv_arg_type_info::get_tree_type (vector_type_index type_idx) const
3647 {
3648 /* If the builtin type is not registered means '-march' doesn't
3649 satisfy the require extension of the type. For example,
3650 vfloat32m1_t require floating-point extension. In this case,
3651 just return NULL_TREE. */
3652 if (type_idx != VECTOR_TYPE_INVALID && !builtin_types[type_idx].vector)
3653 return NULL_TREE;
3654
3655 switch (base_type)
3656 {
3657 #define DEF_RVV_BASE_TYPE(NAME, TYPE) \
3658 case RVV_BASE_##NAME: \
3659 return TYPE;
3660 #include "riscv-vector-builtins.def"
3661 default:
3662 gcc_unreachable ();
3663 }
3664 gcc_unreachable ();
3665 }
3666
3667 tree
3668 rvv_arg_type_info::get_tuple_subpart_type (vector_type_index type_idx) const
3669 {
3670 switch (type_idx)
3671 {
3672 #define DEF_RVV_TUPLE_TYPE(NAME, NCHARS, ABI_NAME, SUBPART_TYPE, ARGS...) \
3673 case VECTOR_TYPE_##NAME: \
3674 return builtin_types[VECTOR_TYPE_##SUBPART_TYPE].vector;
3675 #include "riscv-vector-builtins.def"
3676 default:
3677 gcc_unreachable ();
3678 }
3679 gcc_unreachable ();
3680 }
3681
3682 function_instance::function_instance (const char *base_name_in,
3683 const function_base *base_in,
3684 const function_shape *shape_in,
3685 rvv_type_info type_in,
3686 predication_type_index pred_in,
3687 const rvv_op_info *op_info_in)
3688 : base_name (base_name_in), base (base_in), shape (shape_in), type (type_in),
3689 pred (pred_in), op_info (op_info_in)
3690 {
3691 }
3692
3693 bool
3694 function_instance::operator== (const function_instance &other) const
3695 {
3696 for (unsigned int i = 0; op_info->args[i].base_type != NUM_BASE_TYPES; ++i)
3697 if (op_info->args[i].base_type != other.op_info->args[i].base_type)
3698 return false;
3699 return (base == other.base && shape == other.shape
3700 && type.index == other.type.index && op_info->op == other.op_info->op
3701 && pred == other.pred
3702 && op_info->ret.base_type == other.op_info->ret.base_type);
3703 }
3704
3705 bool
3706 function_instance::any_type_float_p () const
3707 {
3708 if (riscv_vector_float_type_p (get_return_type ()))
3709 return true;
3710
3711 for (int i = 0; op_info->args[i].base_type != NUM_BASE_TYPES; ++i)
3712 if (riscv_vector_float_type_p (get_arg_type (i)))
3713 return true;
3714
3715 return false;
3716 }
3717
3718 tree
3719 function_instance::get_return_type () const
3720 {
3721 return op_info->ret.get_tree_type (type.index);
3722 }
3723
3724 bool
3725 function_instance::function_returns_void_p () const
3726 {
3727 return get_return_type () == void_type_node;
3728 }
3729
3730 tree
3731 function_instance::get_arg_type (unsigned opno) const
3732 {
3733 return op_info->args[opno].get_tree_type (type.index);
3734 }
3735
3736 /* Return a hash code for a function_instance. */
3737 hashval_t
3738 function_instance::hash () const
3739 {
3740 inchash::hash h;
3741 /* BASE uniquely determines BASE_NAME, so we don't need to hash both. */
3742 h.add_ptr (base);
3743 h.add_ptr (shape);
3744 h.add_int (type.index);
3745 h.add_int (op_info->op);
3746 h.add_int (pred);
3747 h.add_int (op_info->ret.base_type);
3748 for (unsigned int i = 0; op_info->args[i].base_type != NUM_BASE_TYPES; ++i)
3749 h.add_int (op_info->args[i].base_type);
3750 return h.end ();
3751 }
3752
3753 /* Return a set of CP_* flags that describe what the function could do,
3754 taking the command-line flags into account. */
3755 unsigned int
3756 function_instance::call_properties () const
3757 {
3758 unsigned int flags = base->call_properties (*this);
3759
3760 /* -fno-trapping-math means that we can assume any FP exceptions
3761 are not user-visible. */
3762 if (!flag_trapping_math)
3763 flags &= ~CP_RAISE_FP_EXCEPTIONS;
3764
3765 return flags;
3766 }
3767
3768 /* Return true if calls to the function could read some form of
3769 global state. */
3770 bool
3771 function_instance::reads_global_state_p () const
3772 {
3773 unsigned int flags = call_properties ();
3774
3775 /* Preserve any dependence on rounding mode, flush to zero mode, etc.
3776 There is currently no way of turning this off; in particular,
3777 -fno-rounding-math (which is the default) means that we should make
3778 the usual assumptions about rounding mode, which for intrinsics means
3779 acting as the instructions do. */
3780 if (flags & CP_READ_FPCR)
3781 return true;
3782
3783 /* Handle direct reads of global state. */
3784 return flags & (CP_READ_MEMORY | CP_READ_CSR);
3785 }
3786
3787 /* Return true if calls to the function could modify some form of
3788 global state. */
3789 bool
3790 function_instance::modifies_global_state_p () const
3791 {
3792 unsigned int flags = call_properties ();
3793
3794 /* Preserve any exception state written back to the FPCR,
3795 unless -fno-trapping-math says this is unnecessary. */
3796 if (flags & CP_RAISE_FP_EXCEPTIONS)
3797 return true;
3798
3799 /* Handle direct modifications of global state. */
3800 return flags & (CP_WRITE_MEMORY | CP_WRITE_CSR);
3801 }
3802
3803 /* Return true if calls to the function could raise a signal. */
3804 bool
3805 function_instance::could_trap_p () const
3806 {
3807 unsigned int flags = call_properties ();
3808
3809 /* Handle functions that could raise SIGFPE. */
3810 if (flags & CP_RAISE_FP_EXCEPTIONS)
3811 return true;
3812
3813 /* Handle functions that could raise SIGBUS or SIGSEGV. */
3814 if (flags & (CP_READ_MEMORY | CP_WRITE_MEMORY))
3815 return true;
3816
3817 return false;
3818 }
3819
3820 function_builder::function_builder ()
3821 {
3822 m_direct_overloads = lang_GNU_CXX ();
3823 gcc_obstack_init (&m_string_obstack);
3824 }
3825
3826 function_builder::~function_builder ()
3827 {
3828 obstack_free (&m_string_obstack, NULL);
3829 }
3830
3831 /* Allocate arguments of the function. */
3832 void
3833 function_builder::allocate_argument_types (const function_instance &instance,
3834 vec<tree> &argument_types) const
3835 {
3836 for (unsigned int i = 0;
3837 instance.op_info->args[i].base_type != NUM_BASE_TYPES; ++i)
3838 argument_types.quick_push (
3839 instance.op_info->args[i].get_tree_type (instance.type.index));
3840 }
3841
3842 /* Apply predication into argument_types. */
3843 void
3844 function_builder::apply_predication (const function_instance &instance,
3845 tree return_type,
3846 vec<tree> &argument_types) const
3847 {
3848 /* These predication types need to apply merge type. */
3849 if (instance.base->has_merge_operand_p ())
3850 if (instance.pred == PRED_TYPE_tu || instance.pred == PRED_TYPE_tum
3851 || instance.pred == PRED_TYPE_tumu || instance.pred == PRED_TYPE_mu)
3852 argument_types.quick_insert (0, return_type);
3853
3854 /* These predication types need to apply mask type. */
3855 vector_type_index mask_type_index
3856 = function_types[instance.type.index].type_indexes[RVV_BASE_mask];
3857 tree mask_type = builtin_types[mask_type_index].vector;
3858 if (instance.pred == PRED_TYPE_m || instance.pred == PRED_TYPE_tum
3859 || instance.pred == PRED_TYPE_tumu || instance.pred == PRED_TYPE_mu)
3860 argument_types.quick_insert (0, mask_type);
3861
3862 /* check if rounding mode parameter need */
3863 if (instance.base->has_rounding_mode_operand_p ())
3864 argument_types.quick_push (unsigned_type_node);
3865
3866 /* check if vl parameter need */
3867 if (instance.base->apply_vl_p ())
3868 argument_types.quick_push (size_type_node);
3869 }
3870
3871 /* Register all the functions in GROUP. */
3872 void
3873 function_builder::register_function_group (const function_group_info &group)
3874 {
3875 (*group.shape)->build (*this, group);
3876 }
3877
3878 /* Add NAME to the end of the function name being built. */
3879 void
3880 function_builder::append_name (const char *name)
3881 {
3882 obstack_grow (&m_string_obstack, name, strlen (name));
3883 }
3884
3885 /* Add "__riscv_" and "name". */
3886 void
3887 function_builder::append_base_name (const char *name)
3888 {
3889 append_name ("__riscv_");
3890 append_name (name);
3891 }
3892
3893 /* Add SEW into function name. */
3894 void
3895 function_builder::append_sew (int sew)
3896 {
3897 switch (sew)
3898 {
3899 case 8:
3900 append_name ("8");
3901 break;
3902 case 16:
3903 append_name ("16");
3904 break;
3905 case 32:
3906 append_name ("32");
3907 break;
3908 case 64:
3909 append_name ("64");
3910 break;
3911 default:
3912 gcc_unreachable ();
3913 }
3914 }
3915
3916 /* Add NF into function name. */
3917 void
3918 function_builder::append_nf (int nf)
3919 {
3920 switch (nf)
3921 {
3922 case 2:
3923 append_name ("2");
3924 break;
3925 case 3:
3926 append_name ("3");
3927 break;
3928 case 4:
3929 append_name ("4");
3930 break;
3931 case 5:
3932 append_name ("5");
3933 break;
3934 case 6:
3935 append_name ("6");
3936 break;
3937 case 7:
3938 append_name ("7");
3939 break;
3940 case 8:
3941 append_name ("8");
3942 break;
3943 default:
3944 gcc_unreachable ();
3945 }
3946 }
3947
3948 /* Zero-terminate and complete the function name being built. */
3949 char *
3950 function_builder::finish_name ()
3951 {
3952 obstack_1grow (&m_string_obstack, 0);
3953 return (char *) obstack_finish (&m_string_obstack);
3954 }
3955
3956 /* Return the appropriate function attributes for INSTANCE. */
3957 tree
3958 function_builder::get_attributes (const function_instance &instance)
3959 {
3960 tree attrs = NULL_TREE;
3961
3962 if (!instance.modifies_global_state_p ())
3963 {
3964 if (instance.reads_global_state_p ())
3965 attrs = add_attribute ("pure", attrs);
3966 else
3967 attrs = add_attribute ("const", attrs);
3968 }
3969
3970 if (!flag_non_call_exceptions || !instance.could_trap_p ())
3971 attrs = add_attribute ("nothrow", attrs);
3972
3973 return add_attribute ("leaf", attrs);
3974 }
3975
3976 /* Add a function called NAME with type FNTYPE and attributes ATTRS.
3977 INSTANCE describes what the function does. */
3978 registered_function &
3979 function_builder::add_function (const function_instance &instance,
3980 const char *name, tree fntype, tree attrs,
3981 bool placeholder_p, const char *overload_name,
3982 const vec<tree> &argument_types,
3983 enum required_ext required,
3984 bool overloaded_p = false)
3985 {
3986 unsigned int code = vec_safe_length (registered_functions);
3987 code = (code << RISCV_BUILTIN_SHIFT) + RISCV_BUILTIN_VECTOR;
3988
3989 /* We need to be able to generate placeholders to ensure that we have a
3990 consistent numbering scheme for function codes between the C and C++
3991 frontends, so that everything ties up in LTO.
3992
3993 Currently, tree-streamer-in.c:unpack_ts_function_decl_value_fields
3994 validates that tree nodes returned by TARGET_BUILTIN_DECL are non-NULL and
3995 some node other than error_mark_node. This is a holdover from when builtin
3996 decls were streamed by code rather than by value.
3997
3998 Ultimately, we should be able to remove this validation of BUILT_IN_MD
3999 nodes and remove the target hook. For now, however, we need to appease the
4000 validation and return a non-NULL, non-error_mark_node node, so we
4001 arbitrarily choose integer_zero_node. */
4002 tree decl = placeholder_p || in_lto_p
4003 ? integer_zero_node
4004 : simulate_builtin_function_decl (input_location, name, fntype,
4005 code, NULL, attrs);
4006
4007 registered_function &rfn = *ggc_alloc<registered_function> ();
4008 rfn.instance = instance;
4009 rfn.decl = decl;
4010 rfn.overload_name = overload_name ? xstrdup (overload_name) : NULL;
4011 rfn.argument_types = argument_types;
4012 rfn.overloaded_p = overloaded_p;
4013 rfn.required = required;
4014 vec_safe_push (registered_functions, &rfn);
4015
4016 return rfn;
4017 }
4018
4019 /* Add a built-in function for INSTANCE, with the argument types given
4020 by ARGUMENT_TYPES and the return type given by RETURN_TYPE. NAME is
4021 the "full" name for C function. OVERLOAD_NAME is the "short" name for
4022 C++ overloaded function. OVERLOAD_NAME can be nullptr because some
4023 instance doesn't have C++ overloaded function. */
4024 void
4025 function_builder::add_unique_function (const function_instance &instance,
4026 const function_shape *shape,
4027 tree return_type,
4028 vec<tree> &argument_types,
4029 enum required_ext required)
4030 {
4031 /* Do not add this function if it is invalid. */
4032 if (!check_required_extensions (instance))
4033 return;
4034
4035 /* Also add the function under its overloaded alias, if we want
4036 a separate decl for each instance of an overloaded function. */
4037 char *overload_name = shape->get_name (*this, instance, true);
4038
4039 /* Add the function under its full (unique) name. */
4040 char *name = shape->get_name (*this, instance, false);
4041 tree fntype
4042 = build_function_type_array (return_type, argument_types.length (),
4043 argument_types.address ());
4044 tree attrs = get_attributes (instance);
4045 registered_function &rfn
4046 = add_function (instance, name, fntype, attrs, false, overload_name,
4047 argument_types.copy (), required);
4048
4049 /* Enter the function into the hash table. */
4050 hashval_t hash = instance.hash ();
4051 registered_function **rfn_slot
4052 = function_table->find_slot_with_hash (instance, hash, INSERT);
4053 gcc_assert (!*rfn_slot);
4054 *rfn_slot = &rfn;
4055
4056 if (overload_name)
4057 {
4058 /* Attribute lists shouldn't be shared. */
4059 tree attrs = get_attributes (instance);
4060 if (m_direct_overloads)
4061 add_function (instance, overload_name, fntype, attrs, false, NULL,
4062 vNULL, required);
4063 else
4064 {
4065 if (!non_overloaded_function_table)
4066 non_overloaded_function_table
4067 = new hash_table<non_overloaded_registered_function_hasher> (
4068 1023);
4069 /* Enter the function into the non-overloaded hash table. */
4070 hash = rfn.overloaded_hash ();
4071 rfn_slot
4072 = non_overloaded_function_table->find_slot_with_hash (&rfn, hash,
4073 INSERT);
4074 gcc_assert (!*rfn_slot);
4075 *rfn_slot = &rfn;
4076 }
4077 }
4078 obstack_free (&m_string_obstack, name);
4079 }
4080
4081 /* Add overloaded function for gcc. */
4082 void
4083 function_builder::add_overloaded_function (const function_instance &instance,
4084 const function_shape *shape,
4085 enum required_ext required)
4086 {
4087 if (m_direct_overloads)
4088 return;
4089
4090 if (!check_required_extensions (instance))
4091 return;
4092
4093 char *name = shape->get_name (*this, instance, true);
4094
4095 if (name)
4096 {
4097 /* To avoid API conflicting, take void return type and void argument
4098 for the overloaded function. */
4099 tree fntype = build_function_type (void_type_node, void_list_node);
4100 add_function (instance, name, fntype, NULL_TREE, false, name,
4101 vNULL, required, true);
4102 obstack_free (&m_string_obstack, name);
4103 }
4104 }
4105
4106 function_call_info::function_call_info (location_t location_in,
4107 const function_instance &instance_in,
4108 tree fndecl_in)
4109 : function_instance (instance_in), location (location_in), fndecl (fndecl_in)
4110 {}
4111
4112 gimple_folder::gimple_folder (const function_instance &instance, tree fndecl,
4113 gimple_stmt_iterator *gsi_in, gcall *call_in)
4114 : function_call_info (gimple_location (call_in), instance, fndecl),
4115 gsi (gsi_in), call (call_in), lhs (gimple_call_lhs (call_in))
4116 {
4117 }
4118
4119 /* Try to fold the call. Return the new statement on success and null
4120 on failure. */
4121 gimple *
4122 gimple_folder::fold ()
4123 {
4124 /* Don't fold anything when RVV is disabled; emit an error during
4125 expansion instead. */
4126 if (!TARGET_VECTOR)
4127 return NULL;
4128
4129 /* Punt if the function has a return type and no result location is
4130 provided. The attributes should allow target-independent code to
4131 remove the calls if appropriate. */
4132 if (!lhs && TREE_TYPE (gimple_call_fntype (call)) != void_type_node)
4133 return NULL;
4134
4135 return base->fold (*this);
4136 }
4137
4138 function_expander::function_expander (const function_instance &instance,
4139 tree fndecl_in, tree exp_in,
4140 rtx target_in)
4141 : function_call_info (EXPR_LOCATION (exp_in), instance, fndecl_in),
4142 exp (exp_in), target (target_in), opno (0)
4143 {
4144 if (!function_returns_void_p ())
4145 {
4146 if (target != NULL_RTX && MEM_P (target))
4147 /* Since there is no intrinsic where target is a mem operand, it
4148 should be converted to reg if it is a mem operand. */
4149 target = force_reg (GET_MODE (target), target);
4150 create_output_operand (&m_ops[opno++], target,
4151 TYPE_MODE (TREE_TYPE (exp)));
4152 }
4153 }
4154
4155 /* Take argument ARGNO from EXP's argument list and convert it into
4156 an expand operand. Store the operand in *M_OPS. */
4157 void
4158 function_expander::add_input_operand (unsigned argno)
4159 {
4160 tree arg = CALL_EXPR_ARG (exp, argno);
4161 rtx x = expand_normal (arg);
4162 add_input_operand (TYPE_MODE (TREE_TYPE (arg)), x);
4163 }
4164
4165 /* Since we may normalize vop/vop_tu/vop_m/vop_tumu.. into a single patter.
4166 We add a undef for the intrinsics that don't need a real merge. */
4167 void
4168 function_expander::add_vundef_operand (machine_mode mode)
4169 {
4170 add_input_operand (mode, RVV_VUNDEF (mode));
4171 }
4172
4173 /* Add a memory operand with mode MODE and address ADDR. */
4174 void
4175 function_expander::add_mem_operand (machine_mode mode, unsigned argno)
4176 {
4177 gcc_assert (VECTOR_MODE_P (mode));
4178 rtx addr = expand_normal (CALL_EXPR_ARG (exp, argno));
4179 rtx mem = gen_rtx_MEM (mode, memory_address (mode, addr));
4180 /* The memory is only guaranteed to be element-aligned. */
4181 set_mem_align (mem, GET_MODE_ALIGNMENT (GET_MODE_INNER (mode)));
4182 add_fixed_operand (mem);
4183 }
4184
4185 /* Return the machine_mode of the corresponding mask type. */
4186 machine_mode
4187 function_expander::mask_mode (void) const
4188 {
4189 vector_type_index mask_type_index
4190 = function_types[type.index].type_indexes[RVV_BASE_mask];
4191 return TYPE_MODE (builtin_types[mask_type_index].vector);
4192 }
4193
4194 /* Implement the call using instruction ICODE, with a 1:1 mapping between
4195 arguments and input operands. */
4196 rtx
4197 function_expander::use_exact_insn (insn_code icode)
4198 {
4199 machine_mode mode = TYPE_MODE (TREE_TYPE (exp));
4200
4201 /* Record the offset to get the argument. */
4202 int arg_offset = 0;
4203
4204 if (base->use_mask_predication_p ())
4205 {
4206 if (use_real_mask_p (pred))
4207 add_input_operand (arg_offset++);
4208 else
4209 add_all_one_mask_operand (mask_mode ());
4210 }
4211
4212 /* Store operation doesn't have merge operand. */
4213 if (!function_returns_void_p () && base->has_merge_operand_p ())
4214 {
4215 if (use_real_merge_p (pred))
4216 add_input_operand (arg_offset++);
4217 else
4218 add_vundef_operand (mode);
4219 }
4220
4221 for (int argno = arg_offset; argno < call_expr_nargs (exp); argno++)
4222 {
4223 if (base->has_rounding_mode_operand_p ()
4224 && argno == call_expr_nargs (exp) - 2)
4225 {
4226 /* Since the rounding mode argument position is not consistent with
4227 the instruction pattern, we need to skip rounding mode argument
4228 here. */
4229 continue;
4230 }
4231 add_input_operand (argno);
4232 }
4233
4234 if (base->apply_tail_policy_p ())
4235 add_input_operand (Pmode, get_tail_policy_for_pred (pred));
4236 if (base->apply_mask_policy_p ())
4237 add_input_operand (Pmode, get_mask_policy_for_pred (pred));
4238
4239 if (base->apply_vl_p ())
4240 add_input_operand (Pmode, get_avl_type_rtx (avl_type::NONVLMAX));
4241
4242 if (base->has_rounding_mode_operand_p ())
4243 add_input_operand (call_expr_nargs (exp) - 2);
4244
4245 /* The RVV floating-point only support dynamic rounding mode in the
4246 FRM register. */
4247 if (base->may_require_frm_p ()
4248 && opno < insn_data[icode].n_generator_args)
4249 add_input_operand (Pmode, gen_int_mode (riscv_vector::FRM_DYN, Pmode));
4250
4251 return generate_insn (icode);
4252 }
4253
4254 int
4255 function_expander::prepare_contiguous_load_insn ()
4256 {
4257 gcc_assert (call_expr_nargs (exp) > 0);
4258 machine_mode mode = TYPE_MODE (TREE_TYPE (exp));
4259
4260 /* Record the offset to get the argument. */
4261 int arg_offset = 0;
4262
4263 if (use_real_mask_p (pred))
4264 add_input_operand (arg_offset++);
4265 else
4266 add_all_one_mask_operand (mask_mode ());
4267
4268 if (use_real_merge_p (pred))
4269 add_input_operand (arg_offset++);
4270 else
4271 add_vundef_operand (mode);
4272
4273 add_mem_operand (mode, arg_offset++);
4274 return arg_offset;
4275 }
4276
4277 /* Use contiguous load INSN. */
4278 rtx
4279 function_expander::use_contiguous_load_insn (insn_code icode)
4280 {
4281 int arg_offset = prepare_contiguous_load_insn ();
4282
4283 for (int argno = arg_offset; argno < call_expr_nargs (exp); argno++)
4284 add_input_operand (argno);
4285
4286 machine_mode mode = TYPE_MODE (TREE_TYPE (exp));
4287 if (GET_MODE_CLASS (mode) != MODE_VECTOR_BOOL)
4288 {
4289 add_input_operand (Pmode, get_tail_policy_for_pred (pred));
4290 add_input_operand (Pmode, get_mask_policy_for_pred (pred));
4291 }
4292
4293 if (opno != insn_data[icode].n_generator_args)
4294 add_input_operand (Pmode, get_avl_type_rtx (avl_type::NONVLMAX));
4295 return generate_insn (icode);
4296 }
4297
4298 /* Similar to use_contiguous_load_insn but skips the vector-length destination
4299 operand that a fault-only-first load intrinsic has. Then we add tail and
4300 mask policy as well as AVL operand. Last, add the vector-length destination
4301 operand that we skipped initially. */
4302 rtx
4303 function_expander::use_fof_load_insn ()
4304 {
4305 int arg_offset = prepare_contiguous_load_insn ();
4306
4307 int vl_dest_arg = call_expr_nargs (exp) - 2;
4308 for (int argno = arg_offset; argno < call_expr_nargs (exp); argno++)
4309 {
4310 /* Skip argument for VL destination in memory but add the others. */
4311 if (argno != vl_dest_arg)
4312 add_input_operand (argno);
4313 }
4314
4315 machine_mode mode = TYPE_MODE (TREE_TYPE (exp));
4316 if (GET_MODE_CLASS (mode) != MODE_VECTOR_BOOL)
4317 {
4318 add_input_operand (Pmode, get_tail_policy_for_pred (pred));
4319 add_input_operand (Pmode, get_mask_policy_for_pred (pred));
4320 }
4321
4322 add_input_operand (Pmode, get_avl_type_rtx (avl_type::NONVLMAX));
4323
4324 tree arg = CALL_EXPR_ARG (exp, vl_dest_arg);
4325
4326 /* Use a regular FoF load if the user does not want to store VL. */
4327 if (integer_zerop (arg))
4328 {
4329 insn_code icode = code_for_pred_fault_load (mode);
4330 return generate_insn (icode);
4331 }
4332
4333 /* The VL-setting FoF load writes the new VL to VL_REG.
4334 Store it to memory. */
4335 rtx vl_reg = gen_reg_rtx (Pmode);
4336 add_output_operand (Pmode, vl_reg);
4337 insn_code icode = code_for_pred_fault_load_set_vl (mode, Pmode);
4338 rtx res = generate_insn (icode);
4339
4340 rtx addr = expand_normal (arg);
4341 rtx mem = gen_rtx_MEM (Pmode, memory_address (Pmode, addr));
4342 emit_move_insn (mem, vl_reg);
4343
4344 return res;
4345 }
4346
4347 /* Use contiguous store INSN. */
4348 rtx
4349 function_expander::use_contiguous_store_insn (insn_code icode)
4350 {
4351 gcc_assert (call_expr_nargs (exp) > 0);
4352 machine_mode mode = TYPE_MODE (builtin_types[type.index].vector);
4353
4354 /* Record the offset to get the argument. */
4355 int arg_offset = 0;
4356
4357 add_mem_operand (mode, use_real_mask_p (pred) ? 1 : 0);
4358
4359 if (use_real_mask_p (pred))
4360 add_input_operand (arg_offset++);
4361 else
4362 add_all_one_mask_operand (mask_mode ());
4363
4364 arg_offset++;
4365 for (int argno = arg_offset; argno < call_expr_nargs (exp); argno++)
4366 add_input_operand (argno);
4367
4368 add_input_operand (Pmode, get_avl_type_rtx (avl_type::NONVLMAX));
4369 return generate_insn (icode);
4370 }
4371
4372 /* Implement the call using instruction ICODE, with a 1:1 mapping between
4373 arguments and input operands. */
4374 rtx
4375 function_expander::use_compare_insn (rtx_code rcode, insn_code icode)
4376 {
4377 machine_mode mode = TYPE_MODE (builtin_types[type.index].vector);
4378 machine_mode mask_mode = TYPE_MODE (TREE_TYPE (exp));
4379
4380 /* Record the offset to get the argument. */
4381 int arg_offset = 0;
4382
4383 if (use_real_mask_p (pred))
4384 add_input_operand (arg_offset++);
4385 else
4386 add_all_one_mask_operand (mask_mode);
4387
4388 if (use_real_merge_p (pred))
4389 add_input_operand (arg_offset++);
4390 else
4391 add_vundef_operand (mask_mode);
4392
4393 rtx op1 = expand_normal (CALL_EXPR_ARG (exp, arg_offset++));
4394 rtx op2 = expand_normal (CALL_EXPR_ARG (exp, arg_offset++));
4395 if (!insn_operand_matches (icode, opno + 1, op1))
4396 op1 = force_reg (mode, op1);
4397 if (!insn_operand_matches (icode, opno + 2, op2))
4398 {
4399 if (VECTOR_MODE_P (GET_MODE (op2)))
4400 op2 = force_reg (mode, op2);
4401 else
4402 op2 = force_reg (GET_MODE_INNER (mode), op2);
4403 }
4404 rtx comparison = gen_rtx_fmt_ee (rcode, mask_mode, op1, op2);
4405 if (!VECTOR_MODE_P (GET_MODE (op2)))
4406 comparison = gen_rtx_fmt_ee (rcode, mask_mode, op1,
4407 gen_rtx_VEC_DUPLICATE (mode, op2));
4408 add_fixed_operand (comparison);
4409 add_fixed_operand (op1);
4410 if (CONST_INT_P (op2))
4411 add_integer_operand (op2);
4412 else
4413 add_fixed_operand (op2);
4414 for (int argno = arg_offset; argno < call_expr_nargs (exp); argno++)
4415 add_input_operand (argno);
4416
4417 add_input_operand (Pmode, get_mask_policy_for_pred (pred));
4418 add_input_operand (Pmode, get_avl_type_rtx (avl_type::NONVLMAX));
4419 return generate_insn (icode);
4420 }
4421
4422 /* Implement the call using instruction ICODE, with a 1:1 mapping between
4423 arguments and input operands. */
4424 rtx
4425 function_expander::use_ternop_insn (bool vd_accum_p, insn_code icode)
4426 {
4427 machine_mode mode = TYPE_MODE (builtin_types[type.index].vector);
4428
4429 /* Record the offset to get the argument. */
4430 int arg_offset = 0;
4431
4432 if (use_real_mask_p (pred))
4433 add_input_operand (arg_offset++);
4434 else
4435 add_all_one_mask_operand (mask_mode ());
4436
4437 rtx vd = expand_normal (CALL_EXPR_ARG (exp, arg_offset++));
4438 rtx vs1 = expand_normal (CALL_EXPR_ARG (exp, arg_offset++));
4439 rtx vs2 = expand_normal (CALL_EXPR_ARG (exp, arg_offset++));
4440
4441 if (VECTOR_MODE_P (GET_MODE (vs1)))
4442 {
4443 if (!vd_accum_p)
4444 add_input_operand (mode, vd);
4445 add_input_operand (mode, vs1);
4446 add_input_operand (mode, vs2);
4447 if (vd_accum_p)
4448 add_input_operand (mode, vd);
4449 add_input_operand (mode, vd);
4450 }
4451 else
4452 {
4453 add_input_operand (GET_MODE_INNER (mode), vs1);
4454 if (vd_accum_p)
4455 {
4456 add_input_operand (mode, vs2);
4457 add_input_operand (mode, vd);
4458 }
4459 else
4460 {
4461 add_input_operand (mode, vd);
4462 add_input_operand (mode, vs2);
4463 }
4464 add_input_operand (mode, vd);
4465 }
4466
4467 for (int argno = arg_offset; argno < call_expr_nargs (exp); argno++)
4468 {
4469 if (base->has_rounding_mode_operand_p ()
4470 && argno == call_expr_nargs (exp) - 2)
4471 {
4472 /* Since the rounding mode argument position is not consistent with
4473 the instruction pattern, we need to skip rounding mode argument
4474 here. */
4475 continue;
4476 }
4477 add_input_operand (argno);
4478 }
4479
4480 add_input_operand (Pmode, get_tail_policy_for_pred (pred));
4481 add_input_operand (Pmode, get_mask_policy_for_pred (pred));
4482 add_input_operand (Pmode, get_avl_type_rtx (avl_type::NONVLMAX));
4483
4484 if (base->has_rounding_mode_operand_p ())
4485 add_input_operand (call_expr_nargs (exp) - 2);
4486
4487 /* The RVV floating-point only support dynamic rounding mode in the
4488 FRM register. */
4489 if (base->may_require_frm_p ()
4490 && opno < insn_data[icode].n_generator_args)
4491 add_input_operand (Pmode, gen_int_mode (riscv_vector::FRM_DYN, Pmode));
4492
4493 return generate_insn (icode);
4494 }
4495
4496 /* Implement the call using instruction ICODE, with a 1:1 mapping between
4497 arguments and input operands. */
4498 rtx
4499 function_expander::use_widen_ternop_insn (insn_code icode)
4500 {
4501 /* Record the offset to get the argument. */
4502 int arg_offset = 0;
4503
4504 if (use_real_mask_p (pred))
4505 add_input_operand (arg_offset++);
4506 else
4507 add_all_one_mask_operand (mask_mode ());
4508
4509 for (int argno = arg_offset; argno < call_expr_nargs (exp); argno++)
4510 {
4511 if (base->has_rounding_mode_operand_p ()
4512 && argno == call_expr_nargs (exp) - 2)
4513 {
4514 /* Since the rounding mode argument position is not consistent with
4515 the instruction pattern, we need to skip rounding mode argument
4516 here. */
4517 continue;
4518 }
4519 add_input_operand (argno);
4520 }
4521
4522 add_input_operand (Pmode, get_tail_policy_for_pred (pred));
4523 add_input_operand (Pmode, get_mask_policy_for_pred (pred));
4524 add_input_operand (Pmode, get_avl_type_rtx (avl_type::NONVLMAX));
4525
4526 if (base->has_rounding_mode_operand_p ())
4527 add_input_operand (call_expr_nargs (exp) - 2);
4528
4529 /* The RVV floating-point only support dynamic rounding mode in the
4530 FRM register. */
4531 if (base->may_require_frm_p ()
4532 && opno < insn_data[icode].n_generator_args)
4533 add_input_operand (Pmode, gen_int_mode (riscv_vector::FRM_DYN, Pmode));
4534
4535 return generate_insn (icode);
4536 }
4537
4538 /* Implement the call using instruction ICODE, with a 1:1 mapping between
4539 arguments and input operands. */
4540 rtx
4541 function_expander::use_scalar_move_insn (insn_code icode)
4542 {
4543 machine_mode mode = TYPE_MODE (TREE_TYPE (exp));
4544
4545 /* Record the offset to get the argument. */
4546 int arg_offset = 0;
4547 add_scalar_move_mask_operand (mask_mode ());
4548
4549 if (use_real_merge_p (pred))
4550 add_input_operand (arg_offset++);
4551 else
4552 add_vundef_operand (mode);
4553
4554 for (int argno = arg_offset; argno < call_expr_nargs (exp); argno++)
4555 add_input_operand (argno);
4556
4557 add_input_operand (Pmode, get_tail_policy_for_pred (pred));
4558 add_input_operand (Pmode, get_mask_policy_for_pred (pred));
4559 add_input_operand (Pmode, get_avl_type_rtx (avl_type::NONVLMAX));
4560 return generate_insn (icode);
4561 }
4562
4563 /* Generate instruction ICODE, given that its operands have already
4564 been added to M_OPS. Return the value of the first operand. */
4565 rtx
4566 function_expander::generate_insn (insn_code icode)
4567 {
4568 gcc_assert (opno == insn_data[icode].n_generator_args);
4569 if (!maybe_expand_insn (icode, opno, m_ops))
4570 {
4571 error ("invalid argument to built-in function");
4572 return NULL_RTX;
4573 }
4574 return function_returns_void_p () ? const0_rtx : m_ops[0].value;
4575 }
4576
4577 function_checker::function_checker (location_t location,
4578 const function_instance &instance,
4579 tree fndecl, tree fntype,
4580 unsigned int nargs, tree *args)
4581 : function_call_info (location, instance, fndecl), m_fntype (fntype),
4582 m_nargs (nargs), m_args (args)
4583 {}
4584
4585 /* Report that LOCATION has a call to FNDECL in which argument ARGNO
4586 was not an integer constant expression. ARGNO counts from zero. */
4587 void
4588 function_checker::report_non_ice (unsigned int argno) const
4589 {
4590 error_at (location,
4591 "argument %d of %qE must be an integer constant"
4592 " expression",
4593 argno + 1, fndecl);
4594 }
4595
4596 /* Report that LOCATION has a call to FNDECL in which argument ARGNO has
4597 the value ACTUAL, whereas the function requires a value in the range
4598 [MIN, MAX]. ARGNO counts from zero. */
4599 void
4600 function_checker::report_out_of_range (unsigned int argno, HOST_WIDE_INT actual,
4601 HOST_WIDE_INT min,
4602 HOST_WIDE_INT max) const
4603 {
4604 error_at (location,
4605 "passing %wd to argument %d of %qE, which expects"
4606 " a value in the range [%wd, %wd]",
4607 actual, argno + 1, fndecl, min, max);
4608 }
4609
4610 /* Report that LOCATION has a call to FNDECL in which argument ARGNO has
4611 the value ACTUAL, whereas the function requires a value in the range
4612 [MIN, MAX] or OR_VAL. ARGNO counts from zero. */
4613 void
4614 function_checker::report_out_of_range_and_not (unsigned int argno,
4615 HOST_WIDE_INT actual,
4616 HOST_WIDE_INT min,
4617 HOST_WIDE_INT max,
4618 HOST_WIDE_INT or_val) const
4619 {
4620 error_at (location,
4621 "passing %wd to argument %d of %qE, which expects"
4622 " a value in the range [%wd, %wd] or %wd",
4623 actual, argno + 1, fndecl, min, max, or_val);
4624 }
4625
4626
4627 /* Check that argument ARGNO is an integer constant expression and
4628 store its value in VALUE_OUT if so. The caller should first
4629 check that argument ARGNO exists. */
4630 bool
4631 function_checker::require_immediate (unsigned int argno, HOST_WIDE_INT min,
4632 HOST_WIDE_INT max) const
4633 {
4634 gcc_assert (argno < m_nargs);
4635 tree arg = m_args[argno];
4636
4637 /* The type and range are unsigned, so read the argument as an
4638 unsigned rather than signed HWI. */
4639 if (!tree_fits_uhwi_p (arg))
4640 {
4641 report_non_ice (argno);
4642 return false;
4643 }
4644 return require_immediate_range (argno, min, max);
4645 }
4646
4647 /* Check that argument REL_ARGNO is an integer constant expression in the
4648 range [MIN, MAX]. REL_ARGNO counts from the end of the predication
4649 arguments. */
4650 bool
4651 function_checker::require_immediate_range (unsigned int argno,
4652 HOST_WIDE_INT min,
4653 HOST_WIDE_INT max) const
4654 {
4655 gcc_assert (argno < m_nargs);
4656 tree arg = m_args[argno];
4657 HOST_WIDE_INT actual = tree_to_uhwi (arg);
4658
4659 if (!IN_RANGE (actual, min, max))
4660 {
4661 report_out_of_range (argno, actual, min, max);
4662 return false;
4663 }
4664
4665 return true;
4666 }
4667
4668 /* Check that argument REL_ARGNO is an integer constant expression in the
4669 range [MIN, MAX] or OR_VAL. REL_ARGNO counts from the end of the
4670 predication arguments. */
4671 bool
4672 function_checker::require_immediate_range_or (unsigned int argno,
4673 HOST_WIDE_INT min,
4674 HOST_WIDE_INT max,
4675 HOST_WIDE_INT or_val) const
4676 {
4677 gcc_assert (min >= 0 && min <= max);
4678 gcc_assert (argno < m_nargs);
4679
4680 tree arg = m_args[argno];
4681 HOST_WIDE_INT actual = tree_to_uhwi (arg);
4682
4683 if (!IN_RANGE (actual, min, max) && actual != or_val)
4684 {
4685 report_out_of_range_and_not (argno, actual, min, max, or_val);
4686 return false;
4687 }
4688
4689 return true;
4690 }
4691
4692 /* Perform semantic checks on the call. Return true if the call is valid,
4693 otherwise report a suitable error. */
4694 bool
4695 function_checker::check ()
4696 {
4697 return shape->check (*this);
4698 }
4699
4700 inline hashval_t
4701 registered_function_hasher::hash (value_type value)
4702 {
4703 return value->instance.hash ();
4704 }
4705
4706 inline bool
4707 registered_function_hasher::equal (value_type value, const compare_type &key)
4708 {
4709 return value->instance == key;
4710 }
4711
4712 hashval_t
4713 registered_function::overloaded_hash () const
4714 {
4715 inchash::hash h;
4716 tree type;
4717 unsigned int unsigned_p, mode_p;
4718 h.add (overload_name, strlen (overload_name));
4719 for (unsigned int i = 0; i < argument_types.length (); i++)
4720 {
4721 type = argument_types[i];
4722 unsigned_p = POINTER_TYPE_P (type) ? TYPE_UNSIGNED (TREE_TYPE (type))
4723 : TYPE_UNSIGNED (type);
4724 mode_p = POINTER_TYPE_P (type) ? TYPE_MODE (TREE_TYPE (type))
4725 : TYPE_MODE (type);
4726 if (POINTER_TYPE_P (type) || lookup_vector_type_attribute (type))
4727 {
4728 h.add_int (unsigned_p);
4729 h.add_int (mode_p);
4730 }
4731 else if (instance.base->may_require_vxrm_p ()
4732 || instance.base->may_require_frm_p ())
4733 {
4734 h.add_int (argument_types.length ());
4735 break;
4736 }
4737 }
4738
4739 return h.end ();
4740 }
4741
4742 hashval_t
4743 registered_function::overloaded_hash (const vec<tree, va_gc> &arglist)
4744 {
4745 argument_types = vNULL;
4746 unsigned int len = arglist.length ();
4747
4748 for (unsigned int i = 0; i < len; i++)
4749 argument_types.safe_push (TREE_TYPE (arglist[i]));
4750
4751 return overloaded_hash ();
4752 }
4753
4754 inline hashval_t
4755 non_overloaded_registered_function_hasher::hash (value_type value)
4756 {
4757 return value->overloaded_hash ();
4758 }
4759
4760 inline bool
4761 non_overloaded_registered_function_hasher::equal (value_type value,
4762 const compare_type &key)
4763 {
4764 return ((strcmp (value->overload_name, key->overload_name) == 0)
4765 && value->overloaded_hash () == key->overloaded_hash ());
4766 }
4767
4768 /* If TYPE is a built-in type defined by the RVV ABI, return the mangled name,
4769 otherwise return NULL. */
4770 const char *
4771 mangle_builtin_type (const_tree type)
4772 {
4773 if (TYPE_NAME (type) && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL)
4774 type = TREE_TYPE (TYPE_NAME (type));
4775 if (tree attr = lookup_vector_type_attribute (type))
4776 if (tree id = TREE_VALUE (chain_index (0, TREE_VALUE (attr))))
4777 return IDENTIFIER_POINTER (id);
4778 return NULL;
4779 }
4780
4781 /* Return true if TYPE is a built-in RVV type defined by the ABI. */
4782 bool
4783 builtin_type_p (const_tree type)
4784 {
4785 if (!type)
4786 return false;
4787
4788 return lookup_vector_type_attribute (type);
4789 }
4790
4791 /* Initialize all compiler built-ins related to RVV that should be
4792 defined at start-up. */
4793 void
4794 init_builtins ()
4795 {
4796 if (in_lto_p)
4797 /* "pragma vector" will register type during the process. */
4798 handle_pragma_vector ();
4799 else
4800 {
4801 if (!TARGET_VECTOR)
4802 return;
4803 register_builtin_types ();
4804 }
4805 }
4806
4807 /* Implement TARGET_VERIFY_TYPE_CONTEXT for RVV types. */
4808 bool
4809 verify_type_context (location_t loc, type_context_kind context, const_tree type,
4810 bool silent_p)
4811 {
4812 const_tree tmp = type;
4813 if (omp_type_context (context) && POINTER_TYPE_P (type))
4814 tmp = strip_pointer_types (tmp);
4815
4816 if (!sizeless_type_p (tmp))
4817 return true;
4818
4819 switch (context)
4820 {
4821 case TCTX_SIZEOF:
4822 case TCTX_STATIC_STORAGE:
4823 if (!silent_p)
4824 error_at (loc, "RVV type %qT does not have a fixed size", type);
4825
4826 return false;
4827
4828 case TCTX_ALIGNOF:
4829 if (!silent_p)
4830 error_at (loc, "RVV type %qT does not have a defined alignment", type);
4831
4832 return false;
4833
4834 case TCTX_THREAD_STORAGE:
4835 if (!silent_p)
4836 error_at (loc,
4837 "variables of type %qT cannot have thread-local"
4838 " storage duration",
4839 type);
4840
4841 return false;
4842
4843 case TCTX_POINTER_ARITH:
4844 if (!silent_p)
4845 error_at (loc, "arithmetic on pointer to RVV type %qT", type);
4846
4847 return false;
4848
4849 case TCTX_FIELD:
4850 if (silent_p)
4851 ;
4852 else if (lang_GNU_CXX ())
4853 error_at (loc, "member variables cannot have RVV type %qT", type);
4854 else
4855 error_at (loc, "fields cannot have RVV type %qT", type);
4856
4857 return false;
4858
4859 case TCTX_ARRAY_ELEMENT:
4860 if (!silent_p)
4861 error_at (loc, "array elements cannot have RVV type %qT", type);
4862
4863 return false;
4864
4865 case TCTX_ALLOCATION:
4866 if (!silent_p)
4867 error_at (loc, "cannot allocate objects with RVV type %qT", type);
4868
4869 return false;
4870
4871 case TCTX_DEALLOCATION:
4872 if (!silent_p)
4873 error_at (loc, "cannot delete objects with RVV type %qT", type);
4874
4875 return false;
4876
4877 case TCTX_EXCEPTIONS:
4878 if (!silent_p)
4879 error_at (loc, "cannot throw or catch RVV type %qT", type);
4880
4881 return false;
4882
4883 case TCTX_CAPTURE_BY_COPY:
4884 if (!silent_p)
4885 error_at (loc, "capture by copy of RVV type %qT", type);
4886
4887 return false;
4888
4889 case TCTX_OMP_MAP:
4890 if (!silent_p)
4891 error_at (loc, "RVV type %qT not allowed in %<map%> clause", type);
4892 return false;
4893
4894 case TCTX_OMP_MAP_IMP_REF:
4895 if (!silent_p)
4896 error ("cannot reference %qT object types in %<target%> region", type);
4897 return false;
4898
4899 case TCTX_OMP_PRIVATE:
4900 if (!silent_p)
4901 error_at (loc, "RVV type %qT not allowed in"
4902 " %<target%> %<private%> clause", type);
4903 return false;
4904
4905 case TCTX_OMP_FIRSTPRIVATE:
4906 if (!silent_p)
4907 error_at (loc, "RVV type %qT not allowed in"
4908 " %<target%> %<firstprivate%> clause", type);
4909 return false;
4910
4911 case TCTX_OMP_DEVICE_ADDR:
4912 if (!silent_p)
4913 error_at (loc, "RVV type %qT not allowed in"
4914 " %<target%> device clauses", type);
4915 return false;
4916 }
4917
4918 gcc_unreachable ();
4919 }
4920
4921 /* Register the vxrm enum. */
4922 static void
4923 register_vxrm ()
4924 {
4925 auto_vec<string_int_pair, 4> values;
4926 #define DEF_RVV_VXRM_ENUM(NAME, VALUE) \
4927 values.quick_push (string_int_pair ("__RISCV_VXRM_" #NAME, VALUE));
4928 #include "riscv-vector-builtins.def"
4929 #undef DEF_RVV_VXRM_ENUM
4930
4931 lang_hooks.types.simulate_enum_decl (input_location, "__RISCV_VXRM", &values);
4932 }
4933
4934 /* Register the frm enum. */
4935 static void
4936 register_frm ()
4937 {
4938 auto_vec<string_int_pair, 5> values;
4939 #define DEF_RVV_FRM_ENUM(NAME, VALUE) \
4940 values.quick_push (string_int_pair ("__RISCV_FRM_" #NAME, VALUE));
4941 #include "riscv-vector-builtins.def"
4942 #undef DEF_RVV_FRM_ENUM
4943
4944 lang_hooks.types.simulate_enum_decl (input_location, "__RISCV_FRM", &values);
4945 }
4946
4947 /* Implement #pragma riscv intrinsic vector. */
4948 void
4949 handle_pragma_vector ()
4950 {
4951 if (function_table || non_overloaded_function_table)
4952 {
4953 error ("duplicate definition of %qs", "riscv_vector.h");
4954 return;
4955 }
4956 rvv_switcher rvv;
4957
4958 /* Define the vector and tuple types. */
4959 for (unsigned int type_i = 0; type_i < NUM_VECTOR_TYPES; ++type_i)
4960 register_vector_type ((enum vector_type_index) type_i);
4961
4962 /* Define the enums. */
4963 register_vxrm ();
4964 register_frm ();
4965
4966 /* Define the functions. */
4967 function_table = new hash_table<registered_function_hasher> (1023);
4968 function_builder builder;
4969 for (unsigned int i = 0; i < ARRAY_SIZE (function_groups); ++i)
4970 builder.register_function_group (function_groups[i]);
4971 }
4972
4973 /* Return the function decl with RVV function subcode CODE, or error_mark_node
4974 if no such function exists. */
4975 tree
4976 builtin_decl (unsigned int code, bool)
4977 {
4978 if (code >= vec_safe_length (registered_functions))
4979 return error_mark_node;
4980
4981 return (*registered_functions)[code]->decl;
4982 }
4983
4984 /* Attempt to fold STMT, given that it's a call to the RVV function
4985 with subcode CODE. Return the new statement on success and null
4986 on failure. Insert any other new statements at GSI. */
4987 gimple *
4988 gimple_fold_builtin (unsigned int code, gimple_stmt_iterator *gsi, gcall *stmt)
4989 {
4990 registered_function &rfn = *(*registered_functions)[code];
4991 return gimple_folder (rfn.instance, rfn.decl, gsi, stmt).fold ();
4992 }
4993
4994 static bool
4995 validate_instance_type_required_extensions (const rvv_type_info type,
4996 tree exp)
4997 {
4998 uint64_t exts = type.required_extensions;
4999
5000 if ((exts & RVV_REQUIRE_ELEN_BF_16)
5001 && !TARGET_VECTOR_ELEN_BF_16_P (riscv_vector_elen_flags))
5002 {
5003 error_at (EXPR_LOCATION (exp),
5004 "built-in function %qE requires the "
5005 "zvfbfmin or zvfbfwma ISA extension",
5006 exp);
5007 return false;
5008 }
5009
5010 if ((exts & RVV_REQUIRE_ELEN_FP_16)
5011 && !TARGET_VECTOR_ELEN_FP_16_P (riscv_vector_elen_flags))
5012 {
5013 error_at (EXPR_LOCATION (exp),
5014 "built-in function %qE requires the "
5015 "zvfhmin or zvfh ISA extension",
5016 exp);
5017 return false;
5018 }
5019
5020 if ((exts & RVV_REQUIRE_ELEN_FP_32)
5021 && !TARGET_VECTOR_ELEN_FP_32_P (riscv_vector_elen_flags))
5022 {
5023 error_at (EXPR_LOCATION (exp),
5024 "built-in function %qE requires the "
5025 "zve32f, zve64f, zve64d or v ISA extension",
5026 exp);
5027 return false;
5028 }
5029
5030 if ((exts & RVV_REQUIRE_ELEN_FP_64)
5031 && !TARGET_VECTOR_ELEN_FP_64_P (riscv_vector_elen_flags))
5032 {
5033 error_at (EXPR_LOCATION (exp),
5034 "built-in function %qE requires the zve64d or v ISA extension",
5035 exp);
5036 return false;
5037 }
5038
5039 if ((exts & RVV_REQUIRE_ELEN_64)
5040 && !TARGET_VECTOR_ELEN_64_P (riscv_vector_elen_flags))
5041 {
5042 error_at (EXPR_LOCATION (exp),
5043 "built-in function %qE requires the "
5044 "zve64x, zve64f, zve64d or v ISA extension",
5045 exp);
5046 return false;
5047 }
5048
5049 return true;
5050 }
5051
5052 /* Expand a call to the RVV function with subcode CODE. EXP is the call
5053 expression and TARGET is the preferred location for the result.
5054 Return the value of the lhs. */
5055 rtx
5056 expand_builtin (unsigned int code, tree exp, rtx target)
5057 {
5058 registered_function &rfn = *(*registered_functions)[code];
5059
5060 if (!required_extensions_specified (rfn.required))
5061 {
5062 error_at (EXPR_LOCATION (exp),
5063 "built-in function %qE requires the %qs ISA extension",
5064 exp,
5065 required_ext_to_isa_name (rfn.required));
5066 return target;
5067 }
5068
5069 if (!validate_instance_type_required_extensions (rfn.instance.type, exp))
5070 return target;
5071
5072 return function_expander (rfn.instance, rfn.decl, exp, target).expand ();
5073 }
5074
5075 /* Perform any semantic checks needed for a call to the RVV function
5076 with subcode CODE, such as testing for integer constant expressions.
5077 The call occurs at location LOCATION and has NARGS arguments,
5078 given by ARGS. FNDECL is the original function decl, before
5079 overload resolution.
5080
5081 Return true if the call is valid, otherwise report a suitable error. */
5082 bool
5083 check_builtin_call (location_t location, vec<location_t>, unsigned int code,
5084 tree fndecl, unsigned int nargs, tree *args)
5085 {
5086 const registered_function &rfn = *(*registered_functions)[code];
5087 return function_checker (location, rfn.instance, fndecl,
5088 TREE_TYPE (rfn.decl), nargs, args).check ();
5089 }
5090
5091 tree
5092 resolve_overloaded_builtin (location_t loc, unsigned int code, tree fndecl,
5093 vec<tree, va_gc> *arglist)
5094 {
5095 if (code >= vec_safe_length (registered_functions))
5096 return NULL_TREE;
5097
5098 registered_function *rfun = (*registered_functions)[code];
5099
5100 if (!rfun || !rfun->overloaded_p)
5101 return NULL_TREE;
5102
5103 /* According to the rvv intrinsic doc, we have no such overloaded function
5104 with empty args. Unfortunately, we register the empty args function as
5105 overloaded for avoiding conflict. Thus, there will actual one register
5106 function after return NULL_TREE back to the middle-end, and finally result
5107 in ICE when expanding. For example:
5108
5109 1. First we registered void __riscv_vfredmax () as the overloaded function.
5110 2. Then resolve_overloaded_builtin (this func) return NULL_TREE.
5111 3. The functions register in step 1 bypass the args check as empty args.
5112 4. Finally, fall into expand_builtin with empty args and meet ICE.
5113
5114 Here we report error when overloaded function with empty args. */
5115 if (rfun->overloaded_p && arglist->length () == 0)
5116 error_at (loc, "no matching function call to %qE with empty arguments",
5117 fndecl);
5118
5119 hashval_t hash = rfun->overloaded_hash (*arglist);
5120 registered_function *rfn
5121 = non_overloaded_function_table->find_with_hash (rfun, hash);
5122
5123 return rfn ? rfn->decl : NULL_TREE;
5124 }
5125
5126 function_instance
5127 get_read_vl_instance (void)
5128 {
5129 return function_instance ("read_vl", bases::read_vl, shapes::read_vl,
5130 none_ops[0], PRED_TYPE_none, &p_none_void_ops);
5131 }
5132
5133 tree
5134 get_read_vl_decl (void)
5135 {
5136 function_instance instance = get_read_vl_instance ();
5137 hashval_t hash = instance.hash ();
5138 registered_function *rfn = function_table->find_with_hash (instance, hash);
5139 gcc_assert (rfn);
5140 return rfn->decl;
5141 }
5142
5143 } // end namespace riscv_vector
5144
5145 inline void
5146 gt_ggc_mx (function_instance *)
5147 {}
5148
5149 inline void
5150 gt_pch_nx (function_instance *)
5151 {}
5152
5153 inline void
5154 gt_pch_nx (function_instance *, gt_pointer_operator, void *)
5155 {}
5156
5157 #include "gt-riscv-vector-builtins.h"