Add hppa*-*-hpux* to targets which do not support split DWARF
[official-gcc.git] / gcc / config / riscv / riscv-vector-builtins.cc
blob25e0b6e56deb596a9106a587a837eaa5d9eaf76e
1 /* Builtins implementation for RISC-V 'V' Extension for GNU compiler.
2 Copyright (C) 2022-2024 Free Software Foundation, Inc.
3 Contributed by Ju-Zhe Zhong (juzhe.zhong@rivai.ai), RiVAI Technologies Ltd.
5 This file is part of GCC.
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.
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.
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/>. */
21 #define IN_TARGET_CODE 1
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"
55 using namespace riscv_vector;
57 namespace riscv_vector {
59 /* Static information about each vector type. */
60 struct vector_type_info
62 /* The name of the type as declared by riscv_vector.h
63 which is recommend to use. For example: 'vint32m1_t'. */
64 const char *name;
66 /* ABI name of vector type. The type is always available
67 under this name, even when riscv_vector.h isn't included.
68 For example: '__rvv_int32m1_t'. */
69 const char *abi_name;
71 /* The C++ mangling of ABI_NAME. */
72 const char *mangled_name;
75 /* Describes a function decl. */
76 class GTY (()) registered_function
78 public:
79 function_instance GTY ((skip)) instance;
81 /* The decl itself. */
82 tree GTY ((skip)) decl;
84 /* The overload hash of non-overloaded intrinsic is determined by
85 the overload name and argument list. Adding the overload name to
86 the hash is also to address the following situations:
87 vint16mf4_t __riscv_vreinterpret_i16mf4 (vfloat16mf4_t src);
88 vuint16mf4_t __riscv_vreinterpret_u16mf4 (vfloat16mf4_t src);
89 The base, shape and argument list of the vreinterpret instance are
90 the same, only the overload name is different. Therefore, it is
91 enough to add overload_name and argument list to the hash value.*/
92 const char *overload_name;
94 /* The argument list part of the hash value. Add the unsigned/signed type
95 and machine mode of each argument to the hash value. */
96 vec<tree> GTY ((skip)) argument_types;
98 /* True if the decl represents an overloaded function that needs to be
99 resolved. */
100 bool overloaded_p;
102 /* The hash value to indicate the non-overloaded function. Generate hash value
103 based on overload_name and argument_types. */
104 hashval_t overloaded_hash () const;
106 /* Generate hash value based on the overload_name and the argument list passed
107 by the user when calling. */
108 hashval_t overloaded_hash (const vec<tree, va_gc> &);
111 /* Hash traits for registered_function. */
112 struct registered_function_hasher : nofree_ptr_hash<registered_function>
114 typedef function_instance compare_type;
116 static hashval_t hash (value_type);
117 static bool equal (value_type, const compare_type &);
120 /* Hash traits for overload registered_function. */
121 struct non_overloaded_registered_function_hasher
122 : nofree_ptr_hash<registered_function>
124 static hashval_t hash (value_type);
125 static bool equal (value_type, const compare_type &);
128 /* Static information about each RVV type. */
129 static CONSTEXPR const vector_type_info vector_types[] = {
130 #define DEF_RVV_TYPE(NAME, NCHARS, ABI_NAME, ARGS...) \
131 {#NAME, #ABI_NAME, "u" #NCHARS #ABI_NAME},
132 #define DEF_RVV_TUPLE_TYPE(NAME, NCHARS, ABI_NAME, ARGS...) \
133 {#NAME, #ABI_NAME, "u" #NCHARS #ABI_NAME},
134 #include "riscv-vector-builtins.def"
137 /* Static information about operand suffix for each RVV type. */
138 const char *const operand_suffixes[NUM_OP_TYPES] = {
139 "", /* OP_TYPE_none. */
140 #define DEF_RVV_OP_TYPE(NAME) "_" # NAME,
141 #include "riscv-vector-builtins.def"
144 /* Static information about type suffix for each RVV type. */
145 const rvv_builtin_suffixes type_suffixes[NUM_VECTOR_TYPES + 1] = {
146 #define DEF_RVV_TYPE(NAME, NCHARS, ABI_NAME, SCALAR_TYPE, VECTOR_MODE, \
147 VECTOR_SUFFIX, SCALAR_SUFFIX, VSETVL_SUFFIX) \
148 {#VECTOR_SUFFIX, #SCALAR_SUFFIX, #VSETVL_SUFFIX},
149 #define DEF_RVV_TUPLE_TYPE(NAME, NCHARS, ABI_NAME, SUBPART_TYPE, SCALAR_TYPE, \
150 NF, VECTOR_SUFFIX) \
151 {#VECTOR_SUFFIX, "", ""},
152 #include "riscv-vector-builtins.def"
155 /* Static information about predication suffix for each RVV type. */
156 const char *const predication_suffixes[NUM_PRED_TYPES] = {
157 "", /* PRED_TYPE_none. */
158 #define DEF_RVV_PRED_TYPE(NAME) "_" # NAME,
159 #include "riscv-vector-builtins.def"
162 /* A list of all signed integer will be registered for intrinsic functions. */
163 static const rvv_type_info none_ops[] = {{NUM_VECTOR_TYPES, 0}};
165 /* A list of all signed integer will be registered for intrinsic functions. */
166 static const rvv_type_info i_ops[] = {
167 #define DEF_RVV_I_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
168 #include "riscv-vector-builtins-types.def"
169 {NUM_VECTOR_TYPES, 0}};
171 /* A list of all signed integer can be widened will be registered for intrinsic
172 * functions. */
173 static const rvv_type_info wi_ops[] = {
174 #define DEF_RVV_WI_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
175 #include "riscv-vector-builtins-types.def"
176 {NUM_VECTOR_TYPES, 0}};
178 /* A list of all unsigned integer can be widened will be registered for
179 * intrinsic functions. */
180 static const rvv_type_info wu_ops[] = {
181 #define DEF_RVV_WU_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
182 #include "riscv-vector-builtins-types.def"
183 {NUM_VECTOR_TYPES, 0}};
185 /* A list of all floating-point can be widened will be registered for intrinsic
186 * functions. */
187 static const rvv_type_info wf_ops[] = {
188 #define DEF_RVV_WF_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
189 #include "riscv-vector-builtins-types.def"
190 {NUM_VECTOR_TYPES, 0}};
192 /* A list of all signed integer that SEW = 64 require full 'V' extension will be
193 registered for intrinsic functions. */
194 static const rvv_type_info full_v_i_ops[] = {
195 #define DEF_RVV_FULL_V_I_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
196 #include "riscv-vector-builtins-types.def"
197 {NUM_VECTOR_TYPES, 0}};
199 /* A list of all unsigned integer that SEW = 64 require full 'V' extension will
200 be registered for intrinsic functions. */
201 static const rvv_type_info full_v_u_ops[] = {
202 #define DEF_RVV_FULL_V_U_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
203 #include "riscv-vector-builtins-types.def"
204 {NUM_VECTOR_TYPES, 0}};
206 /* A list of all unsigned integer will be registered for intrinsic functions. */
207 static const rvv_type_info u_ops[] = {
208 #define DEF_RVV_U_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
209 #include "riscv-vector-builtins-types.def"
210 {NUM_VECTOR_TYPES, 0}};
212 /* A list of all signed integer will be registered for intrinsic functions. */
213 static const rvv_type_info convert_i_ops[] = {
214 #define DEF_RVV_CONVERT_I_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
215 #include "riscv-vector-builtins-types.def"
216 {NUM_VECTOR_TYPES, 0}};
218 /* A list of all unsigned integer will be registered for intrinsic functions. */
219 static const rvv_type_info convert_u_ops[] = {
220 #define DEF_RVV_CONVERT_U_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
221 #include "riscv-vector-builtins-types.def"
222 {NUM_VECTOR_TYPES, 0}};
224 /* A list of all signed integer will be registered for intrinsic functions. */
225 static const rvv_type_info wconvert_i_ops[] = {
226 #define DEF_RVV_WCONVERT_I_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
227 #include "riscv-vector-builtins-types.def"
228 {NUM_VECTOR_TYPES, 0}};
230 /* A list of all unsigned integer will be registered for intrinsic functions. */
231 static const rvv_type_info wconvert_u_ops[] = {
232 #define DEF_RVV_WCONVERT_U_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
233 #include "riscv-vector-builtins-types.def"
234 {NUM_VECTOR_TYPES, 0}};
236 /* A list of all floating-point will be registered for intrinsic functions. */
237 static const rvv_type_info wconvert_f_ops[] = {
238 #define DEF_RVV_WCONVERT_F_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
239 #include "riscv-vector-builtins-types.def"
240 {NUM_VECTOR_TYPES, 0}};
242 /* A list of all integer will be registered for intrinsic functions. */
243 static const rvv_type_info iu_ops[] = {
244 #define DEF_RVV_I_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
245 #define DEF_RVV_U_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
246 #include "riscv-vector-builtins-types.def"
247 {NUM_VECTOR_TYPES, 0}};
249 /* A list of all types will be registered for intrinsic functions. */
250 static const rvv_type_info all_ops[] = {
251 #define DEF_RVV_I_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
252 #define DEF_RVV_U_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
253 #define DEF_RVV_F_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
254 #include "riscv-vector-builtins-types.def"
255 {NUM_VECTOR_TYPES, 0}};
257 /* A list of all types will be registered for intrinsic functions. */
258 static const rvv_type_info ei16_ops[] = {
259 #define DEF_RVV_EI16_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
260 #include "riscv-vector-builtins-types.def"
261 {NUM_VECTOR_TYPES, 0}};
263 /* A list of all bool will be registered for intrinsic functions. */
264 static const rvv_type_info b_ops[] = {
265 #define DEF_RVV_B_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
266 #include "riscv-vector-builtins-types.def"
267 {NUM_VECTOR_TYPES, 0}};
269 /* A list of all float will be registered for intrinsic functions. */
270 static const rvv_type_info f_ops[] = {
271 #define DEF_RVV_F_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
272 #include "riscv-vector-builtins-types.def"
273 {NUM_VECTOR_TYPES, 0}};
275 /* A list of Double-Widening signed integer will be registered for intrinsic
276 * functions. */
277 static const rvv_type_info wexti_ops[] = {
278 #define DEF_RVV_WEXTI_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
279 #include "riscv-vector-builtins-types.def"
280 {NUM_VECTOR_TYPES, 0}};
282 /* A list of Double-Widening float will be registered for intrinsic functions.
284 static const rvv_type_info wextf_ops[] = {
285 #define DEF_RVV_WEXTF_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
286 #include "riscv-vector-builtins-types.def"
287 {NUM_VECTOR_TYPES, 0}};
289 /* A list of Quad-Widening signed integer will be registered for intrinsic
290 * functions. */
291 static const rvv_type_info qexti_ops[] = {
292 #define DEF_RVV_QEXTI_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
293 #include "riscv-vector-builtins-types.def"
294 {NUM_VECTOR_TYPES, 0}};
296 /* A list of Oct-Widening signed integer will be registered for intrinsic
297 * functions. */
298 static const rvv_type_info oexti_ops[] = {
299 #define DEF_RVV_OEXTI_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
300 #include "riscv-vector-builtins-types.def"
301 {NUM_VECTOR_TYPES, 0}};
303 /* A list of Double-Widening unsigned integer will be registered for intrinsic
304 * functions. */
305 static const rvv_type_info wextu_ops[] = {
306 #define DEF_RVV_WEXTU_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
307 #include "riscv-vector-builtins-types.def"
308 {NUM_VECTOR_TYPES, 0}};
310 /* A list of Double-Widening all integer will be registered for intrinsic
311 * functions. */
312 static const rvv_type_info wextiu_ops[] = {
313 #define DEF_RVV_WEXTI_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
314 #define DEF_RVV_WEXTU_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
315 #include "riscv-vector-builtins-types.def"
316 {NUM_VECTOR_TYPES, 0}};
318 /* A list of Quad-Widening unsigned integer will be registered for intrinsic
319 * functions. */
320 static const rvv_type_info qextu_ops[] = {
321 #define DEF_RVV_QEXTU_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
322 #include "riscv-vector-builtins-types.def"
323 {NUM_VECTOR_TYPES, 0}};
325 /* A list of Oct-Widening unsigned integer will be registered for intrinsic
326 * functions. */
327 static const rvv_type_info oextu_ops[] = {
328 #define DEF_RVV_OEXTU_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
329 #include "riscv-vector-builtins-types.def"
330 {NUM_VECTOR_TYPES, 0}};
332 /* A list of eew8 interpret will be registered for intrinsic functions. */
333 static const rvv_type_info eew8_interpret_ops[] = {
334 #define DEF_RVV_EEW8_INTERPRET_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
335 #include "riscv-vector-builtins-types.def"
336 {NUM_VECTOR_TYPES, 0}};
338 /* A list of eew16 interpret will be registered for intrinsic functions. */
339 static const rvv_type_info eew16_interpret_ops[] = {
340 #define DEF_RVV_EEW16_INTERPRET_OPS(TYPE, REQUIRE) \
341 {VECTOR_TYPE_##TYPE, REQUIRE},
342 #include "riscv-vector-builtins-types.def"
343 {NUM_VECTOR_TYPES, 0}};
345 /* A list of eew32 interpret will be registered for intrinsic functions. */
346 static const rvv_type_info eew32_interpret_ops[] = {
347 #define DEF_RVV_EEW32_INTERPRET_OPS(TYPE, REQUIRE) \
348 {VECTOR_TYPE_##TYPE, REQUIRE},
349 #include "riscv-vector-builtins-types.def"
350 {NUM_VECTOR_TYPES, 0}};
352 /* A list of eew64 interpret will be registered for intrinsic functions. */
353 static const rvv_type_info eew64_interpret_ops[] = {
354 #define DEF_RVV_EEW64_INTERPRET_OPS(TYPE, REQUIRE) \
355 {VECTOR_TYPE_##TYPE, REQUIRE},
356 #include "riscv-vector-builtins-types.def"
357 {NUM_VECTOR_TYPES, 0}};
359 /* A list of bool1 interpret will be registered for intrinsic functions. */
360 static const rvv_type_info bool1_interpret_ops[] = {
361 #define DEF_RVV_BOOL1_INTERPRET_OPS(TYPE, REQUIRE) \
362 {VECTOR_TYPE_##TYPE, REQUIRE},
363 #include "riscv-vector-builtins-types.def"
364 {NUM_VECTOR_TYPES, 0}};
366 /* A list of bool2 interpret will be registered for intrinsic functions. */
367 static const rvv_type_info bool2_interpret_ops[] = {
368 #define DEF_RVV_BOOL2_INTERPRET_OPS(TYPE, REQUIRE) \
369 {VECTOR_TYPE_##TYPE, REQUIRE},
370 #include "riscv-vector-builtins-types.def"
371 {NUM_VECTOR_TYPES, 0}};
373 /* A list of bool4 interpret will be registered for intrinsic functions. */
374 static const rvv_type_info bool4_interpret_ops[] = {
375 #define DEF_RVV_BOOL4_INTERPRET_OPS(TYPE, REQUIRE) \
376 {VECTOR_TYPE_##TYPE, REQUIRE},
377 #include "riscv-vector-builtins-types.def"
378 {NUM_VECTOR_TYPES, 0}};
380 /* A list of bool8 interpret will be registered for intrinsic functions. */
381 static const rvv_type_info bool8_interpret_ops[] = {
382 #define DEF_RVV_BOOL8_INTERPRET_OPS(TYPE, REQUIRE) \
383 {VECTOR_TYPE_##TYPE, REQUIRE},
384 #include "riscv-vector-builtins-types.def"
385 {NUM_VECTOR_TYPES, 0}};
387 /* A list of bool16 interpret will be registered for intrinsic functions. */
388 static const rvv_type_info bool16_interpret_ops[] = {
389 #define DEF_RVV_BOOL16_INTERPRET_OPS(TYPE, REQUIRE) \
390 {VECTOR_TYPE_##TYPE, REQUIRE},
391 #include "riscv-vector-builtins-types.def"
392 {NUM_VECTOR_TYPES, 0}};
394 /* A list of bool32 interpret will be registered for intrinsic functions. */
395 static const rvv_type_info bool32_interpret_ops[] = {
396 #define DEF_RVV_BOOL32_INTERPRET_OPS(TYPE, REQUIRE) \
397 {VECTOR_TYPE_##TYPE, REQUIRE},
398 #include "riscv-vector-builtins-types.def"
399 {NUM_VECTOR_TYPES, 0}};
401 /* A list of bool64 interpret will be registered for intrinsic functions. */
402 static const rvv_type_info bool64_interpret_ops[] = {
403 #define DEF_RVV_BOOL64_INTERPRET_OPS(TYPE, REQUIRE) \
404 {VECTOR_TYPE_##TYPE, REQUIRE},
405 #include "riscv-vector-builtins-types.def"
406 {NUM_VECTOR_TYPES, 0}};
408 /* A list of vint8m1 interpret will be registered for intrinsic functions. */
409 static const rvv_type_info signed_eew8_lmul1_interpret_ops[] = {
410 #define DEF_RVV_SIGNED_EEW8_LMUL1_INTERPRET_OPS(TYPE, REQUIRE) \
411 {VECTOR_TYPE_##TYPE, REQUIRE},
412 #include "riscv-vector-builtins-types.def"
413 {NUM_VECTOR_TYPES, 0}};
415 /* A list of vint16m1 interpret will be registered for intrinsic functions. */
416 static const rvv_type_info signed_eew16_lmul1_interpret_ops[] = {
417 #define DEF_RVV_SIGNED_EEW16_LMUL1_INTERPRET_OPS(TYPE, REQUIRE) \
418 {VECTOR_TYPE_##TYPE, REQUIRE},
419 #include "riscv-vector-builtins-types.def"
420 {NUM_VECTOR_TYPES, 0}};
422 /* A list of vint32m1 interpret will be registered for intrinsic functions. */
423 static const rvv_type_info signed_eew32_lmul1_interpret_ops[] = {
424 #define DEF_RVV_SIGNED_EEW32_LMUL1_INTERPRET_OPS(TYPE, REQUIRE) \
425 {VECTOR_TYPE_##TYPE, REQUIRE},
426 #include "riscv-vector-builtins-types.def"
427 {NUM_VECTOR_TYPES, 0}};
429 /* A list of vint64m1 interpret will be registered for intrinsic functions. */
430 static const rvv_type_info signed_eew64_lmul1_interpret_ops[] = {
431 #define DEF_RVV_SIGNED_EEW64_LMUL1_INTERPRET_OPS(TYPE, REQUIRE) \
432 {VECTOR_TYPE_##TYPE, REQUIRE},
433 #include "riscv-vector-builtins-types.def"
434 {NUM_VECTOR_TYPES, 0}};
436 /* A list of vuint8m1 interpret will be registered for intrinsic functions. */
437 static const rvv_type_info unsigned_eew8_lmul1_interpret_ops[] = {
438 #define DEF_RVV_UNSIGNED_EEW8_LMUL1_INTERPRET_OPS(TYPE, REQUIRE) \
439 {VECTOR_TYPE_##TYPE, REQUIRE},
440 #include "riscv-vector-builtins-types.def"
441 {NUM_VECTOR_TYPES, 0}};
443 /* A list of vuint16m1 interpret will be registered for intrinsic functions. */
444 static const rvv_type_info unsigned_eew16_lmul1_interpret_ops[] = {
445 #define DEF_RVV_UNSIGNED_EEW16_LMUL1_INTERPRET_OPS(TYPE, REQUIRE) \
446 {VECTOR_TYPE_##TYPE, REQUIRE},
447 #include "riscv-vector-builtins-types.def"
448 {NUM_VECTOR_TYPES, 0}};
450 /* A list of vuint32m1 interpret will be registered for intrinsic functions. */
451 static const rvv_type_info unsigned_eew32_lmul1_interpret_ops[] = {
452 #define DEF_RVV_UNSIGNED_EEW32_LMUL1_INTERPRET_OPS(TYPE, REQUIRE) \
453 {VECTOR_TYPE_##TYPE, REQUIRE},
454 #include "riscv-vector-builtins-types.def"
455 {NUM_VECTOR_TYPES, 0}};
457 /* A list of vuint64m1 interpret will be registered for intrinsic functions. */
458 static const rvv_type_info unsigned_eew64_lmul1_interpret_ops[] = {
459 #define DEF_RVV_UNSIGNED_EEW64_LMUL1_INTERPRET_OPS(TYPE, REQUIRE) \
460 {VECTOR_TYPE_##TYPE, REQUIRE},
461 #include "riscv-vector-builtins-types.def"
462 {NUM_VECTOR_TYPES, 0}};
464 /* A list of x2 vlmul ext will be registered for intrinsic functions. */
465 static const rvv_type_info vlmul_ext_x2_ops[] = {
466 #define DEF_RVV_X2_VLMUL_EXT_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
467 #include "riscv-vector-builtins-types.def"
468 {NUM_VECTOR_TYPES, 0}};
470 /* A list of x4 vlmul ext will be registered for intrinsic functions. */
471 static const rvv_type_info vlmul_ext_x4_ops[] = {
472 #define DEF_RVV_X4_VLMUL_EXT_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
473 #include "riscv-vector-builtins-types.def"
474 {NUM_VECTOR_TYPES, 0}};
476 /* A list of x8 vlmul ext will be registered for intrinsic functions. */
477 static const rvv_type_info vlmul_ext_x8_ops[] = {
478 #define DEF_RVV_X8_VLMUL_EXT_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
479 #include "riscv-vector-builtins-types.def"
480 {NUM_VECTOR_TYPES, 0}};
482 /* A list of x16 vlmul ext will be registered for intrinsic functions. */
483 static const rvv_type_info vlmul_ext_x16_ops[] = {
484 #define DEF_RVV_X16_VLMUL_EXT_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
485 #include "riscv-vector-builtins-types.def"
486 {NUM_VECTOR_TYPES, 0}};
488 /* A list of x32 vlmul ext will be registered for intrinsic functions. */
489 static const rvv_type_info vlmul_ext_x32_ops[] = {
490 #define DEF_RVV_X32_VLMUL_EXT_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
491 #include "riscv-vector-builtins-types.def"
492 {NUM_VECTOR_TYPES, 0}};
494 /* A list of x64 vlmul ext will be registered for intrinsic functions. */
495 static const rvv_type_info vlmul_ext_x64_ops[] = {
496 #define DEF_RVV_X64_VLMUL_EXT_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
497 #include "riscv-vector-builtins-types.def"
498 {NUM_VECTOR_TYPES, 0}};
500 /* A list of LMUL1 will be registered for intrinsic functions. */
501 static const rvv_type_info lmul1_ops[] = {
502 #define DEF_RVV_LMUL1_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
503 #include "riscv-vector-builtins-types.def"
504 {NUM_VECTOR_TYPES, 0}};
506 /* A list of LMUL2 will be registered for intrinsic functions. */
507 static const rvv_type_info lmul2_ops[] = {
508 #define DEF_RVV_LMUL2_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
509 #include "riscv-vector-builtins-types.def"
510 {NUM_VECTOR_TYPES, 0}};
512 /* A list of LMUL4 will be registered for intrinsic functions. */
513 static const rvv_type_info lmul4_ops[] = {
514 #define DEF_RVV_LMUL4_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
515 #include "riscv-vector-builtins-types.def"
516 {NUM_VECTOR_TYPES, 0}};
518 /* A list of Tuple types will be registered for intrinsic functions. */
519 static const rvv_type_info tuple_ops[] = {
520 #define DEF_RVV_TUPLE_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
521 #include "riscv-vector-builtins-types.def"
522 {NUM_VECTOR_TYPES, 0}};
524 /* Below types will be registered for vector-crypto intrinsic functions*/
525 /* A list of sew32 will be registered for vector-crypto intrinsic functions. */
526 static const rvv_type_info crypto_sew32_ops[] = {
527 #define DEF_RVV_CRYPTO_SEW32_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
528 #include "riscv-vector-builtins-types.def"
529 {NUM_VECTOR_TYPES, 0}};
531 /* A list of sew64 will be registered for vector-crypto intrinsic functions. */
532 static const rvv_type_info crypto_sew64_ops[] = {
533 #define DEF_RVV_CRYPTO_SEW64_OPS(TYPE, REQUIRE) {VECTOR_TYPE_##TYPE, REQUIRE},
534 #include "riscv-vector-builtins-types.def"
535 {NUM_VECTOR_TYPES, 0}};
537 static CONSTEXPR const rvv_arg_type_info rvv_arg_type_info_end
538 = rvv_arg_type_info (NUM_BASE_TYPES);
540 /* A list of args for size_t func () function. */
541 static CONSTEXPR const rvv_arg_type_info void_args[] = {rvv_arg_type_info_end};
543 /* A list of args for size_t func () function. */
544 static CONSTEXPR const rvv_arg_type_info end_args[]
545 = {rvv_arg_type_info_end};
547 /* A list of args for size_t func (size_t) function. */
548 static CONSTEXPR const rvv_arg_type_info size_args[]
549 = {rvv_arg_type_info (RVV_BASE_size), rvv_arg_type_info_end};
551 /* A list of args for vector_type func (const scalar_type *) function. */
552 static CONSTEXPR const rvv_arg_type_info scalar_const_ptr_args[]
553 = {rvv_arg_type_info (RVV_BASE_scalar_const_ptr), rvv_arg_type_info_end};
555 /* A list of args for vector_type func (const scalar_type *, size_t *) function.
557 static CONSTEXPR const rvv_arg_type_info scalar_const_ptr_size_ptr_args[]
558 = {rvv_arg_type_info (RVV_BASE_scalar_const_ptr),
559 rvv_arg_type_info (RVV_BASE_size_ptr), rvv_arg_type_info_end};
561 /* A list of args for void func (scalar_type *, vector_type) function. */
562 static CONSTEXPR const rvv_arg_type_info scalar_ptr_args[]
563 = {rvv_arg_type_info (RVV_BASE_scalar_ptr),
564 rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};
566 /* A list of args for vector_type func (const scalar_type *, ptrdiff_t)
567 * function. */
568 static CONSTEXPR const rvv_arg_type_info scalar_const_ptr_ptrdiff_args[]
569 = {rvv_arg_type_info (RVV_BASE_scalar_const_ptr),
570 rvv_arg_type_info (RVV_BASE_ptrdiff), rvv_arg_type_info_end};
572 /* A list of args for void func (scalar_type *, ptrdiff_t, vector_type)
573 * function. */
574 static CONSTEXPR const rvv_arg_type_info scalar_ptr_ptrdiff_args[]
575 = {rvv_arg_type_info (RVV_BASE_scalar_ptr),
576 rvv_arg_type_info (RVV_BASE_ptrdiff), rvv_arg_type_info (RVV_BASE_vector),
577 rvv_arg_type_info_end};
579 /* A list of args for vector_type func (const scalar_type *, eew8_index_type)
580 * function. */
581 static CONSTEXPR const rvv_arg_type_info scalar_const_ptr_eew8_index_args[]
582 = {rvv_arg_type_info (RVV_BASE_scalar_const_ptr),
583 rvv_arg_type_info (RVV_BASE_eew8_index), rvv_arg_type_info_end};
585 /* A list of args for vector_type func (const scalar_type *, eew16_index_type)
586 * function. */
587 static CONSTEXPR const rvv_arg_type_info scalar_const_ptr_eew16_index_args[]
588 = {rvv_arg_type_info (RVV_BASE_scalar_const_ptr),
589 rvv_arg_type_info (RVV_BASE_eew16_index), rvv_arg_type_info_end};
591 /* A list of args for vector_type func (const scalar_type *, eew32_index_type)
592 * function. */
593 static CONSTEXPR const rvv_arg_type_info scalar_const_ptr_eew32_index_args[]
594 = {rvv_arg_type_info (RVV_BASE_scalar_const_ptr),
595 rvv_arg_type_info (RVV_BASE_eew32_index), rvv_arg_type_info_end};
597 /* A list of args for vector_type func (const scalar_type *, eew64_index_type)
598 * function. */
599 static CONSTEXPR const rvv_arg_type_info scalar_const_ptr_eew64_index_args[]
600 = {rvv_arg_type_info (RVV_BASE_scalar_const_ptr),
601 rvv_arg_type_info (RVV_BASE_eew64_index), rvv_arg_type_info_end};
603 /* A list of args for void func (scalar_type *, eew8_index_type, vector_type)
604 * function. */
605 static CONSTEXPR const rvv_arg_type_info scalar_ptr_eew8_index_args[]
606 = {rvv_arg_type_info (RVV_BASE_scalar_ptr),
607 rvv_arg_type_info (RVV_BASE_eew8_index),
608 rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};
610 /* A list of args for void func (scalar_type *, eew16_index_type, vector_type)
611 * function. */
612 static CONSTEXPR const rvv_arg_type_info scalar_ptr_eew16_index_args[]
613 = {rvv_arg_type_info (RVV_BASE_scalar_ptr),
614 rvv_arg_type_info (RVV_BASE_eew16_index),
615 rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};
617 /* A list of args for void func (scalar_type *, eew32_index_type, vector_type)
618 * function. */
619 static CONSTEXPR const rvv_arg_type_info scalar_ptr_eew32_index_args[]
620 = {rvv_arg_type_info (RVV_BASE_scalar_ptr),
621 rvv_arg_type_info (RVV_BASE_eew32_index),
622 rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};
624 /* A list of args for void func (scalar_type *, eew64_index_type, vector_type)
625 * function. */
626 static CONSTEXPR const rvv_arg_type_info scalar_ptr_eew64_index_args[]
627 = {rvv_arg_type_info (RVV_BASE_scalar_ptr),
628 rvv_arg_type_info (RVV_BASE_eew64_index),
629 rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};
631 /* A list of args for vector_type func (vector_type, vector_type) function. */
632 static CONSTEXPR const rvv_arg_type_info vv_args[]
633 = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info (RVV_BASE_vector),
634 rvv_arg_type_info_end};
636 /* A list of args for vector_type func (vector_type, vector_type, vector_type)
637 * function. */
638 static CONSTEXPR const rvv_arg_type_info vvv_args[]
639 = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info (RVV_BASE_vector),
640 rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};
642 /* A list of args for vector_type func (vector_type, vector_type, vector_type)
643 * function. */
644 static CONSTEXPR const rvv_arg_type_info vxv_args[]
645 = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info (RVV_BASE_scalar),
646 rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};
648 /* A list of args for vector_type func (vector_type, vector_type, mask_type)
649 * function. */
650 static CONSTEXPR const rvv_arg_type_info vvm_args[]
651 = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info (RVV_BASE_vector),
652 rvv_arg_type_info (RVV_BASE_mask), rvv_arg_type_info_end};
654 /* A list of args for vector_type func (vector_type, mask_type)
655 * function. */
656 static CONSTEXPR const rvv_arg_type_info vm_args[]
657 = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info (RVV_BASE_mask),
658 rvv_arg_type_info_end};
660 /* A list of args for vector_type func (vector_type, scalar_type, mask_type)
661 * function. */
662 static CONSTEXPR const rvv_arg_type_info vxm_args[]
663 = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info (RVV_BASE_scalar),
664 rvv_arg_type_info (RVV_BASE_mask), rvv_arg_type_info_end};
666 /* A list of args for vector_type func (signed vector_type, unsigned
667 * vector_type) function. */
668 static CONSTEXPR const rvv_arg_type_info su_vv_args[]
669 = {rvv_arg_type_info (RVV_BASE_vector),
670 rvv_arg_type_info (RVV_BASE_unsigned_vector), rvv_arg_type_info_end};
672 /* A list of args for vector_type func (vector_type, scalar_type) function. */
673 static CONSTEXPR const rvv_arg_type_info vx_args[]
674 = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info (RVV_BASE_scalar),
675 rvv_arg_type_info_end};
677 /* A list of args for vector_type func (signed vector_type, unsigned
678 * scalar_type) function. */
679 static CONSTEXPR const rvv_arg_type_info su_vx_args[]
680 = {rvv_arg_type_info (RVV_BASE_vector),
681 rvv_arg_type_info (RVV_BASE_unsigned_scalar), rvv_arg_type_info_end};
683 /* A list of args for vector_type func (vector_type, shift_type) function. */
684 static CONSTEXPR const rvv_arg_type_info shift_vv_args[]
685 = {rvv_arg_type_info (RVV_BASE_vector),
686 rvv_arg_type_info (RVV_BASE_shift_vector), rvv_arg_type_info_end};
688 /* A list of args for vector_type func (vector_type, shift_type) function. */
689 static CONSTEXPR const rvv_arg_type_info gather_vv_args[]
690 = {rvv_arg_type_info (RVV_BASE_vector),
691 rvv_arg_type_info (RVV_BASE_unsigned_vector), rvv_arg_type_info_end};
693 /* A list of args for vector_type func (vector_type, shift_type) function. */
694 static CONSTEXPR const rvv_arg_type_info gatherei16_vv_args[]
695 = {rvv_arg_type_info (RVV_BASE_vector),
696 rvv_arg_type_info (RVV_BASE_eew16_index), rvv_arg_type_info_end};
698 /* A list of args for double demote type func (vector_type, shift_type)
699 * function. */
700 static CONSTEXPR const rvv_arg_type_info shift_wv_args[]
701 = {rvv_arg_type_info (RVV_BASE_vector),
702 rvv_arg_type_info (RVV_BASE_double_trunc_unsigned_vector),
703 rvv_arg_type_info_end};
705 /* A list of args for vector_type func (vector_type) function. */
706 static CONSTEXPR const rvv_arg_type_info v_args[]
707 = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};
709 /* A list of args for vector_type func (vector_type) function. */
710 static CONSTEXPR const rvv_arg_type_info v_x2_trunc_args[]
711 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), rvv_arg_type_info_end};
713 /* A list of args for vector_type func (vector_type) function. */
714 static CONSTEXPR const rvv_arg_type_info v_x4_trunc_args[]
715 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x4), rvv_arg_type_info_end};
717 /* A list of args for vector_type func (vector_type) function. */
718 static CONSTEXPR const rvv_arg_type_info v_x8_trunc_args[]
719 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x8), rvv_arg_type_info_end};
721 /* A list of args for vector_type func (vector_type) function. */
722 static CONSTEXPR const rvv_arg_type_info v_x16_trunc_args[]
723 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x16), rvv_arg_type_info_end};
725 /* A list of args for vector_type func (vector_type) function. */
726 static CONSTEXPR const rvv_arg_type_info v_x32_trunc_args[]
727 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x32), rvv_arg_type_info_end};
729 /* A list of args for vector_type func (vector_type) function. */
730 static CONSTEXPR const rvv_arg_type_info v_x64_trunc_args[]
731 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x64), rvv_arg_type_info_end};
733 /* A list of args for vector_type func (vector_type, lmul1_type) function. */
734 static CONSTEXPR const rvv_arg_type_info vs_args[]
735 = {rvv_arg_type_info (RVV_BASE_vector),
736 rvv_arg_type_info (RVV_BASE_lmul1_vector), rvv_arg_type_info_end};
738 /* A list of args for vector_type func (vector_type, widen_lmul1_type) function.
740 static CONSTEXPR const rvv_arg_type_info wvs_args[]
741 = {rvv_arg_type_info (RVV_BASE_vector),
742 rvv_arg_type_info (RVV_BASE_widen_lmul1_vector), rvv_arg_type_info_end};
744 /* A list of args for vector_type func (vector_type) function. */
745 static CONSTEXPR const rvv_arg_type_info f_v_args[]
746 = {rvv_arg_type_info (RVV_BASE_float_vector), rvv_arg_type_info_end};
748 /* A list of args for vector_type func (vector_type) function. */
749 static CONSTEXPR const rvv_arg_type_info trunc_f_v_args[]
750 = {rvv_arg_type_info (RVV_BASE_double_trunc_float_vector),
751 rvv_arg_type_info_end};
753 /* A list of args for vector_type func (vector_type) function. */
754 static CONSTEXPR const rvv_arg_type_info w_v_args[]
755 = {rvv_arg_type_info (RVV_BASE_double_trunc_vector), rvv_arg_type_info_end};
757 /* A list of args for vector_type func (vector_type) function. */
758 static CONSTEXPR const rvv_arg_type_info m_args[]
759 = {rvv_arg_type_info (RVV_BASE_mask), rvv_arg_type_info_end};
761 /* A list of args for vector_type func (scalar_type) function. */
762 static CONSTEXPR const rvv_arg_type_info x_args[]
763 = {rvv_arg_type_info (RVV_BASE_scalar), rvv_arg_type_info_end};
765 /* A list of args for vector_type func (vector_type, size) function. */
766 static CONSTEXPR const rvv_arg_type_info v_size_args[]
767 = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info (RVV_BASE_size),
768 rvv_arg_type_info_end};
770 /* A list of args for vector_type func (double demote_type, size_t) function. */
771 static CONSTEXPR const rvv_arg_type_info wv_size_args[]
772 = {rvv_arg_type_info (RVV_BASE_double_trunc_vector),
773 rvv_arg_type_info (RVV_BASE_size),rvv_arg_type_info_end};
775 /* A list of args for vector_type func (vector_type, vector_type, size)
776 * function. */
777 static CONSTEXPR const rvv_arg_type_info vv_size_args[]
778 = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info (RVV_BASE_vector),
779 rvv_arg_type_info (RVV_BASE_size), rvv_arg_type_info_end};
781 /* A list of args for vector_type func (double demote type) function. */
782 static CONSTEXPR const rvv_arg_type_info vf2_args[]
783 = {rvv_arg_type_info (RVV_BASE_double_trunc_vector), rvv_arg_type_info_end};
785 /* A list of args for vector_type func (double demote type, double demote type)
786 * function. */
787 static CONSTEXPR const rvv_arg_type_info wvv_args[]
788 = {rvv_arg_type_info (RVV_BASE_double_trunc_vector),
789 rvv_arg_type_info (RVV_BASE_double_trunc_vector), rvv_arg_type_info_end};
791 /* A list of args for vector_type func (vector_type, double demote type, double
792 * demote type) function. */
793 static CONSTEXPR const rvv_arg_type_info wwvv_args[]
794 = {rvv_arg_type_info (RVV_BASE_vector),
795 rvv_arg_type_info (RVV_BASE_double_trunc_vector),
796 rvv_arg_type_info (RVV_BASE_double_trunc_vector), rvv_arg_type_info_end};
798 /* A list of args for vector_type func (vector_type, double demote type, double
799 * demote type) function. */
800 static CONSTEXPR const rvv_arg_type_info wwxv_args[]
801 = {rvv_arg_type_info (RVV_BASE_vector),
802 rvv_arg_type_info (RVV_BASE_double_trunc_scalar),
803 rvv_arg_type_info (RVV_BASE_double_trunc_vector), rvv_arg_type_info_end};
805 /* A list of args for vector_type func (vector_type, double demote type, double
806 * demote type) function. */
807 static CONSTEXPR const rvv_arg_type_info su_wwvv_args[]
808 = {rvv_arg_type_info (RVV_BASE_vector),
809 rvv_arg_type_info (RVV_BASE_double_trunc_vector),
810 rvv_arg_type_info (RVV_BASE_double_trunc_unsigned_vector),
811 rvv_arg_type_info_end};
813 /* A list of args for vector_type func (vector_type, double demote type, double
814 * demote type) function. */
815 static CONSTEXPR const rvv_arg_type_info su_wwxv_args[]
816 = {rvv_arg_type_info (RVV_BASE_vector),
817 rvv_arg_type_info (RVV_BASE_double_trunc_scalar),
818 rvv_arg_type_info (RVV_BASE_double_trunc_unsigned_vector),
819 rvv_arg_type_info_end};
821 /* A list of args for vector_type func (vector_type, double demote type, double
822 * demote type) function. */
823 static CONSTEXPR const rvv_arg_type_info us_wwxv_args[]
824 = {rvv_arg_type_info (RVV_BASE_vector),
825 rvv_arg_type_info (RVV_BASE_double_trunc_unsigned_scalar),
826 rvv_arg_type_info (RVV_BASE_double_trunc_vector),
827 rvv_arg_type_info_end};
829 /* A list of args for vector_type func (signed double demote type,
830 * unsigneddouble demote type) function. */
831 static CONSTEXPR const rvv_arg_type_info su_wvv_args[]
832 = {rvv_arg_type_info (RVV_BASE_double_trunc_vector),
833 rvv_arg_type_info (RVV_BASE_double_trunc_unsigned_vector), rvv_arg_type_info_end};
835 /* A list of args for vector_type func (double demote type, double demote type)
836 * function. */
837 static CONSTEXPR const rvv_arg_type_info wvx_args[]
838 = {rvv_arg_type_info (RVV_BASE_double_trunc_vector),
839 rvv_arg_type_info (RVV_BASE_double_trunc_scalar), rvv_arg_type_info_end};
841 /* A list of args for vector_type func (signed double demote type, unsigned
842 * double demote type) function. */
843 static CONSTEXPR const rvv_arg_type_info su_wvx_args[]
844 = {rvv_arg_type_info (RVV_BASE_double_trunc_vector),
845 rvv_arg_type_info (RVV_BASE_double_trunc_unsigned_scalar),
846 rvv_arg_type_info_end};
848 /* A list of args for vector_type func (double demote type, double demote type)
849 * function. */
850 static CONSTEXPR const rvv_arg_type_info wwv_args[]
851 = {rvv_arg_type_info (RVV_BASE_vector),
852 rvv_arg_type_info (RVV_BASE_double_trunc_vector), rvv_arg_type_info_end};
854 /* A list of args for vector_type func (double demote type, double demote type)
855 * function. */
856 static CONSTEXPR const rvv_arg_type_info wwx_args[]
857 = {rvv_arg_type_info (RVV_BASE_vector),
858 rvv_arg_type_info (RVV_BASE_double_trunc_scalar), rvv_arg_type_info_end};
860 /* A list of args for vector_type func (quad demote type) function. */
861 static CONSTEXPR const rvv_arg_type_info vf4_args[]
862 = {rvv_arg_type_info (RVV_BASE_quad_trunc_vector), rvv_arg_type_info_end};
864 /* A list of args for vector_type func (oct demote type) function. */
865 static CONSTEXPR const rvv_arg_type_info vf8_args[]
866 = {rvv_arg_type_info (RVV_BASE_oct_trunc_vector), rvv_arg_type_info_end};
868 /* A list of args for vector_type func (double demote type) function. */
869 static CONSTEXPR const rvv_arg_type_info x_x_v_args[]
870 = {rvv_arg_type_info (RVV_BASE_double_trunc_vector), rvv_arg_type_info_end};
872 /* A list of args for vector_type func (vector_type) function. */
873 static CONSTEXPR const rvv_arg_type_info x_v_args[]
874 = {rvv_arg_type_info (RVV_BASE_signed_vector), rvv_arg_type_info_end};
876 /* A list of args for vector_type func (vector_type) function. */
877 static CONSTEXPR const rvv_arg_type_info xu_v_args[]
878 = {rvv_arg_type_info (RVV_BASE_unsigned_vector), rvv_arg_type_info_end};
880 /* A list of args for vector_type func (vector_type) function. */
881 static CONSTEXPR const rvv_arg_type_info w_x_v_args[]
882 = {rvv_arg_type_info (RVV_BASE_double_trunc_signed_vector),
883 rvv_arg_type_info_end};
885 /* A list of args for vector_type func (vector_type) function. */
886 static CONSTEXPR const rvv_arg_type_info w_xu_v_args[]
887 = {rvv_arg_type_info (RVV_BASE_double_trunc_unsigned_vector),
888 rvv_arg_type_info_end};
890 /* A list of args for vector_type func (vector_type) function. */
891 static CONSTEXPR const rvv_arg_type_info ext_x2_vset_args[]
892 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x2),
893 rvv_arg_type_info (RVV_BASE_size), rvv_arg_type_info (RVV_BASE_vector),
894 rvv_arg_type_info_end};
896 /* A list of args for vector_type func (vector_type) function. */
897 static CONSTEXPR const rvv_arg_type_info ext_x4_vset_args[]
898 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x4),
899 rvv_arg_type_info (RVV_BASE_size), rvv_arg_type_info (RVV_BASE_vector),
900 rvv_arg_type_info_end};
902 /* A list of args for vector_type func (vector_type) function. */
903 static CONSTEXPR const rvv_arg_type_info ext_x8_vset_args[]
904 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x8),
905 rvv_arg_type_info (RVV_BASE_size), rvv_arg_type_info (RVV_BASE_vector),
906 rvv_arg_type_info_end};
908 /* A list of args for vector_type func (vector_type) function. */
909 static CONSTEXPR const rvv_arg_type_info ext_x2_vget_args[]
910 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x2),
911 rvv_arg_type_info (RVV_BASE_size), rvv_arg_type_info_end};
913 /* A list of args for vector_type func (vector_type) function. */
914 static CONSTEXPR const rvv_arg_type_info ext_x4_vget_args[]
915 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x4),
916 rvv_arg_type_info (RVV_BASE_size), rvv_arg_type_info_end};
918 /* A list of args for vector_type func (vector_type) function. */
919 static CONSTEXPR const rvv_arg_type_info ext_x8_vget_args[]
920 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x8),
921 rvv_arg_type_info (RVV_BASE_size), rvv_arg_type_info_end};
923 /* A list of args for vector_type func (vector_type) function. */
924 static CONSTEXPR const rvv_arg_type_info tuple_vset_args[]
925 = {rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info (RVV_BASE_size),
926 rvv_arg_type_info (RVV_BASE_tuple_subpart), rvv_arg_type_info_end};
928 /* A list of args for vector_type func (vector_type) function. */
929 static CONSTEXPR const rvv_arg_type_info tuple_vcreate_args[]
930 = {rvv_arg_type_info (RVV_BASE_tuple_subpart), rvv_arg_type_info_end};
932 /* A list of args for vector_type func (vector_type) function. */
933 static CONSTEXPR const rvv_arg_type_info ext_vcreate_args[]
934 = {rvv_arg_type_info (RVV_BASE_vector),
935 rvv_arg_type_info_end};
937 /* A list of none preds that will be registered for intrinsic functions. */
938 static CONSTEXPR const predication_type_index none_preds[]
939 = {PRED_TYPE_none, NUM_PRED_TYPES};
941 /* vop/vop_m/vop_tu/vop_tum/vop_tumu/vop_mu will be registered. */
942 static CONSTEXPR const predication_type_index full_preds[]
943 = {PRED_TYPE_none, PRED_TYPE_m, PRED_TYPE_tu, PRED_TYPE_tum,
944 PRED_TYPE_tumu, PRED_TYPE_mu, NUM_PRED_TYPES};
946 /* vop/vop_m/vop_tu/vop_tum/ will be registered. */
947 static CONSTEXPR const predication_type_index no_mu_preds[]
948 = {PRED_TYPE_none, PRED_TYPE_m, PRED_TYPE_tu, PRED_TYPE_tum, NUM_PRED_TYPES};
950 /* vop/vop_tu will be registered. */
951 static CONSTEXPR const predication_type_index none_tu_preds[]
952 = {PRED_TYPE_none, PRED_TYPE_tu, NUM_PRED_TYPES};
954 /* vop/vop_m will be registered. */
955 static CONSTEXPR const predication_type_index none_m_preds[]
956 = {PRED_TYPE_none, PRED_TYPE_m, NUM_PRED_TYPES};
958 /* vop/vop_m/vop_mu will be registered. */
959 static CONSTEXPR const predication_type_index none_m_mu_preds[]
960 = {PRED_TYPE_none, PRED_TYPE_m, PRED_TYPE_mu, NUM_PRED_TYPES};
962 /* A static operand information for size_t func () function registration. */
963 static CONSTEXPR const rvv_op_info i_none_size_void_ops
964 = {i_ops, /* Types */
965 OP_TYPE_none, /* Suffix */
966 rvv_arg_type_info (RVV_BASE_size), /* Return type */
967 void_args /* Args */};
969 /* A static operand information for size_t func (size_t) function registration.
971 static CONSTEXPR const rvv_op_info i_none_size_size_ops
972 = {i_ops, /* Types */
973 OP_TYPE_none, /* Suffix */
974 rvv_arg_type_info (RVV_BASE_size), /* Return type */
975 size_args /* Args */};
977 /* A static operand information for vector_type func () function registration.
979 static CONSTEXPR const rvv_op_info all_none_void_ops
980 = {all_ops, /* Types */
981 OP_TYPE_none, /* Suffix */
982 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
983 void_args /* Args */};
985 /* A static operand information for vector_type func (const scalar_type *)
986 * function registration. */
987 static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_ops
988 = {all_ops, /* Types */
989 OP_TYPE_v, /* Suffix */
990 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
991 scalar_const_ptr_args /* Args */};
993 /* A static operand information for vector_type func (const scalar_type *)
994 * function registration. */
995 static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_size_ptr_ops
996 = {all_ops, /* Types */
997 OP_TYPE_v, /* Suffix */
998 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
999 scalar_const_ptr_size_ptr_args /* Args */};
1001 /* A static operand information for void func (scalar_type *, vector_type)
1002 * function registration. */
1003 static CONSTEXPR const rvv_op_info all_v_scalar_ptr_ops
1004 = {all_ops, /* Types */
1005 OP_TYPE_v, /* Suffix */
1006 rvv_arg_type_info (RVV_BASE_void), /* Return type */
1007 scalar_ptr_args /* Args */};
1009 /* A static operand information for vector_type func (const scalar_type *)
1010 * function registration. */
1011 static CONSTEXPR const rvv_op_info b_v_scalar_const_ptr_ops
1012 = {b_ops, /* Types */
1013 OP_TYPE_v, /* Suffix */
1014 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1015 scalar_const_ptr_args /* Args */};
1017 /* A static operand information for void func (scalar_type *, vector_type)
1018 * function registration. */
1019 static CONSTEXPR const rvv_op_info b_v_scalar_ptr_ops
1020 = {b_ops, /* Types */
1021 OP_TYPE_v, /* Suffix */
1022 rvv_arg_type_info (RVV_BASE_void), /* Return type */
1023 scalar_ptr_args /* Args */};
1025 /* A static operand information for vector_type func (vector_type, vector_type)
1026 * function registration. */
1027 static CONSTEXPR const rvv_op_info b_mmm_ops
1028 = {b_ops, /* Types */
1029 OP_TYPE_mm, /* Suffix */
1030 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1031 vv_args /* Args */};
1033 /* A static operand information for vector_type func (vector_type)
1034 * function registration. */
1035 static CONSTEXPR const rvv_op_info b_mm_ops
1036 = {b_ops, /* Types */
1037 OP_TYPE_m, /* Suffix */
1038 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1039 v_args /* Args */};
1041 /* A static operand information for vector_type func (vector_type)
1042 * function registration. */
1043 static CONSTEXPR const rvv_op_info u_vm_ops
1044 = {u_ops, /* Types */
1045 OP_TYPE_m, /* Suffix */
1046 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1047 m_args /* Args */};
1049 /* A static operand information for vector_type func ()
1050 * function registration. */
1051 static CONSTEXPR const rvv_op_info b_m_ops
1052 = {b_ops, /* Types */
1053 OP_TYPE_m, /* Suffix */
1054 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1055 end_args /* Args */};
1057 /* A static operand information for vector_type func ()
1058 * function registration. */
1059 static CONSTEXPR const rvv_op_info u_v_ops
1060 = {u_ops, /* Types */
1061 OP_TYPE_v, /* Suffix */
1062 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1063 end_args /* Args */};
1065 /* A static operand information for vector_type func (vector_type)
1066 * function registration. */
1067 static CONSTEXPR const rvv_op_info u_vv_ops
1068 = {u_ops, /* Types */
1069 OP_TYPE_v, /* Suffix */
1070 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1071 v_args /* Args */};
1073 /* A static operand information for unsigned long func (vector_type)
1074 * function registration. */
1075 static CONSTEXPR const rvv_op_info b_ulong_m_ops
1076 = {b_ops, /* Types */
1077 OP_TYPE_m, /* Suffix */
1078 rvv_arg_type_info (RVV_BASE_unsigned_long), /* Return type */
1079 v_args /* Args */};
1081 /* A static operand information for long func (vector_type)
1082 * function registration. */
1083 static CONSTEXPR const rvv_op_info b_long_m_ops
1084 = {b_ops, /* Types */
1085 OP_TYPE_m, /* Suffix */
1086 rvv_arg_type_info (RVV_BASE_long), /* Return type */
1087 v_args /* Args */};
1089 /* A static operand information for vector_type func (const scalar_type *,
1090 * ptrdiff_t) function registration. */
1091 static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_ptrdiff_ops
1092 = {all_ops, /* Types */
1093 OP_TYPE_v, /* Suffix */
1094 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1095 scalar_const_ptr_ptrdiff_args /* Args */};
1097 /* A static operand information for vector_type func (const scalar_type *,
1098 * eew8_index_type) function registration. */
1099 static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_eew8_index_ops
1100 = {all_ops, /* Types */
1101 OP_TYPE_v, /* Suffix */
1102 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1103 scalar_const_ptr_eew8_index_args /* Args */};
1105 /* A static operand information for vector_type func (const scalar_type *,
1106 * eew16_index_type) function registration. */
1107 static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_eew16_index_ops
1108 = {all_ops, /* Types */
1109 OP_TYPE_v, /* Suffix */
1110 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1111 scalar_const_ptr_eew16_index_args /* Args */};
1113 /* A static operand information for vector_type func (const scalar_type *,
1114 * eew32_index_type) function registration. */
1115 static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_eew32_index_ops
1116 = {all_ops, /* Types */
1117 OP_TYPE_v, /* Suffix */
1118 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1119 scalar_const_ptr_eew32_index_args /* Args */};
1121 /* A static operand information for vector_type func (const scalar_type *,
1122 * eew64_index_type) function registration. */
1123 static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_eew64_index_ops
1124 = {all_ops, /* Types */
1125 OP_TYPE_v, /* Suffix */
1126 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1127 scalar_const_ptr_eew64_index_args /* Args */};
1129 /* A static operand information for void func (scalar_type *, ptrdiff_t,
1130 * vector_type) function registration. */
1131 static CONSTEXPR const rvv_op_info all_v_scalar_ptr_ptrdiff_ops
1132 = {all_ops, /* Types */
1133 OP_TYPE_v, /* Suffix */
1134 rvv_arg_type_info (RVV_BASE_void), /* Return type */
1135 scalar_ptr_ptrdiff_args /* Args */};
1137 /* A static operand information for void func (scalar_type *, eew8_index_type,
1138 * vector_type) function registration. */
1139 static CONSTEXPR const rvv_op_info all_v_scalar_ptr_eew8_index_ops
1140 = {all_ops, /* Types */
1141 OP_TYPE_v, /* Suffix */
1142 rvv_arg_type_info (RVV_BASE_void), /* Return type */
1143 scalar_ptr_eew8_index_args /* Args */};
1145 /* A static operand information for void func (scalar_type *, eew16_index_type,
1146 * vector_type) function registration. */
1147 static CONSTEXPR const rvv_op_info all_v_scalar_ptr_eew16_index_ops
1148 = {all_ops, /* Types */
1149 OP_TYPE_v, /* Suffix */
1150 rvv_arg_type_info (RVV_BASE_void), /* Return type */
1151 scalar_ptr_eew16_index_args /* Args */};
1153 /* A static operand information for void func (scalar_type *, eew32_index_type,
1154 * vector_type) function registration. */
1155 static CONSTEXPR const rvv_op_info all_v_scalar_ptr_eew32_index_ops
1156 = {all_ops, /* Types */
1157 OP_TYPE_v, /* Suffix */
1158 rvv_arg_type_info (RVV_BASE_void), /* Return type */
1159 scalar_ptr_eew32_index_args /* Args */};
1161 /* A static operand information for void func (scalar_type *, eew64_index_type,
1162 * vector_type) function registration. */
1163 static CONSTEXPR const rvv_op_info all_v_scalar_ptr_eew64_index_ops
1164 = {all_ops, /* Types */
1165 OP_TYPE_v, /* Suffix */
1166 rvv_arg_type_info (RVV_BASE_void), /* Return type */
1167 scalar_ptr_eew64_index_args /* Args */};
1169 /* A static operand information for vector_type func (vector_type, vector_type)
1170 * function registration. */
1171 static CONSTEXPR const rvv_op_info iu_vvv_ops
1172 = {iu_ops, /* Types */
1173 OP_TYPE_vv, /* Suffix */
1174 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1175 vv_args /* Args */};
1177 /* A static operand information for vector_type func (vector_type, vector_type,
1178 * vector_type) function registration. */
1179 static CONSTEXPR const rvv_op_info iu_vvvv_ops
1180 = {iu_ops, /* Types */
1181 OP_TYPE_vv, /* Suffix */
1182 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1183 vvv_args /* Args */};
1185 /* A static operand information for vector_type func (vector_type, scalar_type,
1186 * vector_type) function registration. */
1187 static CONSTEXPR const rvv_op_info iu_vvxv_ops
1188 = {iu_ops, /* Types */
1189 OP_TYPE_vx, /* Suffix */
1190 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1191 vxv_args /* Args */};
1193 /* A static operand information for vector_type func (vector_type, vector_type,
1194 * vector_type) function registration. */
1195 static CONSTEXPR const rvv_op_info f_vvvv_ops
1196 = {f_ops, /* Types */
1197 OP_TYPE_vv, /* Suffix */
1198 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1199 vvv_args /* Args */};
1201 /* A static operand information for vector_type func (vector_type, scalar_type,
1202 * vector_type) function registration. */
1203 static CONSTEXPR const rvv_op_info f_vvfv_ops
1204 = {f_ops, /* Types */
1205 OP_TYPE_vf, /* Suffix */
1206 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1207 vxv_args /* Args */};
1209 /* A static operand information for vector_type func (vector_type, vector_type,
1210 * mask_type) function registration. */
1211 static CONSTEXPR const rvv_op_info iu_vvvm_ops
1212 = {iu_ops, /* Types */
1213 OP_TYPE_vvm, /* Suffix */
1214 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1215 vvm_args /* Args */};
1217 /* A static operand information for vector_type func (vector_type, vector_type,
1218 * mask_type) function registration. */
1219 static CONSTEXPR const rvv_op_info all_vvvm_ops
1220 = {all_ops, /* Types */
1221 OP_TYPE_vvm, /* Suffix */
1222 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1223 vvm_args /* Args */};
1225 /* A static operand information for vector_type func (vector_type, vector_type,
1226 * mask_type) function registration. */
1227 static CONSTEXPR const rvv_op_info all_vvm_ops
1228 = {all_ops, /* Types */
1229 OP_TYPE_vm, /* Suffix */
1230 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1231 vm_args /* Args */};
1233 /* A static operand information for vector_type func (vector_type, scalar_type,
1234 * mask_type) function registration. */
1235 static CONSTEXPR const rvv_op_info iu_vvxm_ops
1236 = {iu_ops, /* Types */
1237 OP_TYPE_vxm, /* Suffix */
1238 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1239 vxm_args /* Args */};
1241 /* A static operand information for vector_type func (vector_type, scalar_type,
1242 * mask_type) function registration. */
1243 static CONSTEXPR const rvv_op_info f_vvfm_ops
1244 = {f_ops, /* Types */
1245 OP_TYPE_vfm, /* Suffix */
1246 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1247 vxm_args /* Args */};
1249 /* A static operand information for mask_type func (vector_type, vector_type,
1250 * mask_type) function registration. */
1251 static CONSTEXPR const rvv_op_info iu_mvvm_ops
1252 = {iu_ops, /* Types */
1253 OP_TYPE_vvm, /* Suffix */
1254 rvv_arg_type_info (RVV_BASE_mask), /* Return type */
1255 vvm_args /* Args */};
1257 /* A static operand information for mask_type func (vector_type, scalar_type,
1258 * mask_type) function registration. */
1259 static CONSTEXPR const rvv_op_info iu_mvxm_ops
1260 = {iu_ops, /* Types */
1261 OP_TYPE_vxm, /* Suffix */
1262 rvv_arg_type_info (RVV_BASE_mask), /* Return type */
1263 vxm_args /* Args */};
1265 /* A static operand information for mask_type func (vector_type, vector_type)
1266 * function registration. */
1267 static CONSTEXPR const rvv_op_info iu_mvv_ops
1268 = {iu_ops, /* Types */
1269 OP_TYPE_vv, /* Suffix */
1270 rvv_arg_type_info (RVV_BASE_mask), /* Return type */
1271 vv_args /* Args */};
1273 /* A static operand information for mask_type func (vector_type, vector_type)
1274 * function registration. */
1275 static CONSTEXPR const rvv_op_info i_mvv_ops
1276 = {i_ops, /* Types */
1277 OP_TYPE_vv, /* Suffix */
1278 rvv_arg_type_info (RVV_BASE_mask), /* Return type */
1279 vv_args /* Args */};
1281 /* A static operand information for mask_type func (vector_type, vector_type)
1282 * function registration. */
1283 static CONSTEXPR const rvv_op_info u_mvv_ops
1284 = {u_ops, /* Types */
1285 OP_TYPE_vv, /* Suffix */
1286 rvv_arg_type_info (RVV_BASE_mask), /* Return type */
1287 vv_args /* Args */};
1289 /* A static operand information for mask_type func (vector_type, vector_type)
1290 * function registration. */
1291 static CONSTEXPR const rvv_op_info f_mvv_ops
1292 = {f_ops, /* Types */
1293 OP_TYPE_vv, /* Suffix */
1294 rvv_arg_type_info (RVV_BASE_mask), /* Return type */
1295 vv_args /* Args */};
1297 /* A static operand information for mask_type func (vector_type, scalar_type)
1298 * function registration. */
1299 static CONSTEXPR const rvv_op_info iu_mvx_ops
1300 = {iu_ops, /* Types */
1301 OP_TYPE_vx, /* Suffix */
1302 rvv_arg_type_info (RVV_BASE_mask), /* Return type */
1303 vx_args /* Args */};
1305 /* A static operand information for mask_type func (vector_type, scalar_type)
1306 * function registration. */
1307 static CONSTEXPR const rvv_op_info i_mvx_ops
1308 = {i_ops, /* Types */
1309 OP_TYPE_vx, /* Suffix */
1310 rvv_arg_type_info (RVV_BASE_mask), /* Return type */
1311 vx_args /* Args */};
1313 /* A static operand information for mask_type func (vector_type, scalar_type)
1314 * function registration. */
1315 static CONSTEXPR const rvv_op_info u_mvx_ops
1316 = {u_ops, /* Types */
1317 OP_TYPE_vx, /* Suffix */
1318 rvv_arg_type_info (RVV_BASE_mask), /* Return type */
1319 vx_args /* Args */};
1321 /* A static operand information for mask_type func (vector_type, scalar_type)
1322 * function registration. */
1323 static CONSTEXPR const rvv_op_info f_mvf_ops
1324 = {f_ops, /* Types */
1325 OP_TYPE_vf, /* Suffix */
1326 rvv_arg_type_info (RVV_BASE_mask), /* Return type */
1327 vx_args /* Args */};
1329 /* A static operand information for vector_type func (vector_type, vector_type)
1330 * function registration. */
1331 static CONSTEXPR const rvv_op_info i_vvv_ops
1332 = {i_ops, /* Types */
1333 OP_TYPE_vv, /* Suffix */
1334 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1335 vv_args /* Args */};
1337 /* A static operand information for vector_type func (vector_type, vector_type)
1338 * function registration. */
1339 static CONSTEXPR const rvv_op_info u_vvv_ops
1340 = {u_ops, /* Types */
1341 OP_TYPE_vv, /* Suffix */
1342 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1343 vv_args /* Args */};
1345 /* A static operand information for vector_type func (vector_type, vector_type)
1346 * function registration. */
1347 static CONSTEXPR const rvv_op_info f_vvv_ops
1348 = {f_ops, /* Types */
1349 OP_TYPE_vv, /* Suffix */
1350 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1351 vv_args /* Args */};
1353 /* A static operand information for vector_type func (vector_type, vector_type)
1354 * function registration. */
1355 static CONSTEXPR const rvv_op_info f_vvf_ops
1356 = {f_ops, /* Types */
1357 OP_TYPE_vf, /* Suffix */
1358 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1359 vx_args /* Args */};
1361 /* A static operand information for vector_type func (vector_type, vector_type)
1362 * function registration. */
1363 static CONSTEXPR const rvv_op_info full_v_i_vvv_ops
1364 = {full_v_i_ops, /* Types */
1365 OP_TYPE_vv, /* Suffix */
1366 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1367 vv_args /* Args */};
1369 /* A static operand information for vector_type func (vector_type, vector_type)
1370 * function registration. */
1371 static CONSTEXPR const rvv_op_info full_v_u_vvv_ops
1372 = {full_v_u_ops, /* Types */
1373 OP_TYPE_vv, /* Suffix */
1374 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1375 vv_args /* Args */};
1377 /* A static operand information for vector_type func (signed vector_type,
1378 * unsigned vector_type) function registration. */
1379 static CONSTEXPR const rvv_op_info full_v_i_su_vvv_ops
1380 = {full_v_i_ops, /* Types */
1381 OP_TYPE_vv, /* Suffix */
1382 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1383 su_vv_args /* Args */};
1385 /* A static operand information for vector_type func (vector_type, scalar_type)
1386 * function registration. */
1387 static CONSTEXPR const rvv_op_info iu_vvx_ops
1388 = {iu_ops, /* Types */
1389 OP_TYPE_vx, /* Suffix */
1390 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1391 vx_args /* Args */};
1393 /* A static operand information for vector_type func (vector_type, scalar_type)
1394 * function registration. */
1395 static CONSTEXPR const rvv_op_info all_vvx_ops
1396 = {all_ops, /* Types */
1397 OP_TYPE_vx, /* Suffix */
1398 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1399 v_size_args /* Args */};
1401 /* A static operand information for vector_type func (vector_type, vector_type,
1402 * scalar_type) function registration. */
1403 static CONSTEXPR const rvv_op_info all_vvvx_ops
1404 = {all_ops, /* Types */
1405 OP_TYPE_vx, /* Suffix */
1406 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1407 vv_size_args /* Args */};
1409 /* A static operand information for vector_type func (vector_type, scalar_type)
1410 * function registration. */
1411 static CONSTEXPR const rvv_op_info i_vvx_ops
1412 = {i_ops, /* Types */
1413 OP_TYPE_vx, /* Suffix */
1414 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1415 vx_args /* Args */};
1417 /* A static operand information for vector_type func (vector_type, scalar_type)
1418 * function registration. */
1419 static CONSTEXPR const rvv_op_info u_vvx_ops
1420 = {u_ops, /* Types */
1421 OP_TYPE_vx, /* Suffix */
1422 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1423 vx_args /* Args */};
1425 /* A static operand information for vector_type func (vector_type, scalar_type)
1426 * function registration that require full 'V' extension. */
1427 static CONSTEXPR const rvv_op_info full_v_i_vvx_ops
1428 = {full_v_i_ops, /* Types */
1429 OP_TYPE_vx, /* Suffix */
1430 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1431 vx_args /* Args */};
1433 /* A static operand information for vector_type func (vector_type, scalar_type)
1434 * function registration that require full 'V' extension. */
1435 static CONSTEXPR const rvv_op_info full_v_u_vvx_ops
1436 = {full_v_u_ops, /* Types */
1437 OP_TYPE_vx, /* Suffix */
1438 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1439 vx_args /* Args */};
1441 /* A static operand information for vector_type func (signed vector_type,
1442 * unsigned scalar_type) function registration that require full 'V' extension.
1444 static CONSTEXPR const rvv_op_info full_v_i_su_vvx_ops
1445 = {full_v_i_ops, /* Types */
1446 OP_TYPE_vx, /* Suffix */
1447 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1448 su_vx_args /* Args */};
1450 /* A static operand information for vector_type func (vector_type, shift_type)
1451 * function registration. */
1452 static CONSTEXPR const rvv_op_info iu_shift_vvv_ops
1453 = {iu_ops, /* Types */
1454 OP_TYPE_vv, /* Suffix */
1455 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1456 shift_vv_args /* Args */};
1458 /* A static operand information for vector_type func (vector_type, size_t)
1459 * function registration. */
1460 static CONSTEXPR const rvv_op_info iu_shift_vvx_ops
1461 = {iu_ops, /* Types */
1462 OP_TYPE_vx, /* Suffix */
1463 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1464 v_size_args /* Args */};
1466 /* A static operand information for vector_type func (vector_type, shift_type)
1467 * function registration. */
1468 static CONSTEXPR const rvv_op_info i_shift_vvv_ops
1469 = {i_ops, /* Types */
1470 OP_TYPE_vv, /* Suffix */
1471 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1472 shift_vv_args /* Args */};
1474 /* A static operand information for vector_type func (vector_type, size_t)
1475 * function registration. */
1476 static CONSTEXPR const rvv_op_info i_shift_vvx_ops
1477 = {i_ops, /* Types */
1478 OP_TYPE_vx, /* Suffix */
1479 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1480 v_size_args /* Args */};
1482 /* A static operand information for vector_type func (vector_type, shift_type)
1483 * function registration. */
1484 static CONSTEXPR const rvv_op_info u_shift_vvv_ops
1485 = {u_ops, /* Types */
1486 OP_TYPE_vv, /* Suffix */
1487 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1488 shift_vv_args /* Args */};
1490 /* A static operand information for vector_type func (vector_type, size_t)
1491 * function registration. */
1492 static CONSTEXPR const rvv_op_info u_shift_vvx_ops
1493 = {u_ops, /* Types */
1494 OP_TYPE_vx, /* Suffix */
1495 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1496 v_size_args /* Args */};
1498 /* A static operand information for vector_type func (vector_type, index_type)
1499 * function registration. */
1500 static CONSTEXPR const rvv_op_info all_gather_vvv_ops
1501 = {all_ops, /* Types */
1502 OP_TYPE_vv, /* Suffix */
1503 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1504 gather_vv_args /* Args */};
1506 /* A static operand information for vector_type func (vector_type, size_t)
1507 * function registration. */
1508 static CONSTEXPR const rvv_op_info all_gather_vvx_ops
1509 = {all_ops, /* Types */
1510 OP_TYPE_vx, /* Suffix */
1511 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1512 v_size_args /* Args */};
1514 /* A static operand information for vector_type func (vector_type, index_type)
1515 * function registration. */
1516 static CONSTEXPR const rvv_op_info all_gatherei16_vvv_ops
1517 = {ei16_ops, /* Types */
1518 OP_TYPE_vv, /* Suffix */
1519 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1520 gatherei16_vv_args /* Args */};
1522 /* A static operand information for vector_type func (vector_type)
1523 * function registration. */
1524 static CONSTEXPR const rvv_op_info iu_v_ops
1525 = {iu_ops, /* Types */
1526 OP_TYPE_v, /* Suffix */
1527 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1528 v_args /* Args */};
1530 /* A static operand information for scalar_type func (vector_type)
1531 * function registration. */
1532 static CONSTEXPR const rvv_op_info iu_x_s_ops
1533 = {iu_ops, /* Types */
1534 OP_TYPE_s, /* Suffix */
1535 rvv_arg_type_info (RVV_BASE_scalar), /* Return type */
1536 v_args /* Args */};
1538 /* A static operand information for scalar_type func (vector_type)
1539 * function registration. */
1540 static CONSTEXPR const rvv_op_info f_f_s_ops
1541 = {f_ops, /* Types */
1542 OP_TYPE_s, /* Suffix */
1543 rvv_arg_type_info (RVV_BASE_scalar), /* Return type */
1544 v_args /* Args */};
1546 /* A static operand information for vector_type func (vector_type)
1547 * function registration. */
1548 static CONSTEXPR const rvv_op_info iu_vs_ops
1549 = {iu_ops, /* Types */
1550 OP_TYPE_vs, /* Suffix */
1551 rvv_arg_type_info (RVV_BASE_lmul1_vector), /* Return type */
1552 vs_args /* Args */};
1554 /* A static operand information for vector_type func (vector_type)
1555 * function registration. */
1556 static CONSTEXPR const rvv_op_info f_vs_ops
1557 = {f_ops, /* Types */
1558 OP_TYPE_vs, /* Suffix */
1559 rvv_arg_type_info (RVV_BASE_lmul1_vector), /* Return type */
1560 vs_args /* Args */};
1562 /* A static operand information for vector_type func (vector_type)
1563 * function registration. */
1564 static CONSTEXPR const rvv_op_info wi_vs_ops
1565 = {wi_ops, /* Types */
1566 OP_TYPE_vs, /* Suffix */
1567 rvv_arg_type_info (RVV_BASE_widen_lmul1_vector), /* Return type */
1568 wvs_args /* Args */};
1570 /* A static operand information for vector_type func (vector_type)
1571 * function registration. */
1572 static CONSTEXPR const rvv_op_info wu_vs_ops
1573 = {wu_ops, /* Types */
1574 OP_TYPE_vs, /* Suffix */
1575 rvv_arg_type_info (RVV_BASE_widen_lmul1_vector), /* Return type */
1576 wvs_args /* Args */};
1578 /* A static operand information for vector_type func (vector_type)
1579 * function registration. */
1580 static CONSTEXPR const rvv_op_info wf_vs_ops
1581 = {wf_ops, /* Types */
1582 OP_TYPE_vs, /* Suffix */
1583 rvv_arg_type_info (RVV_BASE_widen_lmul1_vector), /* Return type */
1584 wvs_args /* Args */};
1586 /* A static operand information for vector_type func (vector_type)
1587 * function registration. */
1588 static CONSTEXPR const rvv_op_info f_v_ops
1589 = {f_ops, /* Types */
1590 OP_TYPE_v, /* Suffix */
1591 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1592 v_args /* Args */};
1594 /* A static operand information for vector_type func (vector_type)
1595 * function registration. */
1596 static CONSTEXPR const rvv_op_info f_to_u_v_ops
1597 = {convert_u_ops, /* Types */
1598 OP_TYPE_v, /* Suffix */
1599 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1600 f_v_args /* Args */};
1602 /* A static operand information for vector_type func (vector_type)
1603 * function registration. */
1604 static CONSTEXPR const rvv_op_info f_to_i_f_v_ops
1605 = {convert_i_ops, /* Types */
1606 OP_TYPE_f_v, /* Suffix */
1607 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1608 f_v_args /* Args */};
1610 /* A static operand information for vector_type func (vector_type)
1611 * function registration. */
1612 static CONSTEXPR const rvv_op_info f_to_wi_f_v_ops
1613 = {wconvert_i_ops, /* Types */
1614 OP_TYPE_f_v, /* Suffix */
1615 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1616 trunc_f_v_args /* Args */};
1618 /* A static operand information for vector_type func (vector_type)
1619 * function registration. */
1620 static CONSTEXPR const rvv_op_info f_to_ni_f_w_ops
1621 = {f_ops, /* Types */
1622 OP_TYPE_f_w, /* Suffix */
1623 rvv_arg_type_info (RVV_BASE_double_trunc_signed_vector), /* Return type */
1624 v_args /* Args */};
1626 /* A static operand information for vector_type func (vector_type)
1627 * function registration. */
1628 static CONSTEXPR const rvv_op_info f_to_nu_f_w_ops
1629 = {f_ops, /* Types */
1630 OP_TYPE_f_w, /* Suffix */
1631 rvv_arg_type_info (
1632 RVV_BASE_double_trunc_unsigned_vector), /* Return type */
1633 v_args /* Args */};
1635 /* A static operand information for vector_type func (vector_type)
1636 * function registration. */
1637 static CONSTEXPR const rvv_op_info i_to_f_x_v_ops
1638 = {f_ops, /* Types */
1639 OP_TYPE_x_v, /* Suffix */
1640 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1641 x_v_args /* Args */};
1643 /* A static operand information for vector_type func (vector_type)
1644 * function registration. */
1645 static CONSTEXPR const rvv_op_info u_to_f_xu_v_ops
1646 = {f_ops, /* Types */
1647 OP_TYPE_xu_v, /* Suffix */
1648 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1649 xu_v_args /* Args */};
1651 /* A static operand information for vector_type func (vector_type)
1652 * function registration. */
1653 static CONSTEXPR const rvv_op_info i_to_wf_x_v_ops
1654 = {f_ops, /* Types */
1655 OP_TYPE_x_v, /* Suffix */
1656 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1657 w_x_v_args /* Args */};
1659 /* A static operand information for vector_type func (vector_type)
1660 * function registration. */
1661 static CONSTEXPR const rvv_op_info u_to_wf_xu_v_ops
1662 = {f_ops, /* Types */
1663 OP_TYPE_xu_v, /* Suffix */
1664 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1665 w_xu_v_args /* Args */};
1667 /* A static operand information for vector_type func (vector_type)
1668 * function registration. */
1669 static CONSTEXPR const rvv_op_info i_to_nf_x_w_ops
1670 = {wconvert_i_ops, /* Types */
1671 OP_TYPE_x_w, /* Suffix */
1672 rvv_arg_type_info (RVV_BASE_double_trunc_float_vector), /* Return type */
1673 v_args /* Args */};
1675 /* A static operand information for vector_type func (vector_type)
1676 * function registration. */
1677 static CONSTEXPR const rvv_op_info u_to_nf_xu_w_ops
1678 = {wconvert_u_ops, /* Types */
1679 OP_TYPE_xu_w, /* Suffix */
1680 rvv_arg_type_info (RVV_BASE_double_trunc_float_vector), /* Return type */
1681 v_args /* Args */};
1683 /* A static operand information for vector_type func (vector_type)
1684 * function registration. */
1685 static CONSTEXPR const rvv_op_info f_to_u_f_v_ops
1686 = {convert_u_ops, /* Types */
1687 OP_TYPE_f_v, /* Suffix */
1688 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1689 f_v_args /* Args */};
1691 /* A static operand information for vector_type func (vector_type)
1692 * function registration. */
1693 static CONSTEXPR const rvv_op_info f_to_wu_f_v_ops
1694 = {wconvert_u_ops, /* Types */
1695 OP_TYPE_f_v, /* Suffix */
1696 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1697 trunc_f_v_args /* Args */};
1699 /* A static operand information for vector_type func (vector_type)
1700 * function registration. */
1701 static CONSTEXPR const rvv_op_info f_to_wf_f_v_ops
1702 = {f_ops, /* Types */
1703 OP_TYPE_f_v, /* Suffix */
1704 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1705 w_v_args /* Args */};
1707 /* A static operand information for vector_type func (vector_type)
1708 * function registration. */
1709 static CONSTEXPR const rvv_op_info f_to_nf_f_w_ops
1710 = {wconvert_f_ops, /* Types */
1711 OP_TYPE_f_w, /* Suffix */
1712 rvv_arg_type_info (RVV_BASE_double_trunc_float_vector), /* Return type */
1713 v_args /* Args */};
1715 /* A static operand information for vector_type func (vector_type)
1716 * function registration. */
1717 static CONSTEXPR const rvv_op_info all_v_ops
1718 = {all_ops, /* Types */
1719 OP_TYPE_v, /* Suffix */
1720 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1721 v_args /* Args */};
1723 /* A static operand information for vector_type func (vector_type)
1724 * function registration. */
1725 static CONSTEXPR const rvv_op_info i_v_u_ops
1726 = {i_ops, /* Types */
1727 OP_TYPE_v, /* Suffix */
1728 rvv_arg_type_info (RVV_BASE_unsigned_vector), /* Return type */
1729 v_args /* Args */};
1731 /* A static operand information for vector_type func (vector_type)
1732 * function registration. */
1733 static CONSTEXPR const rvv_op_info u_v_i_ops
1734 = {u_ops, /* Types */
1735 OP_TYPE_v, /* Suffix */
1736 rvv_arg_type_info (RVV_BASE_signed_vector), /* Return type */
1737 v_args /* Args */};
1739 /* A static operand information for vector_type func (vector_type)
1740 * function registration. */
1741 static CONSTEXPR const rvv_op_info iu_v_eew8_interpret_ops
1742 = {eew8_interpret_ops, /* Types */
1743 OP_TYPE_v, /* Suffix */
1744 rvv_arg_type_info (RVV_BASE_eew8_interpret), /* Return type */
1745 v_args /* Args */};
1747 /* A static operand information for vector_type func (vector_type)
1748 * function registration. */
1749 static CONSTEXPR const rvv_op_info iu_v_eew16_interpret_ops
1750 = {eew16_interpret_ops, /* Types */
1751 OP_TYPE_v, /* Suffix */
1752 rvv_arg_type_info (RVV_BASE_eew16_interpret), /* Return type */
1753 v_args /* Args */};
1755 /* A static operand information for vector_type func (vector_type)
1756 * function registration. */
1757 static CONSTEXPR const rvv_op_info iu_v_eew32_interpret_ops
1758 = {eew32_interpret_ops, /* Types */
1759 OP_TYPE_v, /* Suffix */
1760 rvv_arg_type_info (RVV_BASE_eew32_interpret), /* Return type */
1761 v_args /* Args */};
1763 /* A static operand information for vector_type func (vector_type)
1764 * function registration. */
1765 static CONSTEXPR const rvv_op_info iu_v_eew64_interpret_ops
1766 = {eew64_interpret_ops, /* Types */
1767 OP_TYPE_v, /* Suffix */
1768 rvv_arg_type_info (RVV_BASE_eew64_interpret), /* Return type */
1769 v_args /* Args */};
1771 /* A static operand information for vbool1_t func (vector_type)
1772 * function registration. */
1773 static CONSTEXPR const rvv_op_info iu_v_bool1_interpret_ops
1774 = {bool1_interpret_ops, /* Types */
1775 OP_TYPE_v, /* Suffix */
1776 rvv_arg_type_info (RVV_BASE_bool1_interpret), /* Return type */
1777 v_args /* Args */};
1779 /* A static operand information for vbool2_t func (vector_type)
1780 * function registration. */
1781 static CONSTEXPR const rvv_op_info iu_v_bool2_interpret_ops
1782 = {bool2_interpret_ops, /* Types */
1783 OP_TYPE_v, /* Suffix */
1784 rvv_arg_type_info (RVV_BASE_bool2_interpret), /* Return type */
1785 v_args /* Args */};
1787 /* A static operand information for vbool4_t func (vector_type)
1788 * function registration. */
1789 static CONSTEXPR const rvv_op_info iu_v_bool4_interpret_ops
1790 = {bool4_interpret_ops, /* Types */
1791 OP_TYPE_v, /* Suffix */
1792 rvv_arg_type_info (RVV_BASE_bool4_interpret), /* Return type */
1793 v_args /* Args */};
1795 /* A static operand information for vbool8_t func (vector_type)
1796 * function registration. */
1797 static CONSTEXPR const rvv_op_info iu_v_bool8_interpret_ops
1798 = {bool8_interpret_ops, /* Types */
1799 OP_TYPE_v, /* Suffix */
1800 rvv_arg_type_info (RVV_BASE_bool8_interpret), /* Return type */
1801 v_args /* Args */};
1803 /* A static operand information for vbool16_t func (vector_type)
1804 * function registration. */
1805 static CONSTEXPR const rvv_op_info iu_v_bool16_interpret_ops
1806 = {bool16_interpret_ops, /* Types */
1807 OP_TYPE_v, /* Suffix */
1808 rvv_arg_type_info (RVV_BASE_bool16_interpret), /* Return type */
1809 v_args /* Args */};
1811 /* A static operand information for vbool32_t func (vector_type)
1812 * function registration. */
1813 static CONSTEXPR const rvv_op_info iu_v_bool32_interpret_ops
1814 = {bool32_interpret_ops, /* Types */
1815 OP_TYPE_v, /* Suffix */
1816 rvv_arg_type_info (RVV_BASE_bool32_interpret), /* Return type */
1817 v_args /* Args */};
1819 /* A static operand information for vbool64_t func (vector_type)
1820 * function registration. */
1821 static CONSTEXPR const rvv_op_info iu_v_bool64_interpret_ops
1822 = {bool64_interpret_ops, /* Types */
1823 OP_TYPE_v, /* Suffix */
1824 rvv_arg_type_info (RVV_BASE_bool64_interpret), /* Return type */
1825 v_args /* Args */};
1827 /* A static operand information for vint8_t func (vector_type)
1828 * function registration. */
1829 static CONSTEXPR const rvv_op_info b_v_signed_eew8_lmul1_interpret_ops
1830 = {signed_eew8_lmul1_interpret_ops, /* Types */
1831 OP_TYPE_v, /* Suffix */
1832 rvv_arg_type_info (RVV_BASE_signed_eew8_lmul1_interpret),/* Return type */
1833 v_args /* Args */};
1835 /* A static operand information for vint16_t func (vector_type)
1836 * function registration. */
1837 static CONSTEXPR const rvv_op_info b_v_signed_eew16_lmul1_interpret_ops
1838 = {signed_eew16_lmul1_interpret_ops, /* Types */
1839 OP_TYPE_v, /* Suffix */
1840 rvv_arg_type_info (RVV_BASE_signed_eew16_lmul1_interpret),/* Return type */
1841 v_args /* Args */};
1843 /* A static operand information for vint32_t func (vector_type)
1844 * function registration. */
1845 static CONSTEXPR const rvv_op_info b_v_signed_eew32_lmul1_interpret_ops
1846 = {signed_eew32_lmul1_interpret_ops, /* Types */
1847 OP_TYPE_v, /* Suffix */
1848 rvv_arg_type_info (RVV_BASE_signed_eew32_lmul1_interpret),/* Return type */
1849 v_args /* Args */};
1851 /* A static operand information for vint64_t func (vector_type)
1852 * function registration. */
1853 static CONSTEXPR const rvv_op_info b_v_signed_eew64_lmul1_interpret_ops
1854 = {signed_eew64_lmul1_interpret_ops, /* Types */
1855 OP_TYPE_v, /* Suffix */
1856 rvv_arg_type_info (RVV_BASE_signed_eew64_lmul1_interpret),/* Return type */
1857 v_args /* Args */};
1859 /* A static operand information for vuint8_t func (vector_type)
1860 * function registration. */
1861 static CONSTEXPR const rvv_op_info b_v_unsigned_eew8_lmul1_interpret_ops
1862 = {unsigned_eew8_lmul1_interpret_ops, /* Types */
1863 OP_TYPE_v, /* Suffix */
1864 rvv_arg_type_info (RVV_BASE_unsigned_eew8_lmul1_interpret),/* Return type */
1865 v_args /* Args */};
1867 /* A static operand information for vuint16_t func (vector_type)
1868 * function registration. */
1869 static CONSTEXPR const rvv_op_info b_v_unsigned_eew16_lmul1_interpret_ops
1870 = {unsigned_eew16_lmul1_interpret_ops, /* Types */
1871 OP_TYPE_v, /* Suffix */
1872 rvv_arg_type_info (RVV_BASE_unsigned_eew16_lmul1_interpret),/* Return type */
1873 v_args /* Args */};
1875 /* A static operand information for vuint32_t func (vector_type)
1876 * function registration. */
1877 static CONSTEXPR const rvv_op_info b_v_unsigned_eew32_lmul1_interpret_ops
1878 = {unsigned_eew32_lmul1_interpret_ops, /* Types */
1879 OP_TYPE_v, /* Suffix */
1880 rvv_arg_type_info (RVV_BASE_unsigned_eew32_lmul1_interpret),/* Return type */
1881 v_args /* Args */};
1883 /* A static operand information for vuint64_t func (vector_type)
1884 * function registration. */
1885 static CONSTEXPR const rvv_op_info b_v_unsigned_eew64_lmul1_interpret_ops
1886 = {unsigned_eew64_lmul1_interpret_ops, /* Types */
1887 OP_TYPE_v, /* Suffix */
1888 rvv_arg_type_info (RVV_BASE_unsigned_eew64_lmul1_interpret),/* Return type */
1889 v_args /* Args */};
1891 /* A static operand information for vector_type func (vector_type)
1892 * function registration. */
1893 static CONSTEXPR const rvv_op_info all_v_vlmul_ext_x2_ops
1894 = {vlmul_ext_x2_ops, /* Types */
1895 OP_TYPE_v, /* Suffix */
1896 rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), /* Return type */
1897 v_args /* Args */};
1899 /* A static operand information for vector_type func (vector_type)
1900 * function registration. */
1901 static CONSTEXPR const rvv_op_info all_v_vlmul_ext_x4_ops
1902 = {vlmul_ext_x4_ops, /* Types */
1903 OP_TYPE_v, /* Suffix */
1904 rvv_arg_type_info (RVV_BASE_vlmul_ext_x4), /* Return type */
1905 v_args /* Args */};
1907 /* A static operand information for vector_type func (vector_type)
1908 * function registration. */
1909 static CONSTEXPR const rvv_op_info all_v_vlmul_ext_x8_ops
1910 = {vlmul_ext_x8_ops, /* Types */
1911 OP_TYPE_v, /* Suffix */
1912 rvv_arg_type_info (RVV_BASE_vlmul_ext_x8), /* Return type */
1913 v_args /* Args */};
1915 /* A static operand information for vector_type func (vector_type)
1916 * function registration. */
1917 static CONSTEXPR const rvv_op_info all_v_vlmul_ext_x16_ops
1918 = {vlmul_ext_x16_ops, /* Types */
1919 OP_TYPE_v, /* Suffix */
1920 rvv_arg_type_info (RVV_BASE_vlmul_ext_x16), /* Return type */
1921 v_args /* Args */};
1923 /* A static operand information for vector_type func (vector_type)
1924 * function registration. */
1925 static CONSTEXPR const rvv_op_info all_v_vlmul_ext_x32_ops
1926 = {vlmul_ext_x32_ops, /* Types */
1927 OP_TYPE_v, /* Suffix */
1928 rvv_arg_type_info (RVV_BASE_vlmul_ext_x32), /* Return type */
1929 v_args /* Args */};
1931 /* A static operand information for vector_type func (vector_type)
1932 * function registration. */
1933 static CONSTEXPR const rvv_op_info all_v_vlmul_ext_x64_ops
1934 = {vlmul_ext_x64_ops, /* Types */
1935 OP_TYPE_v, /* Suffix */
1936 rvv_arg_type_info (RVV_BASE_vlmul_ext_x64), /* Return type */
1937 v_args /* Args */};
1939 /* A static operand information for vector_type func (vector_type)
1940 * function registration. */
1941 static CONSTEXPR const rvv_op_info all_v_vlmul_trunc_x2_ops
1942 = {vlmul_ext_x2_ops, /* Types */
1943 OP_TYPE_v, /* Suffix */
1944 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1945 v_x2_trunc_args /* Args */};
1947 /* A static operand information for vector_type func (vector_type)
1948 * function registration. */
1949 static CONSTEXPR const rvv_op_info all_v_vlmul_trunc_x4_ops
1950 = {vlmul_ext_x4_ops, /* Types */
1951 OP_TYPE_v, /* Suffix */
1952 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1953 v_x4_trunc_args /* Args */};
1955 /* A static operand information for vector_type func (vector_type)
1956 * function registration. */
1957 static CONSTEXPR const rvv_op_info all_v_vlmul_trunc_x8_ops
1958 = {vlmul_ext_x8_ops, /* Types */
1959 OP_TYPE_v, /* Suffix */
1960 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1961 v_x8_trunc_args /* Args */};
1963 /* A static operand information for vector_type func (vector_type)
1964 * function registration. */
1965 static CONSTEXPR const rvv_op_info all_v_vlmul_trunc_x16_ops
1966 = {vlmul_ext_x16_ops, /* Types */
1967 OP_TYPE_v, /* Suffix */
1968 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1969 v_x16_trunc_args /* Args */};
1971 /* A static operand information for vector_type func (vector_type)
1972 * function registration. */
1973 static CONSTEXPR const rvv_op_info all_v_vlmul_trunc_x32_ops
1974 = {vlmul_ext_x32_ops, /* Types */
1975 OP_TYPE_v, /* Suffix */
1976 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1977 v_x32_trunc_args /* Args */};
1979 /* A static operand information for vector_type func (vector_type)
1980 * function registration. */
1981 static CONSTEXPR const rvv_op_info all_v_vlmul_trunc_x64_ops
1982 = {vlmul_ext_x64_ops, /* Types */
1983 OP_TYPE_v, /* Suffix */
1984 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1985 v_x64_trunc_args /* Args */};
1987 /* A static operand information for vector_type func (vector_type)
1988 * function registration. */
1989 static CONSTEXPR const rvv_op_info f_v_i_ops
1990 = {f_ops, /* Types */
1991 OP_TYPE_v, /* Suffix */
1992 rvv_arg_type_info (RVV_BASE_signed_vector), /* Return type */
1993 v_args /* Args */};
1995 /* A static operand information for vector_type func (vector_type)
1996 * function registration. */
1997 static CONSTEXPR const rvv_op_info f_v_u_ops
1998 = {f_ops, /* Types */
1999 OP_TYPE_v, /* Suffix */
2000 rvv_arg_type_info (RVV_BASE_unsigned_vector), /* Return type */
2001 v_args /* Args */};
2003 /* A static operand information for vector_type func (vector_type)
2004 * function registration. */
2005 static CONSTEXPR const rvv_op_info i_v_f_ops
2006 = {f_ops, /* Types */
2007 OP_TYPE_v, /* Suffix */
2008 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2009 x_v_args /* Args */};
2011 /* A static operand information for vector_type func (vector_type)
2012 * function registration. */
2013 static CONSTEXPR const rvv_op_info u_v_f_ops
2014 = {f_ops, /* Types */
2015 OP_TYPE_v, /* Suffix */
2016 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2017 xu_v_args /* Args */};
2019 /* A static operand information for vector_type func (scalar_type)
2020 * function registration. */
2021 static CONSTEXPR const rvv_op_info iu_x_ops
2022 = {iu_ops, /* Types */
2023 OP_TYPE_x, /* Suffix */
2024 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2025 x_args /* Args */};
2027 /* A static operand information for vector_type func (scalar_type)
2028 * function registration. */
2029 static CONSTEXPR const rvv_op_info iu_s_x_ops
2030 = {iu_ops, /* Types */
2031 OP_TYPE_x, /* Suffix */
2032 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2033 x_args /* Args */};
2035 /* A static operand information for vector_type func (scalar_type)
2036 * function registration. */
2037 static CONSTEXPR const rvv_op_info f_f_ops
2038 = {f_ops, /* Types */
2039 OP_TYPE_f, /* Suffix */
2040 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2041 x_args /* Args */};
2043 /* A static operand information for vector_type func (scalar_type)
2044 * function registration. */
2045 static CONSTEXPR const rvv_op_info f_s_f_ops
2046 = {f_ops, /* Types */
2047 OP_TYPE_f, /* Suffix */
2048 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2049 x_args /* Args */};
2051 /* A static operand information for vector_type func (double demote type)
2052 * function registration. */
2053 static CONSTEXPR const rvv_op_info i_vf2_ops
2054 = {wexti_ops, /* Types */
2055 OP_TYPE_vf2, /* Suffix */
2056 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2057 vf2_args /* Args */};
2059 /* A static operand information for vector_type func (quad demote type)
2060 * function registration. */
2061 static CONSTEXPR const rvv_op_info i_vf4_ops
2062 = {qexti_ops, /* Types */
2063 OP_TYPE_vf4, /* Suffix */
2064 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2065 vf4_args /* Args */};
2067 /* A static operand information for vector_type func (oct demote type)
2068 * function registration. */
2069 static CONSTEXPR const rvv_op_info i_vf8_ops
2070 = {oexti_ops, /* Types */
2071 OP_TYPE_vf8, /* Suffix */
2072 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2073 vf8_args /* Args */};
2075 /* A static operand information for vector_type func (double demote type)
2076 * function registration. */
2077 static CONSTEXPR const rvv_op_info u_vf2_ops
2078 = {wextu_ops, /* Types */
2079 OP_TYPE_vf2, /* Suffix */
2080 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2081 vf2_args /* Args */};
2083 /* A static operand information for vector_type func (quad demote type)
2084 * function registration. */
2085 static CONSTEXPR const rvv_op_info u_vf4_ops
2086 = {qextu_ops, /* Types */
2087 OP_TYPE_vf4, /* Suffix */
2088 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2089 vf4_args /* Args */};
2091 /* A static operand information for vector_type func (oct demote type)
2092 * function registration. */
2093 static CONSTEXPR const rvv_op_info u_vf8_ops
2094 = {oextu_ops, /* Types */
2095 OP_TYPE_vf8, /* Suffix */
2096 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2097 vf8_args /* Args */};
2099 /* A static operand information for vector_type func (double demote type, double
2100 * demote type) function registration. */
2101 static CONSTEXPR const rvv_op_info i_wvv_ops
2102 = {wexti_ops, /* Types */
2103 OP_TYPE_vv, /* Suffix */
2104 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2105 wvv_args /* Args */};
2107 /* A static operand information for vector_type func (double demote type, double
2108 * demote type) function registration. */
2109 static CONSTEXPR const rvv_op_info f_wvv_ops
2110 = {wextf_ops, /* Types */
2111 OP_TYPE_vv, /* Suffix */
2112 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2113 wvv_args /* Args */};
2115 /* A static operand information for vector_type func (vector_type, double demote
2116 * type, double demote type) function registration. */
2117 static CONSTEXPR const rvv_op_info i_wwvv_ops
2118 = {wexti_ops, /* Types */
2119 OP_TYPE_vv, /* Suffix */
2120 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2121 wwvv_args /* Args */};
2123 /* A static operand information for vector_type func (vector_type, double demote
2124 * scalar_type, double demote type) function registration. */
2125 static CONSTEXPR const rvv_op_info i_wwxv_ops
2126 = {wexti_ops, /* Types */
2127 OP_TYPE_vx, /* Suffix */
2128 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2129 wwxv_args /* Args */};
2131 /* A static operand information for vector_type func (vector_type, double demote
2132 * type, double demote type) function registration. */
2133 static CONSTEXPR const rvv_op_info f_wwvv_ops
2134 = {wextf_ops, /* Types */
2135 OP_TYPE_vv, /* Suffix */
2136 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2137 wwvv_args /* Args */};
2139 /* A static operand information for vector_type func (vector_type, double demote
2140 * scalar_type, double demote type) function registration. */
2141 static CONSTEXPR const rvv_op_info f_wwfv_ops
2142 = {wextf_ops, /* Types */
2143 OP_TYPE_vf, /* Suffix */
2144 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2145 wwxv_args /* Args */};
2147 /* A static operand information for vector_type func (vector_type, double demote
2148 * type, double demote type) function registration. */
2149 static CONSTEXPR const rvv_op_info u_wwvv_ops
2150 = {wextu_ops, /* Types */
2151 OP_TYPE_vv, /* Suffix */
2152 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2153 wwvv_args /* Args */};
2155 /* A static operand information for vector_type func (vector_type, double demote
2156 * scalar_type, double demote type) function registration. */
2157 static CONSTEXPR const rvv_op_info u_wwxv_ops
2158 = {wextu_ops, /* Types */
2159 OP_TYPE_vx, /* Suffix */
2160 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2161 wwxv_args /* Args */};
2163 /* A static operand information for vector_type func (vector_type, double demote
2164 * type, double demote type) function registration. */
2165 static CONSTEXPR const rvv_op_info i_su_wwvv_ops
2166 = {wexti_ops, /* Types */
2167 OP_TYPE_vv, /* Suffix */
2168 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2169 su_wwvv_args /* Args */};
2171 /* A static operand information for vector_type func (vector_type, double demote
2172 * scalar_type, double demote type) function registration. */
2173 static CONSTEXPR const rvv_op_info i_su_wwxv_ops
2174 = {wexti_ops, /* Types */
2175 OP_TYPE_vx, /* Suffix */
2176 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2177 su_wwxv_args /* Args */};
2179 /* A static operand information for vector_type func (vector_type, double demote
2180 * scalar_type, double demote type) function registration. */
2181 static CONSTEXPR const rvv_op_info i_us_wwxv_ops
2182 = {wexti_ops, /* Types */
2183 OP_TYPE_vx, /* Suffix */
2184 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2185 us_wwxv_args /* Args */};
2187 /* A static operand information for vector_type func (signed double demote type,
2188 * unsigned double demote type) function registration. */
2189 static CONSTEXPR const rvv_op_info i_su_wvv_ops
2190 = {wexti_ops, /* Types */
2191 OP_TYPE_vv, /* Suffix */
2192 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2193 su_wvv_args /* Args */};
2195 /* A static operand information for vector_type func (double demote type, double
2196 * demote type) function registration. */
2197 static CONSTEXPR const rvv_op_info u_wvv_ops
2198 = {wextu_ops, /* Types */
2199 OP_TYPE_vv, /* Suffix */
2200 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2201 wvv_args /* Args */};
2203 /* A static operand information for vector_type func (double demote type, size type)
2204 * function registration. */
2205 static CONSTEXPR const rvv_op_info u_shift_wvx_ops
2206 = {wextu_ops, /* Types */
2207 OP_TYPE_vx, /* Suffix */
2208 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2209 wv_size_args /* Args */};
2211 /* A static operand information for vector_type func (double demote type, double
2212 * demote scalar_type) function registration. */
2213 static CONSTEXPR const rvv_op_info i_wvx_ops
2214 = {wexti_ops, /* Types */
2215 OP_TYPE_vx, /* Suffix */
2216 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2217 wvx_args /* Args */};
2219 /* A static operand information for vector_type func (double demote type, double
2220 * demote scalar_type) function registration. */
2221 static CONSTEXPR const rvv_op_info f_wvf_ops
2222 = {wextf_ops, /* Types */
2223 OP_TYPE_vf, /* Suffix */
2224 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2225 wvx_args /* Args */};
2227 /* A static operand information for vector_type func (signed double demote type,
2228 * unsigned double demote scalar_type) function registration. */
2229 static CONSTEXPR const rvv_op_info i_su_wvx_ops
2230 = {wexti_ops, /* Types */
2231 OP_TYPE_vx, /* Suffix */
2232 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2233 su_wvx_args /* Args */};
2235 /* A static operand information for vector_type func (vector_type, double
2236 * demote type) function registration. */
2237 static CONSTEXPR const rvv_op_info i_wwv_ops
2238 = {wexti_ops, /* Types */
2239 OP_TYPE_wv, /* Suffix */
2240 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2241 wwv_args /* Args */};
2243 /* A static operand information for vector_type func (vector_type, double
2244 * demote type) function registration. */
2245 static CONSTEXPR const rvv_op_info f_wwv_ops
2246 = {wextf_ops, /* Types */
2247 OP_TYPE_wv, /* Suffix */
2248 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2249 wwv_args /* Args */};
2251 /* A static operand information for vector_type func (vector_type, double
2252 * demote scalar_type) function registration. */
2253 static CONSTEXPR const rvv_op_info i_wwx_ops
2254 = {wexti_ops, /* Types */
2255 OP_TYPE_wx, /* Suffix */
2256 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2257 wwx_args /* Args */};
2259 /* A static operand information for vector_type func (vector_type, double
2260 * demote scalar_type) function registration. */
2261 static CONSTEXPR const rvv_op_info f_wwf_ops
2262 = {wextf_ops, /* Types */
2263 OP_TYPE_wf, /* Suffix */
2264 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2265 wwx_args /* Args */};
2267 /* A static operand information for vector_type func (vector_type, double
2268 * demote type) function registration. */
2269 static CONSTEXPR const rvv_op_info u_wwv_ops
2270 = {wextu_ops, /* Types */
2271 OP_TYPE_wv, /* Suffix */
2272 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2273 wwv_args /* Args */};
2275 /* A static operand information for vector_type func (vector_type, double
2276 * demote scalar_type) function registration. */
2277 static CONSTEXPR const rvv_op_info u_wwx_ops
2278 = {wextu_ops, /* Types */
2279 OP_TYPE_wx, /* Suffix */
2280 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2281 wwx_args /* Args */};
2283 /* A static operand information for vector_type func (double demote type, double
2284 * demote scalar_type) function registration. */
2285 static CONSTEXPR const rvv_op_info u_wvx_ops
2286 = {wextu_ops, /* Types */
2287 OP_TYPE_vx, /* Suffix */
2288 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2289 wvx_args /* Args */};
2291 /* A static operand information for vector_type func (double demote type)
2292 * function registration. */
2293 static CONSTEXPR const rvv_op_info i_x_x_v_ops
2294 = {wexti_ops, /* Types */
2295 OP_TYPE_x_v, /* Suffix */
2296 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2297 x_x_v_args /* Args */};
2299 /* A static operand information for vector_type func (unsigned double demote
2300 * type) function registration. */
2301 static CONSTEXPR const rvv_op_info u_x_x_v_ops
2302 = {wextu_ops, /* Types */
2303 OP_TYPE_x_v, /* Suffix */
2304 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2305 x_x_v_args /* Args */};
2307 /* A static operand information for double demote type func (vector_type,
2308 * shift_type) function registration. */
2309 static CONSTEXPR const rvv_op_info i_narrow_shift_vwv_ops
2310 = {wexti_ops, /* Types */
2311 OP_TYPE_wv, /* Suffix */
2312 rvv_arg_type_info (RVV_BASE_double_trunc_vector), /* Return type */
2313 shift_wv_args /* Args */};
2315 /* A static operand information for double demote type func (vector_type,
2316 * shift_type) function registration. */
2317 static CONSTEXPR const rvv_op_info u_narrow_shift_vwv_ops
2318 = {wextu_ops, /* Types */
2319 OP_TYPE_wv, /* Suffix */
2320 rvv_arg_type_info (RVV_BASE_double_trunc_vector), /* Return type */
2321 shift_wv_args /* Args */};
2323 /* A static operand information for double demote type func (vector_type,
2324 * size_t) function registration. */
2325 static CONSTEXPR const rvv_op_info i_narrow_shift_vwx_ops
2326 = {wexti_ops, /* Types */
2327 OP_TYPE_wx, /* Suffix */
2328 rvv_arg_type_info (RVV_BASE_double_trunc_vector), /* Return type */
2329 v_size_args /* Args */};
2331 /* A static operand information for double demote type func (vector_type,
2332 * size_t) function registration. */
2333 static CONSTEXPR const rvv_op_info u_narrow_shift_vwx_ops
2334 = {wextu_ops, /* Types */
2335 OP_TYPE_wx, /* Suffix */
2336 rvv_arg_type_info (RVV_BASE_double_trunc_vector), /* Return type */
2337 v_size_args /* Args */};
2339 /* A static operand information for double demote type func (vector_type)
2340 * function registration. */
2341 static CONSTEXPR const rvv_op_info iu_trunc_ops
2342 = {wextiu_ops, /* Types */
2343 OP_TYPE_x_w, /* Suffix */
2344 rvv_arg_type_info (RVV_BASE_double_trunc_vector), /* Return type */
2345 v_args /* Args */};
2347 /* A static operand information for vector_type func (vector_type)
2348 * function registration. */
2349 static CONSTEXPR const rvv_op_info all_v_vset_lmul1_x2_ops
2350 = {lmul1_ops, /* Types */
2351 OP_TYPE_v, /* Suffix */
2352 rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), /* Return type */
2353 ext_x2_vset_args /* Args */};
2355 /* A static operand information for vector_type func (vector_type)
2356 * function registration. */
2357 static CONSTEXPR const rvv_op_info all_v_vset_lmul1_x4_ops
2358 = {lmul1_ops, /* Types */
2359 OP_TYPE_v, /* Suffix */
2360 rvv_arg_type_info (RVV_BASE_vlmul_ext_x4), /* Return type */
2361 ext_x4_vset_args /* Args */};
2363 /* A static operand information for vector_type func (vector_type)
2364 * function registration. */
2365 static CONSTEXPR const rvv_op_info all_v_vset_lmul1_x8_ops
2366 = {lmul1_ops, /* Types */
2367 OP_TYPE_v, /* Suffix */
2368 rvv_arg_type_info (RVV_BASE_vlmul_ext_x8), /* Return type */
2369 ext_x8_vset_args /* Args */};
2371 /* A static operand information for vector_type func (vector_type)
2372 * function registration. */
2373 static CONSTEXPR const rvv_op_info all_v_vset_lmul2_x2_ops
2374 = {lmul2_ops, /* Types */
2375 OP_TYPE_v, /* Suffix */
2376 rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), /* Return type */
2377 ext_x2_vset_args /* Args */};
2379 /* A static operand information for vector_type func (vector_type)
2380 * function registration. */
2381 static CONSTEXPR const rvv_op_info all_v_vset_lmul2_x4_ops
2382 = {lmul2_ops, /* Types */
2383 OP_TYPE_v, /* Suffix */
2384 rvv_arg_type_info (RVV_BASE_vlmul_ext_x4), /* Return type */
2385 ext_x4_vset_args /* Args */};
2387 /* A static operand information for vector_type func (vector_type)
2388 * function registration. */
2389 static CONSTEXPR const rvv_op_info all_v_vset_lmul4_x2_ops
2390 = {lmul4_ops, /* Types */
2391 OP_TYPE_v, /* Suffix */
2392 rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), /* Return type */
2393 ext_x2_vset_args /* Args */};
2395 /* A static operand information for vector_type func (vector_type)
2396 * function registration. */
2397 static CONSTEXPR const rvv_op_info all_v_vget_lmul1_x2_ops
2398 = {lmul1_ops, /* Types */
2399 OP_TYPE_v, /* Suffix */
2400 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2401 ext_x2_vget_args /* Args */};
2403 /* A static operand information for vector_type func (vector_type)
2404 * function registration. */
2405 static CONSTEXPR const rvv_op_info all_v_vget_lmul1_x4_ops
2406 = {lmul1_ops, /* Types */
2407 OP_TYPE_v, /* Suffix */
2408 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2409 ext_x4_vget_args /* Args */};
2411 /* A static operand information for vector_type func (vector_type)
2412 * function registration. */
2413 static CONSTEXPR const rvv_op_info all_v_vget_lmul1_x8_ops
2414 = {lmul1_ops, /* Types */
2415 OP_TYPE_v, /* Suffix */
2416 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2417 ext_x8_vget_args /* Args */};
2419 /* A static operand information for vector_type func (vector_type)
2420 * function registration. */
2421 static CONSTEXPR const rvv_op_info all_v_vget_lmul2_x2_ops
2422 = {lmul2_ops, /* Types */
2423 OP_TYPE_v, /* Suffix */
2424 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2425 ext_x2_vget_args /* Args */};
2427 /* A static operand information for vector_type func (vector_type)
2428 * function registration. */
2429 static CONSTEXPR const rvv_op_info all_v_vget_lmul2_x4_ops
2430 = {lmul2_ops, /* Types */
2431 OP_TYPE_v, /* Suffix */
2432 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2433 ext_x4_vget_args /* Args */};
2435 /* A static operand information for vector_type func (vector_type)
2436 * function registration. */
2437 static CONSTEXPR const rvv_op_info all_v_vget_lmul4_x2_ops
2438 = {lmul4_ops, /* Types */
2439 OP_TYPE_v, /* Suffix */
2440 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2441 ext_x2_vget_args /* Args */};
2443 /* A static operand information for size_t func () function registration. */
2444 static CONSTEXPR const rvv_op_info p_none_void_ops
2445 = {none_ops, /* Types */
2446 OP_TYPE_none, /* Suffix */
2447 rvv_arg_type_info (RVV_BASE_size), /* Return type */
2448 void_args /* Args */};
2450 /* A static operand information for unsigned long func () function registration. */
2451 static CONSTEXPR const rvv_op_info ul_none_void_ops
2452 = {none_ops, /* Types */
2453 OP_TYPE_none, /* Suffix */
2454 rvv_arg_type_info (RVV_BASE_unsigned_long), /* Return type */
2455 void_args /* Args */};
2457 /* A static operand information for vector_type func (vector_type)
2458 * function registration. */
2459 static CONSTEXPR const rvv_op_info all_v_vset_tuple_ops
2460 = {tuple_ops, /* Types */
2461 OP_TYPE_v, /* Suffix */
2462 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2463 tuple_vset_args /* Args */};
2465 /* A static operand information for vector_type func (vector_type)
2466 * function registration. */
2467 static CONSTEXPR const rvv_op_info all_v_vget_tuple_ops
2468 = {tuple_ops, /* Types */
2469 OP_TYPE_v, /* Suffix */
2470 rvv_arg_type_info (RVV_BASE_tuple_subpart), /* Return type */
2471 v_size_args /* Args */};
2473 /* A static operand information for vector_type func (const scalar_type *)
2474 * function registration. */
2475 static CONSTEXPR const rvv_op_info tuple_v_scalar_const_ptr_ops
2476 = {tuple_ops, /* Types */
2477 OP_TYPE_v, /* Suffix */
2478 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2479 scalar_const_ptr_args /* Args */};
2481 /* A static operand information for void func (scalar_type *, vector_type)
2482 * function registration. */
2483 static CONSTEXPR const rvv_op_info tuple_v_scalar_ptr_ops
2484 = {tuple_ops, /* Types */
2485 OP_TYPE_v, /* Suffix */
2486 rvv_arg_type_info (RVV_BASE_void), /* Return type */
2487 scalar_ptr_args /* Args */};
2489 /* A static operand information for vector_type func (const scalar_type *,
2490 * ptrdiff_t) function registration. */
2491 static CONSTEXPR const rvv_op_info tuple_v_scalar_const_ptr_ptrdiff_ops
2492 = {tuple_ops, /* Types */
2493 OP_TYPE_v, /* Suffix */
2494 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2495 scalar_const_ptr_ptrdiff_args /* Args */};
2497 /* A static operand information for void func (scalar_type *, ptrdiff_t,
2498 * vector_type) function registration. */
2499 static CONSTEXPR const rvv_op_info tuple_v_scalar_ptr_ptrdiff_ops
2500 = {tuple_ops, /* Types */
2501 OP_TYPE_v, /* Suffix */
2502 rvv_arg_type_info (RVV_BASE_void), /* Return type */
2503 scalar_ptr_ptrdiff_args /* Args */};
2505 /* A static operand information for vector_type func (const scalar_type *,
2506 * eew8_index_type) function registration. */
2507 static CONSTEXPR const rvv_op_info tuple_v_scalar_const_ptr_eew8_index_ops
2508 = {tuple_ops, /* Types */
2509 OP_TYPE_v, /* Suffix */
2510 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2511 scalar_const_ptr_eew8_index_args /* Args */};
2513 /* A static operand information for vector_type func (const scalar_type *,
2514 * eew16_index_type) function registration. */
2515 static CONSTEXPR const rvv_op_info tuple_v_scalar_const_ptr_eew16_index_ops
2516 = {tuple_ops, /* Types */
2517 OP_TYPE_v, /* Suffix */
2518 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2519 scalar_const_ptr_eew16_index_args /* Args */};
2521 /* A static operand information for vector_type func (const scalar_type *,
2522 * eew32_index_type) function registration. */
2523 static CONSTEXPR const rvv_op_info tuple_v_scalar_const_ptr_eew32_index_ops
2524 = {tuple_ops, /* Types */
2525 OP_TYPE_v, /* Suffix */
2526 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2527 scalar_const_ptr_eew32_index_args /* Args */};
2529 /* A static operand information for vector_type func (const scalar_type *,
2530 * eew64_index_type) function registration. */
2531 static CONSTEXPR const rvv_op_info tuple_v_scalar_const_ptr_eew64_index_ops
2532 = {tuple_ops, /* Types */
2533 OP_TYPE_v, /* Suffix */
2534 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2535 scalar_const_ptr_eew64_index_args /* Args */};
2537 /* A static operand information for void func (scalar_type *, eew8_index_type,
2538 * vector_type) function registration. */
2539 static CONSTEXPR const rvv_op_info tuple_v_scalar_ptr_eew8_index_ops
2540 = {tuple_ops, /* Types */
2541 OP_TYPE_v, /* Suffix */
2542 rvv_arg_type_info (RVV_BASE_void), /* Return type */
2543 scalar_ptr_eew8_index_args /* Args */};
2545 /* A static operand information for void func (scalar_type *, eew16_index_type,
2546 * vector_type) function registration. */
2547 static CONSTEXPR const rvv_op_info tuple_v_scalar_ptr_eew16_index_ops
2548 = {tuple_ops, /* Types */
2549 OP_TYPE_v, /* Suffix */
2550 rvv_arg_type_info (RVV_BASE_void), /* Return type */
2551 scalar_ptr_eew16_index_args /* Args */};
2553 /* A static operand information for void func (scalar_type *, eew32_index_type,
2554 * vector_type) function registration. */
2555 static CONSTEXPR const rvv_op_info tuple_v_scalar_ptr_eew32_index_ops
2556 = {tuple_ops, /* Types */
2557 OP_TYPE_v, /* Suffix */
2558 rvv_arg_type_info (RVV_BASE_void), /* Return type */
2559 scalar_ptr_eew32_index_args /* Args */};
2561 /* A static operand information for void func (scalar_type *, eew64_index_type,
2562 * vector_type) function registration. */
2563 static CONSTEXPR const rvv_op_info tuple_v_scalar_ptr_eew64_index_ops
2564 = {tuple_ops, /* Types */
2565 OP_TYPE_v, /* Suffix */
2566 rvv_arg_type_info (RVV_BASE_void), /* Return type */
2567 scalar_ptr_eew64_index_args /* Args */};
2569 /* A static operand information for vector_type func (const scalar_type *)
2570 * function registration. */
2571 static CONSTEXPR const rvv_op_info tuple_v_scalar_const_ptr_size_ptr_ops
2572 = {tuple_ops, /* Types */
2573 OP_TYPE_v, /* Suffix */
2574 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2575 scalar_const_ptr_size_ptr_args /* Args */};
2577 /* A static operand information for vector_type func (vector_type)
2578 * function registration. */
2579 static CONSTEXPR const rvv_op_info all_v_vcreate_tuple_ops
2580 = {tuple_ops, /* Types */
2581 OP_TYPE_v, /* Suffix */
2582 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2583 tuple_vcreate_args /* Args */};
2585 /* A static operand information for vector_type func () function registration.
2587 static CONSTEXPR const rvv_op_info all_none_void_tuple_ops
2588 = {tuple_ops, /* Types */
2589 OP_TYPE_none, /* Suffix */
2590 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2591 void_args /* Args */};
2593 /* A static operand information for vector_type func (vector_type)
2594 * function registration. */
2595 static CONSTEXPR const rvv_op_info all_v_vcreate_lmul1_x2_ops
2596 = {lmul1_ops, /* Types */
2597 OP_TYPE_v, /* Suffix */
2598 rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), /* Return type */
2599 ext_vcreate_args /* Args */};
2601 /* A static operand information for vector_type func (vector_type)
2602 * function registration. */
2603 static CONSTEXPR const rvv_op_info all_v_vcreate_lmul1_x4_ops
2604 = {lmul1_ops, /* Types */
2605 OP_TYPE_v, /* Suffix */
2606 rvv_arg_type_info (RVV_BASE_vlmul_ext_x4), /* Return type */
2607 ext_vcreate_args /* Args */};
2609 /* A static operand information for vector_type func (vector_type)
2610 * function registration. */
2611 static CONSTEXPR const rvv_op_info all_v_vcreate_lmul1_x8_ops
2612 = {lmul1_ops, /* Types */
2613 OP_TYPE_v, /* Suffix */
2614 rvv_arg_type_info (RVV_BASE_vlmul_ext_x8), /* Return type */
2615 ext_vcreate_args /* Args */};
2617 /* A static operand information for vector_type func (vector_type)
2618 * function registration. */
2619 static CONSTEXPR const rvv_op_info all_v_vcreate_lmul2_x2_ops
2620 = {lmul2_ops, /* Types */
2621 OP_TYPE_v, /* Suffix */
2622 rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), /* Return type */
2623 ext_vcreate_args /* Args */};
2625 /* A static operand information for vector_type func (vector_type)
2626 * function registration. */
2627 static CONSTEXPR const rvv_op_info all_v_vcreate_lmul2_x4_ops
2628 = {lmul2_ops, /* Types */
2629 OP_TYPE_v, /* Suffix */
2630 rvv_arg_type_info (RVV_BASE_vlmul_ext_x4), /* Return type */
2631 ext_vcreate_args /* Args */};
2633 /* A static operand information for vector_type func (vector_type)
2634 * function registration. */
2635 static CONSTEXPR const rvv_op_info all_v_vcreate_lmul4_x2_ops
2636 = {lmul4_ops, /* Types */
2637 OP_TYPE_v, /* Suffix */
2638 rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), /* Return type */
2639 ext_vcreate_args /* Args */};
2641 /* A static operand information for vector_type func (vector_type).
2642 Some ins just supports SEW=32, such as crypto vectol Zvkg extension.
2643 * function registration. */
2644 static CONSTEXPR const rvv_arg_type_info vs_lmul_x2_args[]
2645 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x2),
2646 rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};
2648 static CONSTEXPR const rvv_arg_type_info vs_lmul_x4_args[]
2649 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x4),
2650 rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};
2652 static CONSTEXPR const rvv_arg_type_info vs_lmul_x8_args[]
2653 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x8),
2654 rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};
2656 static CONSTEXPR const rvv_arg_type_info vs_lmul_x16_args[]
2657 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x16),
2658 rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};
2660 static CONSTEXPR const rvv_op_info u_vvv_crypto_sew32_ops
2661 = {crypto_sew32_ops, /* Types */
2662 OP_TYPE_vv, /* Suffix */
2663 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2664 vv_args /* Args */};
2666 static CONSTEXPR const rvv_op_info u_vvvv_crypto_sew32_ops
2667 = {crypto_sew32_ops, /* Types */
2668 OP_TYPE_vv, /* Suffix */
2669 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2670 vvv_args /* Args */};
2672 static CONSTEXPR const rvv_op_info u_vvv_size_crypto_sew32_ops
2673 = {crypto_sew32_ops, /* Types */
2674 OP_TYPE_vi, /* Suffix */
2675 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2676 vv_size_args /* Args */};
2678 static CONSTEXPR const rvv_op_info u_vv_size_crypto_sew32_ops
2679 = {crypto_sew32_ops, /* Types */
2680 OP_TYPE_vi, /* Suffix */
2681 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2682 v_size_args /* Args */};
2684 static CONSTEXPR const rvv_op_info u_vvs_crypto_sew32_ops
2685 = {crypto_sew32_ops, /* Types */
2686 OP_TYPE_vs, /* Suffix */
2687 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2688 vv_args /* Args */};
2690 static CONSTEXPR const rvv_op_info u_vvs_crypto_sew32_lmul_x2_ops
2691 = {crypto_sew32_ops, /* Types */
2692 OP_TYPE_vs, /* Suffix */
2693 rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), /* Return type */
2694 vs_lmul_x2_args /* Args */};
2696 static CONSTEXPR const rvv_op_info u_vvs_crypto_sew32_lmul_x4_ops
2697 = {crypto_sew32_ops, /* Types */
2698 OP_TYPE_vs, /* Suffix */
2699 rvv_arg_type_info (RVV_BASE_vlmul_ext_x4), /* Return type */
2700 vs_lmul_x4_args /* Args */};
2702 static CONSTEXPR const rvv_op_info u_vvs_crypto_sew32_lmul_x8_ops
2703 = {crypto_sew32_ops, /* Types */
2704 OP_TYPE_vs, /* Suffix */
2705 rvv_arg_type_info (RVV_BASE_vlmul_ext_x8), /* Return type */
2706 vs_lmul_x8_args /* Args */};
2708 static CONSTEXPR const rvv_op_info u_vvs_crypto_sew32_lmul_x16_ops
2709 = {crypto_sew32_ops, /* Types */
2710 OP_TYPE_vs, /* Suffix */
2711 rvv_arg_type_info (RVV_BASE_vlmul_ext_x16), /* Return type */
2712 vs_lmul_x16_args /* Args */};
2714 /* A static operand information for vector_type func (vector_type).
2715 Some ins just supports SEW=64, such as crypto vectol Zvbc extension
2716 vclmul.vv, vclmul.vx.
2717 * function registration. */
2718 static CONSTEXPR const rvv_op_info u_vvv_crypto_sew64_ops
2719 = {crypto_sew64_ops, /* Types */
2720 OP_TYPE_vv, /* Suffix */
2721 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2722 vv_args /* Args */};
2724 static CONSTEXPR const rvv_op_info u_vvx_crypto_sew64_ops
2725 = {crypto_sew64_ops, /* Types */
2726 OP_TYPE_vx, /* Suffix */
2727 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2728 vx_args /* Args */};
2730 static CONSTEXPR const rvv_op_info u_vvvv_crypto_sew64_ops
2731 = {crypto_sew64_ops, /* Types */
2732 OP_TYPE_vv, /* Suffix */
2733 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2734 vvv_args /* Args */};
2736 /* A list of all RVV base function types. */
2737 static CONSTEXPR const function_type_info function_types[] = {
2738 #define DEF_RVV_TYPE_INDEX( \
2739 VECTOR, MASK, SIGNED, UNSIGNED, EEW8_INDEX, EEW16_INDEX, EEW32_INDEX, \
2740 EEW64_INDEX, SHIFT, DOUBLE_TRUNC, QUAD_TRUNC, OCT_TRUNC, \
2741 DOUBLE_TRUNC_SCALAR, DOUBLE_TRUNC_SIGNED, DOUBLE_TRUNC_UNSIGNED, \
2742 DOUBLE_TRUNC_UNSIGNED_SCALAR, DOUBLE_TRUNC_FLOAT, FLOAT, LMUL1, WLMUL1, \
2743 EEW8_INTERPRET, EEW16_INTERPRET, EEW32_INTERPRET, EEW64_INTERPRET, \
2744 BOOL1_INTERPRET, BOOL2_INTERPRET, BOOL4_INTERPRET, BOOL8_INTERPRET, \
2745 BOOL16_INTERPRET, BOOL32_INTERPRET, BOOL64_INTERPRET, \
2746 SIGNED_EEW8_LMUL1_INTERPRET, SIGNED_EEW16_LMUL1_INTERPRET, \
2747 SIGNED_EEW32_LMUL1_INTERPRET, SIGNED_EEW64_LMUL1_INTERPRET, \
2748 UNSIGNED_EEW8_LMUL1_INTERPRET, UNSIGNED_EEW16_LMUL1_INTERPRET, \
2749 UNSIGNED_EEW32_LMUL1_INTERPRET, UNSIGNED_EEW64_LMUL1_INTERPRET, \
2750 X2_VLMUL_EXT, X4_VLMUL_EXT, X8_VLMUL_EXT, X16_VLMUL_EXT, X32_VLMUL_EXT, \
2751 X64_VLMUL_EXT, TUPLE_SUBPART) \
2753 VECTOR_TYPE_##VECTOR, \
2754 VECTOR_TYPE_INVALID, \
2755 VECTOR_TYPE_##MASK, \
2756 VECTOR_TYPE_##SIGNED, \
2757 VECTOR_TYPE_##UNSIGNED, \
2758 VECTOR_TYPE_INVALID, \
2759 VECTOR_TYPE_INVALID, \
2760 VECTOR_TYPE_INVALID, \
2761 VECTOR_TYPE_INVALID, \
2762 VECTOR_TYPE_INVALID, \
2763 VECTOR_TYPE_INVALID, \
2764 VECTOR_TYPE_INVALID, \
2765 VECTOR_TYPE_INVALID, \
2766 VECTOR_TYPE_INVALID, \
2767 VECTOR_TYPE_##EEW8_INDEX, \
2768 VECTOR_TYPE_##EEW16_INDEX, \
2769 VECTOR_TYPE_##EEW32_INDEX, \
2770 VECTOR_TYPE_##EEW64_INDEX, \
2771 VECTOR_TYPE_##SHIFT, \
2772 VECTOR_TYPE_##DOUBLE_TRUNC, \
2773 VECTOR_TYPE_##QUAD_TRUNC, \
2774 VECTOR_TYPE_##OCT_TRUNC, \
2775 VECTOR_TYPE_##DOUBLE_TRUNC_SCALAR, \
2776 VECTOR_TYPE_##DOUBLE_TRUNC_SIGNED, \
2777 VECTOR_TYPE_##DOUBLE_TRUNC_UNSIGNED, \
2778 VECTOR_TYPE_##DOUBLE_TRUNC_UNSIGNED_SCALAR, \
2779 VECTOR_TYPE_##DOUBLE_TRUNC_FLOAT, \
2780 VECTOR_TYPE_##FLOAT, \
2781 VECTOR_TYPE_##LMUL1, \
2782 VECTOR_TYPE_##WLMUL1, \
2783 VECTOR_TYPE_##EEW8_INTERPRET, \
2784 VECTOR_TYPE_##EEW16_INTERPRET, \
2785 VECTOR_TYPE_##EEW32_INTERPRET, \
2786 VECTOR_TYPE_##EEW64_INTERPRET, \
2787 VECTOR_TYPE_##BOOL1_INTERPRET, \
2788 VECTOR_TYPE_##BOOL2_INTERPRET, \
2789 VECTOR_TYPE_##BOOL4_INTERPRET, \
2790 VECTOR_TYPE_##BOOL8_INTERPRET, \
2791 VECTOR_TYPE_##BOOL16_INTERPRET, \
2792 VECTOR_TYPE_##BOOL32_INTERPRET, \
2793 VECTOR_TYPE_##BOOL64_INTERPRET, \
2794 VECTOR_TYPE_##SIGNED_EEW8_LMUL1_INTERPRET, \
2795 VECTOR_TYPE_##SIGNED_EEW16_LMUL1_INTERPRET, \
2796 VECTOR_TYPE_##SIGNED_EEW32_LMUL1_INTERPRET, \
2797 VECTOR_TYPE_##SIGNED_EEW64_LMUL1_INTERPRET, \
2798 VECTOR_TYPE_##UNSIGNED_EEW8_LMUL1_INTERPRET, \
2799 VECTOR_TYPE_##UNSIGNED_EEW16_LMUL1_INTERPRET, \
2800 VECTOR_TYPE_##UNSIGNED_EEW32_LMUL1_INTERPRET, \
2801 VECTOR_TYPE_##UNSIGNED_EEW64_LMUL1_INTERPRET, \
2802 VECTOR_TYPE_##X2_VLMUL_EXT, \
2803 VECTOR_TYPE_##X4_VLMUL_EXT, \
2804 VECTOR_TYPE_##X8_VLMUL_EXT, \
2805 VECTOR_TYPE_##X16_VLMUL_EXT, \
2806 VECTOR_TYPE_##X32_VLMUL_EXT, \
2807 VECTOR_TYPE_##X64_VLMUL_EXT, \
2808 VECTOR_TYPE_INVALID, \
2809 VECTOR_TYPE_##TUPLE_SUBPART, \
2811 #include "riscv-vector-builtins.def"
2812 }; // namespace riscv_vector
2814 /* A list of all RVV intrinsic functions. */
2815 static function_group_info function_groups[] = {
2816 #define DEF_RVV_FUNCTION(NAME, SHAPE, PREDS, OPS_INFO) \
2817 {#NAME, &bases::NAME, &shapes::SHAPE, PREDS, OPS_INFO, REQUIRED_EXTENSIONS},
2818 #include "riscv-vector-builtins-functions.def"
2821 /* The RVV types, with their built-in
2822 "__rvv..._t" name. Allow an index of NUM_VECTOR_TYPES, which always
2823 yields a null tree. */
2824 static GTY (()) tree abi_vector_types[NUM_VECTOR_TYPES + 1];
2826 /* Same, but with the riscv_vector.h "v..._t" name. */
2827 extern GTY (()) rvv_builtin_types_t builtin_types[NUM_VECTOR_TYPES + 1];
2828 rvv_builtin_types_t builtin_types[NUM_VECTOR_TYPES + 1];
2830 /* The list of all registered function decls, indexed by code. */
2831 static GTY (()) vec<registered_function *, va_gc> *registered_functions;
2833 /* All registered function decls, hashed on the function_instance
2834 that they implement. This is used for looking up implementations of
2835 overloaded functions. */
2836 static hash_table<registered_function_hasher> *function_table;
2838 /* All registered function decls, hashed on overload_name and argument list
2839 of the registered_function. This is used for looking up implementations
2840 of non-overloaded functions. */
2841 static hash_table<non_overloaded_registered_function_hasher>
2842 *non_overloaded_function_table;
2844 /* RAII class for enabling enough RVV features to define the built-in
2845 types and implement the riscv_vector.h pragma.
2847 Note: According to 'TYPE_MODE' macro implementation, we need set
2848 have_regs_of_mode[mode] to be true if we want to get the exact mode
2849 from 'TYPE_MODE'. However, have_regs_of_mode has not been set yet in
2850 targetm.init_builtins (). We need rvv_switcher to set have_regs_of_mode
2851 before targetm.init_builtins () and recover back have_regs_of_mode
2852 after targetm.init_builtins (). */
2853 class rvv_switcher
2855 public:
2856 rvv_switcher ();
2857 ~rvv_switcher ();
2859 private:
2860 bool m_old_have_regs_of_mode[MAX_MACHINE_MODE];
2863 rvv_switcher::rvv_switcher ()
2865 /* Set have_regs_of_mode before targetm.init_builtins (). */
2866 memcpy (m_old_have_regs_of_mode, have_regs_of_mode,
2867 sizeof (have_regs_of_mode));
2868 for (int i = 0; i < NUM_MACHINE_MODES; ++i)
2869 if (riscv_v_ext_vector_mode_p ((machine_mode) i))
2870 have_regs_of_mode[i] = true;
2873 rvv_switcher::~rvv_switcher ()
2875 /* Recover back have_regs_of_mode. */
2876 memcpy (have_regs_of_mode, m_old_have_regs_of_mode,
2877 sizeof (have_regs_of_mode));
2880 /* Add attribute NAME to ATTRS. */
2881 static tree
2882 add_attribute (const char *name, tree attrs)
2884 return tree_cons (get_identifier (name), NULL_TREE, attrs);
2887 /* Add type attributes to builtin type tree, currently only the mangled name. */
2888 static void
2889 add_vector_type_attribute (tree type, const char *mangled_name)
2891 tree mangled_name_tree = get_identifier (mangled_name);
2892 tree value = tree_cons (NULL_TREE, mangled_name_tree, NULL_TREE);
2893 TYPE_ATTRIBUTES (type)
2894 = tree_cons (get_identifier ("RVV type"), value, TYPE_ATTRIBUTES (type));
2897 /* Force TYPE to be a sizeless type. */
2898 static void
2899 make_type_sizeless (tree type)
2901 TYPE_ATTRIBUTES (type) = tree_cons (get_identifier ("RVV sizeless type"),
2902 NULL_TREE, TYPE_ATTRIBUTES (type));
2905 /* Return true if TYPE is a sizeless type. */
2906 static bool
2907 sizeless_type_p (const_tree type)
2909 if (type == error_mark_node)
2910 return NULL_TREE;
2911 return lookup_attribute ("RVV sizeless type", TYPE_ATTRIBUTES (type));
2914 /* If TYPE is an ABI-defined RVV type, return its attribute descriptor,
2915 otherwise return null. */
2916 tree
2917 lookup_vector_type_attribute (const_tree type)
2919 if (type == error_mark_node)
2920 return NULL_TREE;
2921 return lookup_attribute ("RVV type", TYPE_ATTRIBUTES (type));
2924 /* Return a representation of "const T *". */
2925 static tree
2926 build_const_pointer (tree t)
2928 return build_pointer_type (build_qualified_type (t, TYPE_QUAL_CONST));
2931 /* Helper function for register a single built-in RVV ABI type. */
2932 static void
2933 register_builtin_type (vector_type_index type, tree eltype, machine_mode mode)
2935 builtin_types[type].scalar = eltype;
2936 builtin_types[type].scalar_ptr = build_pointer_type (eltype);
2937 builtin_types[type].scalar_const_ptr = build_const_pointer (eltype);
2938 /* TODO: We currently just skip the register of the illegal RVV type.
2939 Ideally, we should report error message more friendly instead of
2940 reporting "unknown" type. Support more friendly error message in
2941 the future. */
2942 if (!riscv_v_ext_vector_mode_p (mode))
2943 return;
2945 tree vectype = build_vector_type_for_mode (eltype, mode);
2946 gcc_assert (VECTOR_MODE_P (TYPE_MODE (vectype)) && TYPE_MODE (vectype) == mode
2947 && TYPE_MODE_RAW (vectype) == mode && TYPE_ALIGN (vectype) <= 128
2948 && known_eq (tree_to_poly_uint64 (TYPE_SIZE (vectype)),
2949 GET_MODE_BITSIZE (mode)));
2950 vectype = build_distinct_type_copy (vectype);
2951 gcc_assert (vectype == TYPE_MAIN_VARIANT (vectype));
2952 SET_TYPE_STRUCTURAL_EQUALITY (vectype);
2953 TYPE_ARTIFICIAL (vectype) = 1;
2954 TYPE_INDIVISIBLE_P (vectype) = 1;
2955 add_vector_type_attribute (vectype, vector_types[type].mangled_name);
2956 make_type_sizeless (vectype);
2957 abi_vector_types[type] = vectype;
2958 lang_hooks.types.register_builtin_type (vectype, vector_types[type].abi_name);
2961 /* Register the tuple type that contains NUM_VECTORS vectors of type TYPE. */
2962 static void
2963 register_tuple_type (vector_type_index type, vector_type_index subpart_type,
2964 tree eltype, unsigned int nf)
2966 /* TODO: We currently just skip the register of the illegal RVV type.
2967 Ideally, we should report error message more friendly instead of
2968 reporting "unknown" type. Support more friendly error message in
2969 the future. */
2970 if (!abi_vector_types[subpart_type])
2971 return;
2972 tree tuple_type = lang_hooks.types.make_type (RECORD_TYPE);
2974 /* The contents of the type are opaque, so we can define them in any
2975 way that maps to the correct ABI type.
2977 Here we choose to use the same layout as for riscv_vector.h, with
2978 "__val":
2980 struct vfooxN_t { vfoo_t __val[N]; };
2982 (It wouldn't be possible to write that directly in C or C++ for
2983 sizeless types, but that's not a problem for this function.)
2985 Using arrays simplifies the handling of vget and vset for variable
2986 arguments. */
2987 tree array_type = build_array_type_nelts (abi_vector_types[subpart_type], nf);
2988 gcc_assert (array_type);
2989 gcc_assert (VECTOR_MODE_P (TYPE_MODE (array_type))
2990 && TYPE_MODE_RAW (array_type) == TYPE_MODE (array_type));
2992 tree field = build_decl (input_location, FIELD_DECL, get_identifier ("__val"),
2993 array_type);
2994 DECL_FIELD_CONTEXT (field) = tuple_type;
2995 TYPE_FIELDS (tuple_type) = field;
2996 add_vector_type_attribute (tuple_type, vector_types[type].mangled_name);
2997 make_type_sizeless (tuple_type);
2998 layout_type (tuple_type);
2999 gcc_assert (VECTOR_MODE_P (TYPE_MODE (tuple_type))
3000 && TYPE_MODE_RAW (tuple_type) == TYPE_MODE (tuple_type));
3002 tree decl
3003 = build_decl (input_location, TYPE_DECL,
3004 get_identifier (vector_types[type].abi_name), tuple_type);
3005 TYPE_NAME (tuple_type) = decl;
3006 TYPE_STUB_DECL (tuple_type) = decl;
3007 lang_hooks.decls.pushdecl (decl);
3008 /* ??? Undo the effect of set_underlying_type for C. The C frontend
3009 doesn't recognize DECL as a built-in because (as intended) the decl has
3010 a real location instead of BUILTINS_LOCATION. The frontend therefore
3011 treats the decl like a normal C "typedef struct foo foo;", expecting
3012 the type for tag "struct foo" to have a dummy unnamed TYPE_DECL instead
3013 of the named one we attached above. It then sets DECL_ORIGINAL_TYPE
3014 on the supposedly unnamed decl, creating a circularity that upsets
3015 dwarf2out.
3017 We don't want to follow the normal C model and create "struct foo"
3018 tags for tuple types since (a) the types are supposed to be opaque
3019 and (b) they couldn't be defined as a real struct anyway. Treating
3020 the TYPE_DECLs as "typedef struct foo foo;" without creating
3021 "struct foo" would lead to confusing error messages. */
3022 DECL_ORIGINAL_TYPE (decl) = NULL_TREE;
3024 builtin_types[type].scalar = eltype;
3025 builtin_types[type].scalar_ptr = build_pointer_type (eltype);
3026 builtin_types[type].scalar_const_ptr = build_const_pointer (eltype);
3027 abi_vector_types[type] = tuple_type;
3030 /* Register the built-in RVV ABI types, such as __rvv_int32m1_t. */
3031 static void
3032 register_builtin_types ()
3034 /* Get type node from get_typenode_from_name to prevent we have different type
3035 node define in different target libraries, e.g. int32_t defined as
3036 `long` in RV32/newlib-stdint, but `int` for RV32/glibc-stdint.h.
3037 NOTE: uint[16|32|64]_type_node already defined in tree.h. */
3038 tree int8_type_node = get_typenode_from_name (INT8_TYPE);
3039 tree uint8_type_node = get_typenode_from_name (UINT8_TYPE);
3040 tree int16_type_node = get_typenode_from_name (INT16_TYPE);
3041 tree int32_type_node = get_typenode_from_name (INT32_TYPE);
3042 tree int64_type_node = get_typenode_from_name (INT64_TYPE);
3044 machine_mode mode;
3045 #define DEF_RVV_TYPE(NAME, NCHARS, ABI_NAME, SCALAR_TYPE, VECTOR_MODE, \
3046 ARGS...) \
3047 mode = VECTOR_MODE##mode; \
3048 register_builtin_type (VECTOR_TYPE_##NAME, SCALAR_TYPE##_type_node, mode);
3049 #define DEF_RVV_TUPLE_TYPE(NAME, NCHARS, ABI_NAME, SUBPART_TYPE, SCALAR_TYPE, \
3050 NF, VECTOR_SUFFIX) \
3051 register_tuple_type (VECTOR_TYPE_##NAME, VECTOR_TYPE_##SUBPART_TYPE, \
3052 SCALAR_TYPE##_type_node, NF);
3053 #include "riscv-vector-builtins.def"
3056 /* Register vector type TYPE under its risv_vector.h name. */
3057 static void
3058 register_vector_type (vector_type_index type)
3060 tree vectype = abi_vector_types[type];
3062 /* When vectype is NULL, the corresponding builtin type
3063 is disabled according to '-march'. */
3064 /* TODO: We currently just skip the register of the illegal RVV type.
3065 Ideally, we should report error message more friendly instead of
3066 reporting "unknown" type. Support more friendly error message in
3067 the future. */
3068 if (!vectype)
3069 return;
3070 tree id = get_identifier (vector_types[type].name);
3071 tree decl = build_decl (input_location, TYPE_DECL, id, vectype);
3072 decl = lang_hooks.decls.pushdecl (decl);
3074 /* Record the new RVV type if pushdecl succeeded without error. Use
3075 the ABI type otherwise, so that the type we record at least has the
3076 right form, even if it doesn't have the right name. This should give
3077 better error recovery behavior than installing error_mark_node or
3078 installing an incorrect type. */
3079 if (decl && TREE_CODE (decl) == TYPE_DECL
3080 && TREE_TYPE (decl) != error_mark_node
3081 && TYPE_MAIN_VARIANT (TREE_TYPE (decl)) == vectype)
3082 vectype = TREE_TYPE (decl);
3084 builtin_types[type].vector = vectype;
3085 builtin_types[type].vector_ptr = build_pointer_type (vectype);
3088 /* Return true if the type has required_extensions. */
3089 static bool
3090 required_extensions_p (enum rvv_base_type type)
3092 switch (type)
3094 case RVV_BASE_eew8_index:
3095 case RVV_BASE_eew16_index:
3096 case RVV_BASE_eew32_index:
3097 case RVV_BASE_eew64_index:
3098 case RVV_BASE_float_vector:
3099 case RVV_BASE_double_trunc_float_vector:
3100 case RVV_BASE_double_trunc_vector:
3101 case RVV_BASE_widen_lmul1_vector:
3102 case RVV_BASE_eew8_interpret:
3103 case RVV_BASE_eew16_interpret:
3104 case RVV_BASE_eew32_interpret:
3105 case RVV_BASE_eew64_interpret:
3106 case RVV_BASE_bool1_interpret:
3107 case RVV_BASE_bool2_interpret:
3108 case RVV_BASE_bool4_interpret:
3109 case RVV_BASE_bool8_interpret:
3110 case RVV_BASE_bool16_interpret:
3111 case RVV_BASE_bool32_interpret:
3112 case RVV_BASE_bool64_interpret:
3113 case RVV_BASE_signed_eew8_lmul1_interpret:
3114 case RVV_BASE_signed_eew16_lmul1_interpret:
3115 case RVV_BASE_signed_eew32_lmul1_interpret:
3116 case RVV_BASE_signed_eew64_lmul1_interpret:
3117 case RVV_BASE_unsigned_eew8_lmul1_interpret:
3118 case RVV_BASE_unsigned_eew16_lmul1_interpret:
3119 case RVV_BASE_unsigned_eew32_lmul1_interpret:
3120 case RVV_BASE_unsigned_eew64_lmul1_interpret:
3121 case RVV_BASE_vlmul_ext_x2:
3122 case RVV_BASE_vlmul_ext_x4:
3123 case RVV_BASE_vlmul_ext_x8:
3124 case RVV_BASE_vlmul_ext_x16:
3125 case RVV_BASE_vlmul_ext_x32:
3126 case RVV_BASE_vlmul_ext_x64:
3127 return true;
3128 default:
3129 return false;
3132 gcc_unreachable ();
3135 static uint64_t
3136 get_required_extensions (vector_type_index type_idx)
3138 for (unsigned int i = 0; all_ops[i].index != NUM_VECTOR_TYPES; i++)
3139 if (type_idx == all_ops[i].index)
3140 return all_ops[i].required_extensions;
3141 for (unsigned int i = 0; b_ops[i].index != NUM_VECTOR_TYPES; i++)
3142 if (type_idx == b_ops[i].index)
3143 return b_ops[i].required_extensions;
3144 gcc_unreachable ();
3147 /* Check whether all the RVV_REQUIRE_* values in REQUIRED_EXTENSIONS are
3148 enabled. */
3149 static bool
3150 check_required_extensions (const function_instance &instance)
3152 rvv_type_info type_info = instance.type;
3153 uint64_t required_extensions = type_info.required_extensions;
3154 const rvv_op_info *op_info = instance.op_info;
3156 if (required_extensions_p (op_info->ret.base_type))
3158 enum vector_type_index ret_type_idx
3159 = op_info->ret.get_function_type_index (type_info.index);
3160 if (ret_type_idx == NUM_VECTOR_TYPES)
3161 return false;
3162 required_extensions |= get_required_extensions (ret_type_idx);
3165 for (unsigned i = 0; op_info->args[i].base_type != NUM_BASE_TYPES; ++i)
3167 if (!required_extensions_p (op_info->args[i].base_type))
3168 continue;
3170 enum vector_type_index vector_type
3171 = op_info->args[i].get_function_type_index (type_info.index);
3172 if (vector_type == NUM_VECTOR_TYPES)
3173 return false;
3174 required_extensions |= get_required_extensions (vector_type);
3176 /* According to RVV ISA, EEW=64 index of indexed loads/stores require
3177 XLEN = 64. */
3178 if (op_info->args[i].base_type == RVV_BASE_eew64_index)
3179 required_extensions |= RVV_REQUIRE_RV64BIT;
3182 uint64_t riscv_isa_flags = 0;
3184 if (TARGET_VECTOR_ELEN_FP_16)
3185 riscv_isa_flags |= RVV_REQUIRE_ELEN_FP_16;
3186 if (TARGET_VECTOR_ELEN_FP_32)
3187 riscv_isa_flags |= RVV_REQUIRE_ELEN_FP_32;
3188 if (TARGET_VECTOR_ELEN_FP_64)
3189 riscv_isa_flags |= RVV_REQUIRE_ELEN_FP_64;
3190 if (TARGET_VECTOR_ELEN_64)
3191 riscv_isa_flags |= RVV_REQUIRE_ELEN_64;
3192 if (TARGET_64BIT)
3193 riscv_isa_flags |= RVV_REQUIRE_RV64BIT;
3194 if (TARGET_FULL_V)
3195 riscv_isa_flags |= RVV_REQUIRE_FULL_V;
3196 if (TARGET_MIN_VLEN > 32)
3197 riscv_isa_flags |= RVV_REQUIRE_MIN_VLEN_64;
3199 uint64_t missing_extensions = required_extensions & ~riscv_isa_flags;
3200 if (missing_extensions != 0)
3201 return false;
3202 return true;
3205 /* Return true if predication is using a real mask operand. */
3206 static bool
3207 use_real_mask_p (enum predication_type_index pred)
3209 return pred == PRED_TYPE_m || pred == PRED_TYPE_tum || pred == PRED_TYPE_tumu
3210 || pred == PRED_TYPE_mu;
3213 /* Return true if predication is using a real merge operand. */
3214 static bool
3215 use_real_merge_p (enum predication_type_index pred)
3217 return pred == PRED_TYPE_tu || pred == PRED_TYPE_tum || pred == PRED_TYPE_tumu
3218 || pred == PRED_TYPE_mu;
3221 /* Get TAIL policy for predication. If predication indicates TU, return the TU.
3222 Otherwise, return the prefer default configuration. */
3223 static rtx
3224 get_tail_policy_for_pred (enum predication_type_index pred)
3226 if (pred == PRED_TYPE_tu || pred == PRED_TYPE_tum || pred == PRED_TYPE_tumu)
3227 return gen_int_mode (TAIL_UNDISTURBED, Pmode);
3228 return gen_int_mode (get_prefer_tail_policy (), Pmode);
3231 /* Get MASK policy for predication. If predication indicates MU, return the MU.
3232 Otherwise, return the prefer default configuration. */
3233 static rtx
3234 get_mask_policy_for_pred (enum predication_type_index pred)
3236 if (pred == PRED_TYPE_tumu || pred == PRED_TYPE_mu)
3237 return gen_int_mode (MASK_UNDISTURBED, Pmode);
3238 return gen_int_mode (get_prefer_mask_policy (), Pmode);
3241 tree
3242 rvv_arg_type_info::get_scalar_ptr_type (vector_type_index type_idx) const
3244 /* According to the latest rvv-intrinsic-doc, it defines vsm.v intrinsic:
3245 __riscv_vsm (uint8_t *base, vbool1_t value, size_t vl). */
3246 if (type_idx >= VECTOR_TYPE_vbool64_t && type_idx <= VECTOR_TYPE_vbool1_t)
3247 return builtin_types[VECTOR_TYPE_vuint8mf8_t].scalar_ptr;
3248 else
3249 return builtin_types[type_idx].scalar_ptr;
3252 tree
3253 rvv_arg_type_info::get_scalar_const_ptr_type (vector_type_index type_idx) const
3255 /* According to the latest rvv-intrinsic-doc, it defines vlm.v intrinsic:
3256 __riscv_vlm_v_b1 (const uint8_t *base, size_t vl). */
3257 if (type_idx >= VECTOR_TYPE_vbool64_t && type_idx <= VECTOR_TYPE_vbool1_t)
3258 return builtin_types[VECTOR_TYPE_vuint8mf8_t].scalar_const_ptr;
3259 else
3260 return builtin_types[type_idx].scalar_const_ptr;
3263 vector_type_index
3264 rvv_arg_type_info::get_function_type_index (vector_type_index type_idx) const
3266 tree type
3267 = builtin_types[function_types[type_idx].type_indexes[base_type]].vector;
3268 return type ? function_types[type_idx].type_indexes[base_type]
3269 : NUM_VECTOR_TYPES;
3272 tree
3273 rvv_arg_type_info::get_tree_type (vector_type_index type_idx) const
3275 /* If the builtin type is not registered means '-march' doesn't
3276 satisfy the require extension of the type. For example,
3277 vfloat32m1_t require floating-point extension. In this case,
3278 just return NULL_TREE. */
3279 if (type_idx != VECTOR_TYPE_INVALID && !builtin_types[type_idx].vector)
3280 return NULL_TREE;
3282 switch (base_type)
3284 #define DEF_RVV_BASE_TYPE(NAME, TYPE) \
3285 case RVV_BASE_##NAME: \
3286 return TYPE;
3287 #include "riscv-vector-builtins.def"
3288 default:
3289 gcc_unreachable ();
3291 gcc_unreachable ();
3294 tree
3295 rvv_arg_type_info::get_tuple_subpart_type (vector_type_index type_idx) const
3297 switch (type_idx)
3299 #define DEF_RVV_TUPLE_TYPE(NAME, NCHARS, ABI_NAME, SUBPART_TYPE, ARGS...) \
3300 case VECTOR_TYPE_##NAME: \
3301 return builtin_types[VECTOR_TYPE_##SUBPART_TYPE].vector;
3302 #include "riscv-vector-builtins.def"
3303 default:
3304 gcc_unreachable ();
3306 gcc_unreachable ();
3309 function_instance::function_instance (const char *base_name_in,
3310 const function_base *base_in,
3311 const function_shape *shape_in,
3312 rvv_type_info type_in,
3313 predication_type_index pred_in,
3314 const rvv_op_info *op_info_in)
3315 : base_name (base_name_in), base (base_in), shape (shape_in), type (type_in),
3316 pred (pred_in), op_info (op_info_in)
3320 bool
3321 function_instance::operator== (const function_instance &other) const
3323 for (unsigned int i = 0; op_info->args[i].base_type != NUM_BASE_TYPES; ++i)
3324 if (op_info->args[i].base_type != other.op_info->args[i].base_type)
3325 return false;
3326 return (base == other.base && shape == other.shape
3327 && type.index == other.type.index && op_info->op == other.op_info->op
3328 && pred == other.pred
3329 && op_info->ret.base_type == other.op_info->ret.base_type);
3332 bool
3333 function_instance::any_type_float_p () const
3335 if (FLOAT_MODE_P (TYPE_MODE (get_return_type ())))
3336 return true;
3338 for (int i = 0; op_info->args[i].base_type != NUM_BASE_TYPES; ++i)
3339 if (FLOAT_MODE_P (TYPE_MODE (get_arg_type (i))))
3340 return true;
3342 return false;
3345 tree
3346 function_instance::get_return_type () const
3348 return op_info->ret.get_tree_type (type.index);
3351 tree
3352 function_instance::get_arg_type (unsigned opno) const
3354 return op_info->args[opno].get_tree_type (type.index);
3357 /* Return a hash code for a function_instance. */
3358 hashval_t
3359 function_instance::hash () const
3361 inchash::hash h;
3362 /* BASE uniquely determines BASE_NAME, so we don't need to hash both. */
3363 h.add_ptr (base);
3364 h.add_ptr (shape);
3365 h.add_int (type.index);
3366 h.add_int (op_info->op);
3367 h.add_int (pred);
3368 h.add_int (op_info->ret.base_type);
3369 for (unsigned int i = 0; op_info->args[i].base_type != NUM_BASE_TYPES; ++i)
3370 h.add_int (op_info->args[i].base_type);
3371 return h.end ();
3374 /* Return a set of CP_* flags that describe what the function could do,
3375 taking the command-line flags into account. */
3376 unsigned int
3377 function_instance::call_properties () const
3379 unsigned int flags = base->call_properties (*this);
3381 /* -fno-trapping-math means that we can assume any FP exceptions
3382 are not user-visible. */
3383 if (!flag_trapping_math)
3384 flags &= ~CP_RAISE_FP_EXCEPTIONS;
3386 return flags;
3389 /* Return true if calls to the function could read some form of
3390 global state. */
3391 bool
3392 function_instance::reads_global_state_p () const
3394 unsigned int flags = call_properties ();
3396 /* Preserve any dependence on rounding mode, flush to zero mode, etc.
3397 There is currently no way of turning this off; in particular,
3398 -fno-rounding-math (which is the default) means that we should make
3399 the usual assumptions about rounding mode, which for intrinsics means
3400 acting as the instructions do. */
3401 if (flags & CP_READ_FPCR)
3402 return true;
3404 /* Handle direct reads of global state. */
3405 return flags & (CP_READ_MEMORY | CP_READ_CSR);
3408 /* Return true if calls to the function could modify some form of
3409 global state. */
3410 bool
3411 function_instance::modifies_global_state_p () const
3413 unsigned int flags = call_properties ();
3415 /* Preserve any exception state written back to the FPCR,
3416 unless -fno-trapping-math says this is unnecessary. */
3417 if (flags & CP_RAISE_FP_EXCEPTIONS)
3418 return true;
3420 /* Handle direct modifications of global state. */
3421 return flags & (CP_WRITE_MEMORY | CP_WRITE_CSR);
3424 /* Return true if calls to the function could raise a signal. */
3425 bool
3426 function_instance::could_trap_p () const
3428 unsigned int flags = call_properties ();
3430 /* Handle functions that could raise SIGFPE. */
3431 if (flags & CP_RAISE_FP_EXCEPTIONS)
3432 return true;
3434 /* Handle functions that could raise SIGBUS or SIGSEGV. */
3435 if (flags & (CP_READ_MEMORY | CP_WRITE_MEMORY))
3436 return true;
3438 return false;
3441 function_builder::function_builder ()
3443 m_direct_overloads = lang_GNU_CXX ();
3444 gcc_obstack_init (&m_string_obstack);
3447 function_builder::~function_builder ()
3449 obstack_free (&m_string_obstack, NULL);
3452 /* Allocate arguments of the function. */
3453 void
3454 function_builder::allocate_argument_types (const function_instance &instance,
3455 vec<tree> &argument_types) const
3457 for (unsigned int i = 0;
3458 instance.op_info->args[i].base_type != NUM_BASE_TYPES; ++i)
3459 argument_types.quick_push (
3460 instance.op_info->args[i].get_tree_type (instance.type.index));
3463 /* Apply predication into argument_types. */
3464 void
3465 function_builder::apply_predication (const function_instance &instance,
3466 tree return_type,
3467 vec<tree> &argument_types) const
3469 /* These predication types need to apply merge type. */
3470 if (instance.base->has_merge_operand_p ())
3471 if (instance.pred == PRED_TYPE_tu || instance.pred == PRED_TYPE_tum
3472 || instance.pred == PRED_TYPE_tumu || instance.pred == PRED_TYPE_mu)
3473 argument_types.quick_insert (0, return_type);
3475 /* These predication types need to apply mask type. */
3476 vector_type_index mask_type_index
3477 = function_types[instance.type.index].type_indexes[RVV_BASE_mask];
3478 tree mask_type = builtin_types[mask_type_index].vector;
3479 if (instance.pred == PRED_TYPE_m || instance.pred == PRED_TYPE_tum
3480 || instance.pred == PRED_TYPE_tumu || instance.pred == PRED_TYPE_mu)
3481 argument_types.quick_insert (0, mask_type);
3483 /* check if rounding mode parameter need */
3484 if (instance.base->has_rounding_mode_operand_p ())
3485 argument_types.quick_push (unsigned_type_node);
3487 /* check if vl parameter need */
3488 if (instance.base->apply_vl_p ())
3489 argument_types.quick_push (size_type_node);
3492 /* Register all the functions in GROUP. */
3493 void
3494 function_builder::register_function_group (const function_group_info &group)
3496 (*group.shape)->build (*this, group);
3499 /* Add NAME to the end of the function name being built. */
3500 void
3501 function_builder::append_name (const char *name)
3503 obstack_grow (&m_string_obstack, name, strlen (name));
3506 /* Add "__riscv_" and "name". */
3507 void
3508 function_builder::append_base_name (const char *name)
3510 append_name ("__riscv_");
3511 append_name (name);
3514 /* Add SEW into function name. */
3515 void
3516 function_builder::append_sew (int sew)
3518 switch (sew)
3520 case 8:
3521 append_name ("8");
3522 break;
3523 case 16:
3524 append_name ("16");
3525 break;
3526 case 32:
3527 append_name ("32");
3528 break;
3529 case 64:
3530 append_name ("64");
3531 break;
3532 default:
3533 gcc_unreachable ();
3537 /* Add NF into function name. */
3538 void
3539 function_builder::append_nf (int nf)
3541 switch (nf)
3543 case 2:
3544 append_name ("2");
3545 break;
3546 case 3:
3547 append_name ("3");
3548 break;
3549 case 4:
3550 append_name ("4");
3551 break;
3552 case 5:
3553 append_name ("5");
3554 break;
3555 case 6:
3556 append_name ("6");
3557 break;
3558 case 7:
3559 append_name ("7");
3560 break;
3561 case 8:
3562 append_name ("8");
3563 break;
3564 default:
3565 gcc_unreachable ();
3569 /* Zero-terminate and complete the function name being built. */
3570 char *
3571 function_builder::finish_name ()
3573 obstack_1grow (&m_string_obstack, 0);
3574 return (char *) obstack_finish (&m_string_obstack);
3577 /* Return the appropriate function attributes for INSTANCE. */
3578 tree
3579 function_builder::get_attributes (const function_instance &instance)
3581 tree attrs = NULL_TREE;
3583 if (!instance.modifies_global_state_p ())
3585 if (instance.reads_global_state_p ())
3586 attrs = add_attribute ("pure", attrs);
3587 else
3588 attrs = add_attribute ("const", attrs);
3591 if (!flag_non_call_exceptions || !instance.could_trap_p ())
3592 attrs = add_attribute ("nothrow", attrs);
3594 return add_attribute ("leaf", attrs);
3597 /* Add a function called NAME with type FNTYPE and attributes ATTRS.
3598 INSTANCE describes what the function does. */
3599 registered_function &
3600 function_builder::add_function (const function_instance &instance,
3601 const char *name, tree fntype, tree attrs,
3602 bool placeholder_p, const char *overload_name,
3603 const vec<tree> &argument_types,
3604 bool overloaded_p = false)
3606 unsigned int code = vec_safe_length (registered_functions);
3607 code = (code << RISCV_BUILTIN_SHIFT) + RISCV_BUILTIN_VECTOR;
3609 /* We need to be able to generate placeholders to enusre that we have a
3610 consistent numbering scheme for function codes between the C and C++
3611 frontends, so that everything ties up in LTO.
3613 Currently, tree-streamer-in.c:unpack_ts_function_decl_value_fields
3614 validates that tree nodes returned by TARGET_BUILTIN_DECL are non-NULL and
3615 some node other than error_mark_node. This is a holdover from when builtin
3616 decls were streamed by code rather than by value.
3618 Ultimately, we should be able to remove this validation of BUILT_IN_MD
3619 nodes and remove the target hook. For now, however, we need to appease the
3620 validation and return a non-NULL, non-error_mark_node node, so we
3621 arbitrarily choose integer_zero_node. */
3622 tree decl = placeholder_p
3623 ? integer_zero_node
3624 : simulate_builtin_function_decl (input_location, name, fntype,
3625 code, NULL, attrs);
3627 registered_function &rfn = *ggc_alloc<registered_function> ();
3628 rfn.instance = instance;
3629 rfn.decl = decl;
3630 rfn.overload_name = overload_name ? xstrdup (overload_name) : NULL;
3631 rfn.argument_types = argument_types;
3632 rfn.overloaded_p = overloaded_p;
3633 vec_safe_push (registered_functions, &rfn);
3635 return rfn;
3638 /* Add a built-in function for INSTANCE, with the argument types given
3639 by ARGUMENT_TYPES and the return type given by RETURN_TYPE. NAME is
3640 the "full" name for C function. OVERLOAD_NAME is the "short" name for
3641 C++ overloaded function. OVERLOAD_NAME can be nullptr because some
3642 instance doesn't have C++ overloaded function. */
3643 void
3644 function_builder::add_unique_function (const function_instance &instance,
3645 const function_shape *shape,
3646 tree return_type,
3647 vec<tree> &argument_types)
3649 /* Do not add this function if it is invalid. */
3650 if (!check_required_extensions (instance))
3651 return;
3653 /* Also add the function under its overloaded alias, if we want
3654 a separate decl for each instance of an overloaded function. */
3655 char *overload_name = shape->get_name (*this, instance, true);
3657 /* Add the function under its full (unique) name. */
3658 char *name = shape->get_name (*this, instance, false);
3659 tree fntype
3660 = build_function_type_array (return_type, argument_types.length (),
3661 argument_types.address ());
3662 tree attrs = get_attributes (instance);
3663 registered_function &rfn
3664 = add_function (instance, name, fntype, attrs, false, overload_name,
3665 argument_types.copy ());
3667 /* Enter the function into the hash table. */
3668 hashval_t hash = instance.hash ();
3669 registered_function **rfn_slot
3670 = function_table->find_slot_with_hash (instance, hash, INSERT);
3671 gcc_assert (!*rfn_slot);
3672 *rfn_slot = &rfn;
3674 if (overload_name)
3676 /* Attribute lists shouldn't be shared. */
3677 tree attrs = get_attributes (instance);
3678 bool placeholder_p = !m_direct_overloads;
3679 add_function (instance, overload_name, fntype, attrs, placeholder_p, NULL,
3680 vNULL);
3682 /* Enter the function into the non-overloaded hash table. */
3683 hash = rfn.overloaded_hash ();
3684 rfn_slot = non_overloaded_function_table->find_slot_with_hash (&rfn, hash,
3685 INSERT);
3686 gcc_assert (!*rfn_slot);
3687 *rfn_slot = &rfn;
3689 obstack_free (&m_string_obstack, name);
3692 /* Add overloaded function for gcc. */
3693 void
3694 function_builder::add_overloaded_function (const function_instance &instance,
3695 const function_shape *shape)
3697 if (!check_required_extensions (instance))
3698 return;
3700 char *name = shape->get_name (*this, instance, true);
3702 if (name)
3704 /* To avoid API conflicting, take void return type and void argument
3705 for the overloaded function. */
3706 tree fntype = build_function_type (void_type_node, void_list_node);
3707 add_function (instance, name, fntype, NULL_TREE, m_direct_overloads, name,
3708 vNULL, true);
3709 obstack_free (&m_string_obstack, name);
3713 function_call_info::function_call_info (location_t location_in,
3714 const function_instance &instance_in,
3715 tree fndecl_in)
3716 : function_instance (instance_in), location (location_in), fndecl (fndecl_in)
3719 gimple_folder::gimple_folder (const function_instance &instance, tree fndecl,
3720 gimple_stmt_iterator *gsi_in, gcall *call_in)
3721 : function_call_info (gimple_location (call_in), instance, fndecl),
3722 gsi (gsi_in), call (call_in), lhs (gimple_call_lhs (call_in))
3726 /* Try to fold the call. Return the new statement on success and null
3727 on failure. */
3728 gimple *
3729 gimple_folder::fold ()
3731 /* Don't fold anything when RVV is disabled; emit an error during
3732 expansion instead. */
3733 if (!TARGET_VECTOR)
3734 return NULL;
3736 /* Punt if the function has a return type and no result location is
3737 provided. The attributes should allow target-independent code to
3738 remove the calls if appropriate. */
3739 if (!lhs && TREE_TYPE (gimple_call_fntype (call)) != void_type_node)
3740 return NULL;
3742 return base->fold (*this);
3745 function_expander::function_expander (const function_instance &instance,
3746 tree fndecl_in, tree exp_in,
3747 rtx target_in)
3748 : function_call_info (EXPR_LOCATION (exp_in), instance, fndecl_in),
3749 exp (exp_in), target (target_in), opno (0)
3751 if (!function_returns_void_p ())
3753 if (target != NULL_RTX && MEM_P (target))
3754 /* Since there is no intrinsic where target is a mem operand, it
3755 should be converted to reg if it is a mem operand. */
3756 target = force_reg (GET_MODE (target), target);
3757 create_output_operand (&m_ops[opno++], target,
3758 TYPE_MODE (TREE_TYPE (exp)));
3762 /* Take argument ARGNO from EXP's argument list and convert it into
3763 an expand operand. Store the operand in *M_OPS. */
3764 void
3765 function_expander::add_input_operand (unsigned argno)
3767 tree arg = CALL_EXPR_ARG (exp, argno);
3768 rtx x = expand_normal (arg);
3769 add_input_operand (TYPE_MODE (TREE_TYPE (arg)), x);
3772 /* Since we may normalize vop/vop_tu/vop_m/vop_tumu.. into a single patter.
3773 We add a undef for the intrinsics that don't need a real merge. */
3774 void
3775 function_expander::add_vundef_operand (machine_mode mode)
3777 add_input_operand (mode, RVV_VUNDEF (mode));
3780 /* Add a memory operand with mode MODE and address ADDR. */
3781 void
3782 function_expander::add_mem_operand (machine_mode mode, unsigned argno)
3784 gcc_assert (VECTOR_MODE_P (mode));
3785 rtx addr = expand_normal (CALL_EXPR_ARG (exp, argno));
3786 rtx mem = gen_rtx_MEM (mode, memory_address (mode, addr));
3787 /* The memory is only guaranteed to be element-aligned. */
3788 set_mem_align (mem, GET_MODE_ALIGNMENT (GET_MODE_INNER (mode)));
3789 add_fixed_operand (mem);
3792 /* Return the machine_mode of the corresponding mask type. */
3793 machine_mode
3794 function_expander::mask_mode (void) const
3796 vector_type_index mask_type_index
3797 = function_types[type.index].type_indexes[RVV_BASE_mask];
3798 return TYPE_MODE (builtin_types[mask_type_index].vector);
3801 /* Implement the call using instruction ICODE, with a 1:1 mapping between
3802 arguments and input operands. */
3804 function_expander::use_exact_insn (insn_code icode)
3806 machine_mode mode = TYPE_MODE (TREE_TYPE (exp));
3808 /* Record the offset to get the argument. */
3809 int arg_offset = 0;
3811 if (base->use_mask_predication_p ())
3813 if (use_real_mask_p (pred))
3814 add_input_operand (arg_offset++);
3815 else
3816 add_all_one_mask_operand (mask_mode ());
3819 /* Store operation doesn't have merge operand. */
3820 if (!function_returns_void_p () && base->has_merge_operand_p ())
3822 if (use_real_merge_p (pred))
3823 add_input_operand (arg_offset++);
3824 else
3825 add_vundef_operand (mode);
3828 for (int argno = arg_offset; argno < call_expr_nargs (exp); argno++)
3830 if (base->has_rounding_mode_operand_p ()
3831 && argno == call_expr_nargs (exp) - 2)
3833 /* Since the rounding mode argument position is not consistent with
3834 the instruction pattern, we need to skip rounding mode argument
3835 here. */
3836 continue;
3838 add_input_operand (argno);
3841 if (base->apply_tail_policy_p ())
3842 add_input_operand (Pmode, get_tail_policy_for_pred (pred));
3843 if (base->apply_mask_policy_p ())
3844 add_input_operand (Pmode, get_mask_policy_for_pred (pred));
3846 if (base->apply_vl_p ())
3847 add_input_operand (Pmode, get_avl_type_rtx (avl_type::NONVLMAX));
3849 if (base->has_rounding_mode_operand_p ())
3850 add_input_operand (call_expr_nargs (exp) - 2);
3852 /* The RVV floating-point only support dynamic rounding mode in the
3853 FRM register. */
3854 if (opno != insn_data[icode].n_generator_args)
3855 add_input_operand (Pmode, gen_int_mode (riscv_vector::FRM_DYN, Pmode));
3857 return generate_insn (icode);
3860 /* Use contiguous load INSN. */
3862 function_expander::use_contiguous_load_insn (insn_code icode)
3864 gcc_assert (call_expr_nargs (exp) > 0);
3865 machine_mode mode = TYPE_MODE (TREE_TYPE (exp));
3867 /* Record the offset to get the argument. */
3868 int arg_offset = 0;
3870 if (use_real_mask_p (pred))
3871 add_input_operand (arg_offset++);
3872 else
3873 add_all_one_mask_operand (mask_mode ());
3875 if (use_real_merge_p (pred))
3876 add_input_operand (arg_offset++);
3877 else
3878 add_vundef_operand (mode);
3880 add_mem_operand (mode, arg_offset++);
3882 for (int argno = arg_offset; argno < call_expr_nargs (exp); argno++)
3883 add_input_operand (argno);
3885 if (GET_MODE_CLASS (mode) != MODE_VECTOR_BOOL)
3887 add_input_operand (Pmode, get_tail_policy_for_pred (pred));
3888 add_input_operand (Pmode, get_mask_policy_for_pred (pred));
3891 if (opno != insn_data[icode].n_generator_args)
3892 add_input_operand (Pmode, get_avl_type_rtx (avl_type::NONVLMAX));
3894 return generate_insn (icode);
3897 /* Use contiguous store INSN. */
3899 function_expander::use_contiguous_store_insn (insn_code icode)
3901 gcc_assert (call_expr_nargs (exp) > 0);
3902 machine_mode mode = TYPE_MODE (builtin_types[type.index].vector);
3904 /* Record the offset to get the argument. */
3905 int arg_offset = 0;
3907 add_mem_operand (mode, use_real_mask_p (pred) ? 1 : 0);
3909 if (use_real_mask_p (pred))
3910 add_input_operand (arg_offset++);
3911 else
3912 add_all_one_mask_operand (mask_mode ());
3914 arg_offset++;
3915 for (int argno = arg_offset; argno < call_expr_nargs (exp); argno++)
3916 add_input_operand (argno);
3918 add_input_operand (Pmode, get_avl_type_rtx (avl_type::NONVLMAX));
3919 return generate_insn (icode);
3922 /* Implement the call using instruction ICODE, with a 1:1 mapping between
3923 arguments and input operands. */
3925 function_expander::use_compare_insn (rtx_code rcode, insn_code icode)
3927 machine_mode mode = TYPE_MODE (builtin_types[type.index].vector);
3928 machine_mode mask_mode = TYPE_MODE (TREE_TYPE (exp));
3930 /* Record the offset to get the argument. */
3931 int arg_offset = 0;
3933 if (use_real_mask_p (pred))
3934 add_input_operand (arg_offset++);
3935 else
3936 add_all_one_mask_operand (mask_mode);
3938 if (use_real_merge_p (pred))
3939 add_input_operand (arg_offset++);
3940 else
3941 add_vundef_operand (mask_mode);
3943 rtx op1 = expand_normal (CALL_EXPR_ARG (exp, arg_offset++));
3944 rtx op2 = expand_normal (CALL_EXPR_ARG (exp, arg_offset++));
3945 if (!insn_operand_matches (icode, opno + 1, op1))
3946 op1 = force_reg (mode, op1);
3947 if (!insn_operand_matches (icode, opno + 2, op2))
3949 if (VECTOR_MODE_P (GET_MODE (op2)))
3950 op2 = force_reg (mode, op2);
3951 else
3952 op2 = force_reg (GET_MODE_INNER (mode), op2);
3954 rtx comparison = gen_rtx_fmt_ee (rcode, mask_mode, op1, op2);
3955 if (!VECTOR_MODE_P (GET_MODE (op2)))
3956 comparison = gen_rtx_fmt_ee (rcode, mask_mode, op1,
3957 gen_rtx_VEC_DUPLICATE (mode, op2));
3958 add_fixed_operand (comparison);
3959 add_fixed_operand (op1);
3960 if (CONST_INT_P (op2))
3961 add_integer_operand (op2);
3962 else
3963 add_fixed_operand (op2);
3964 for (int argno = arg_offset; argno < call_expr_nargs (exp); argno++)
3965 add_input_operand (argno);
3967 add_input_operand (Pmode, get_mask_policy_for_pred (pred));
3968 add_input_operand (Pmode, get_avl_type_rtx (avl_type::NONVLMAX));
3969 return generate_insn (icode);
3972 /* Implement the call using instruction ICODE, with a 1:1 mapping between
3973 arguments and input operands. */
3975 function_expander::use_ternop_insn (bool vd_accum_p, insn_code icode)
3977 machine_mode mode = TYPE_MODE (builtin_types[type.index].vector);
3979 /* Record the offset to get the argument. */
3980 int arg_offset = 0;
3982 if (use_real_mask_p (pred))
3983 add_input_operand (arg_offset++);
3984 else
3985 add_all_one_mask_operand (mask_mode ());
3987 rtx vd = expand_normal (CALL_EXPR_ARG (exp, arg_offset++));
3988 rtx vs1 = expand_normal (CALL_EXPR_ARG (exp, arg_offset++));
3989 rtx vs2 = expand_normal (CALL_EXPR_ARG (exp, arg_offset++));
3991 if (VECTOR_MODE_P (GET_MODE (vs1)))
3993 if (!vd_accum_p)
3994 add_input_operand (mode, vd);
3995 add_input_operand (mode, vs1);
3996 add_input_operand (mode, vs2);
3997 if (vd_accum_p)
3998 add_input_operand (mode, vd);
3999 add_input_operand (mode, vd);
4001 else
4003 add_input_operand (GET_MODE_INNER (mode), vs1);
4004 if (vd_accum_p)
4006 add_input_operand (mode, vs2);
4007 add_input_operand (mode, vd);
4009 else
4011 add_input_operand (mode, vd);
4012 add_input_operand (mode, vs2);
4014 add_input_operand (mode, vd);
4017 for (int argno = arg_offset; argno < call_expr_nargs (exp); argno++)
4019 if (base->has_rounding_mode_operand_p ()
4020 && argno == call_expr_nargs (exp) - 2)
4022 /* Since the rounding mode argument position is not consistent with
4023 the instruction pattern, we need to skip rounding mode argument
4024 here. */
4025 continue;
4027 add_input_operand (argno);
4030 add_input_operand (Pmode, get_tail_policy_for_pred (pred));
4031 add_input_operand (Pmode, get_mask_policy_for_pred (pred));
4032 add_input_operand (Pmode, get_avl_type_rtx (avl_type::NONVLMAX));
4034 if (base->has_rounding_mode_operand_p ())
4035 add_input_operand (call_expr_nargs (exp) - 2);
4037 /* The RVV floating-point only support dynamic rounding mode in the
4038 FRM register. */
4039 if (opno != insn_data[icode].n_generator_args)
4040 add_input_operand (Pmode, gen_int_mode (riscv_vector::FRM_DYN, Pmode));
4042 return generate_insn (icode);
4045 /* Implement the call using instruction ICODE, with a 1:1 mapping between
4046 arguments and input operands. */
4048 function_expander::use_widen_ternop_insn (insn_code icode)
4050 /* Record the offset to get the argument. */
4051 int arg_offset = 0;
4053 if (use_real_mask_p (pred))
4054 add_input_operand (arg_offset++);
4055 else
4056 add_all_one_mask_operand (mask_mode ());
4058 for (int argno = arg_offset; argno < call_expr_nargs (exp); argno++)
4060 if (base->has_rounding_mode_operand_p ()
4061 && argno == call_expr_nargs (exp) - 2)
4063 /* Since the rounding mode argument position is not consistent with
4064 the instruction pattern, we need to skip rounding mode argument
4065 here. */
4066 continue;
4068 add_input_operand (argno);
4071 add_input_operand (Pmode, get_tail_policy_for_pred (pred));
4072 add_input_operand (Pmode, get_mask_policy_for_pred (pred));
4073 add_input_operand (Pmode, get_avl_type_rtx (avl_type::NONVLMAX));
4075 if (base->has_rounding_mode_operand_p ())
4076 add_input_operand (call_expr_nargs (exp) - 2);
4078 /* The RVV floating-point only support dynamic rounding mode in the
4079 FRM register. */
4080 if (opno != insn_data[icode].n_generator_args)
4081 add_input_operand (Pmode, gen_int_mode (riscv_vector::FRM_DYN, Pmode));
4083 return generate_insn (icode);
4086 /* Implement the call using instruction ICODE, with a 1:1 mapping between
4087 arguments and input operands. */
4089 function_expander::use_scalar_move_insn (insn_code icode)
4091 machine_mode mode = TYPE_MODE (TREE_TYPE (exp));
4093 /* Record the offset to get the argument. */
4094 int arg_offset = 0;
4095 add_scalar_move_mask_operand (mask_mode ());
4097 if (use_real_merge_p (pred))
4098 add_input_operand (arg_offset++);
4099 else
4100 add_vundef_operand (mode);
4102 for (int argno = arg_offset; argno < call_expr_nargs (exp); argno++)
4103 add_input_operand (argno);
4105 add_input_operand (Pmode, get_tail_policy_for_pred (pred));
4106 add_input_operand (Pmode, get_mask_policy_for_pred (pred));
4107 add_input_operand (Pmode, get_avl_type_rtx (avl_type::NONVLMAX));
4108 return generate_insn (icode);
4111 /* Generate instruction ICODE, given that its operands have already
4112 been added to M_OPS. Return the value of the first operand. */
4114 function_expander::generate_insn (insn_code icode)
4116 gcc_assert (opno == insn_data[icode].n_generator_args);
4117 if (!maybe_expand_insn (icode, opno, m_ops))
4119 error ("invalid argument to built-in function");
4120 return NULL_RTX;
4122 return function_returns_void_p () ? const0_rtx : m_ops[0].value;
4125 function_checker::function_checker (location_t location,
4126 const function_instance &instance,
4127 tree fndecl, tree fntype,
4128 unsigned int nargs, tree *args)
4129 : function_call_info (location, instance, fndecl), m_fntype (fntype),
4130 m_nargs (nargs), m_args (args)
4133 /* Report that LOCATION has a call to FNDECL in which argument ARGNO
4134 was not an integer constant expression. ARGNO counts from zero. */
4135 void
4136 function_checker::report_non_ice (unsigned int argno) const
4138 error_at (location,
4139 "argument %d of %qE must be an integer constant"
4140 " expression",
4141 argno + 1, fndecl);
4144 /* Report that LOCATION has a call to FNDECL in which argument ARGNO has
4145 the value ACTUAL, whereas the function requires a value in the range
4146 [MIN, MAX]. ARGNO counts from zero. */
4147 void
4148 function_checker::report_out_of_range (unsigned int argno, HOST_WIDE_INT actual,
4149 HOST_WIDE_INT min,
4150 HOST_WIDE_INT max) const
4152 error_at (location,
4153 "passing %wd to argument %d of %qE, which expects"
4154 " a value in the range [%wd, %wd]",
4155 actual, argno + 1, fndecl, min, max);
4158 /* Report that LOCATION has a call to FNDECL in which argument ARGNO has
4159 the value ACTUAL, whereas the function requires a value in the range
4160 [MIN, MAX] or OR_VAL. ARGNO counts from zero. */
4161 void
4162 function_checker::report_out_of_range_and_not (unsigned int argno,
4163 HOST_WIDE_INT actual,
4164 HOST_WIDE_INT min,
4165 HOST_WIDE_INT max,
4166 HOST_WIDE_INT or_val) const
4168 error_at (location,
4169 "passing %wd to argument %d of %qE, which expects"
4170 " a value in the range [%wd, %wd] or %wd",
4171 actual, argno + 1, fndecl, min, max, or_val);
4175 /* Check that argument ARGNO is an integer constant expression and
4176 store its value in VALUE_OUT if so. The caller should first
4177 check that argument ARGNO exists. */
4178 bool
4179 function_checker::require_immediate (unsigned int argno, HOST_WIDE_INT min,
4180 HOST_WIDE_INT max) const
4182 gcc_assert (argno < m_nargs);
4183 tree arg = m_args[argno];
4185 /* The type and range are unsigned, so read the argument as an
4186 unsigned rather than signed HWI. */
4187 if (!tree_fits_uhwi_p (arg))
4189 report_non_ice (argno);
4190 return false;
4192 return require_immediate_range (argno, min, max);
4195 /* Check that argument REL_ARGNO is an integer constant expression in the
4196 range [MIN, MAX]. REL_ARGNO counts from the end of the predication
4197 arguments. */
4198 bool
4199 function_checker::require_immediate_range (unsigned int argno,
4200 HOST_WIDE_INT min,
4201 HOST_WIDE_INT max) const
4203 gcc_assert (argno < m_nargs);
4204 tree arg = m_args[argno];
4205 HOST_WIDE_INT actual = tree_to_uhwi (arg);
4207 if (!IN_RANGE (actual, min, max))
4209 report_out_of_range (argno, actual, min, max);
4210 return false;
4213 return true;
4216 /* Check that argument REL_ARGNO is an integer constant expression in the
4217 range [MIN, MAX] or OR_VAL. REL_ARGNO counts from the end of the
4218 predication arguments. */
4219 bool
4220 function_checker::require_immediate_range_or (unsigned int argno,
4221 HOST_WIDE_INT min,
4222 HOST_WIDE_INT max,
4223 HOST_WIDE_INT or_val) const
4225 gcc_assert (min >= 0 && min <= max);
4226 gcc_assert (argno < m_nargs);
4228 tree arg = m_args[argno];
4229 HOST_WIDE_INT actual = tree_to_uhwi (arg);
4231 if (!IN_RANGE (actual, min, max) && actual != or_val)
4233 report_out_of_range_and_not (argno, actual, min, max, or_val);
4234 return false;
4237 return true;
4240 /* Perform semantic checks on the call. Return true if the call is valid,
4241 otherwise report a suitable error. */
4242 bool
4243 function_checker::check ()
4245 return shape->check (*this);
4248 inline hashval_t
4249 registered_function_hasher::hash (value_type value)
4251 return value->instance.hash ();
4254 inline bool
4255 registered_function_hasher::equal (value_type value, const compare_type &key)
4257 return value->instance == key;
4260 hashval_t
4261 registered_function::overloaded_hash () const
4263 inchash::hash h;
4264 tree type;
4265 unsigned int unsigned_p, mode_p;
4266 h.add (overload_name, strlen (overload_name));
4267 for (unsigned int i = 0; i < argument_types.length (); i++)
4269 type = argument_types[i];
4270 unsigned_p = POINTER_TYPE_P (type) ? TYPE_UNSIGNED (TREE_TYPE (type))
4271 : TYPE_UNSIGNED (type);
4272 mode_p = POINTER_TYPE_P (type) ? TYPE_MODE (TREE_TYPE (type))
4273 : TYPE_MODE (type);
4274 h.add_int (unsigned_p);
4275 h.add_int (mode_p);
4278 return h.end ();
4281 bool
4282 has_vxrm_or_frm_p (function_instance &instance, const vec<tree, va_gc> &arglist)
4284 if (instance.base->may_require_vxrm_p ()
4285 || (instance.base->may_require_frm_p ()
4286 && (TREE_CODE (TREE_TYPE (arglist[arglist.length () - 2]))
4287 == INTEGER_TYPE)))
4288 return true;
4289 return false;
4292 hashval_t
4293 registered_function::overloaded_hash (const vec<tree, va_gc> &arglist)
4295 argument_types = vNULL;
4296 unsigned int len = arglist.length ();
4298 for (unsigned int i = 0; i < len; i++)
4300 /* vint8m1_t __riscv_vget_i8m1(vint8m2_t src, size_t index);
4301 When the user calls vget intrinsic, the __riscv_vget_i8m1(src, 1)
4302 form is used. The compiler recognizes that the parameter index is signed
4303 int, which is inconsistent with size_t, so the index is converted to
4304 size_t type in order to get correct hash value. vint8m2_t
4305 __riscv_vset(vint8m2_t dest, size_t index, vint8m1_t value); The reason
4306 is the same as above. */
4307 if ((instance.base == bases::vget && (i == (len - 1)))
4308 || ((instance.base == bases::vset
4309 || instance.shape == shapes::crypto_vi)
4310 && (i == (len - 2))))
4311 argument_types.safe_push (size_type_node);
4312 /* Vector fixed-point arithmetic instructions requiring argument vxrm.
4313 For example: vuint32m4_t __riscv_vaaddu(vuint32m4_t vs2,
4314 vuint32m4_t vs1, unsigned int vxrm, size_t vl); The user calls vaaddu
4315 intrinsic in the form of __riscv_vaaddu(vs2, vs1, 2, vl). The compiler
4316 recognizes that the parameter vxrm is a signed int, which is inconsistent
4317 with the parameter unsigned int vxrm declared by intrinsic, so the
4318 parameter vxrm is converted to an unsigned int type in order to get
4319 correct hash value.
4321 Vector Floating-Point Instructions requiring argument frm.
4322 DEF_RVV_FUNCTION (vfadd, alu, full_preds, f_vvv_ops)
4323 DEF_RVV_FUNCTION (vfadd_frm, alu_frm, full_preds, f_vvv_ops)
4324 Taking vfadd as an example, theoretically we can add base or shape to the
4325 hash value to distinguish whether the frm parameter is required.
4326 vfloat32m1_t __riscv_vfadd(vfloat32m1_t vs2, float32_t rs1, size_t vl);
4327 vfloat32m1_t __riscv_vfadd(vfloat32m1_t vs2, vfloat32m1_t vs1, unsigned int
4328 frm, size_t vl);
4330 However, the current registration mechanism of overloaded intinsic for gcc
4331 limits the intrinsic obtained by entering the hook to always be vfadd, not
4332 vfadd_frm. Therefore, the correct hash value cannot be obtained through the
4333 parameter list and overload name, base or shape.
4334 +--------+---------------------------+-------------------+
4335 | index | name | kind |
4336 +--------+---------------------------+-------------------+
4337 | 124733 | __riscv_vfadd | Overloaded | <- Hook fun code
4338 +--------+---------------------------+-------------------+
4339 | 124735 | __riscv_vfadd_vv_f32m1 | Non-overloaded |
4340 +--------+---------------------------+-------------------+
4341 | 124737 | __riscv_vfadd | Placeholder |
4342 +--------+---------------------------+-------------------+
4343 | ... |
4344 +--------+---------------------------+-------------------+
4345 | ... |
4346 +--------+---------------------------+-------------------+
4347 | 125739 | __riscv_vfadd | Overloaded |
4348 +--------+---------------------------+-------------------+
4349 | 125741 | __riscv_vfadd_vv_f32m1_rm | Non-overloaded |
4350 +--------+---------------------------+-------------------+
4351 | 125743 | __riscv_vfadd | Placeholder |
4352 +--------+---------------------------+-------------------+
4354 Therefore, the hash value cannot be added with base or shape, and needs
4355 to be distinguished by whether the penultimate parameter is INTEGER_TYPE. */
4356 else if (has_vxrm_or_frm_p (instance, arglist) && (i == (len - 2)))
4357 argument_types.safe_push (unsigned_type_node);
4358 else
4359 argument_types.safe_push (TREE_TYPE (arglist[i]));
4361 return overloaded_hash ();
4364 inline hashval_t
4365 non_overloaded_registered_function_hasher::hash (value_type value)
4367 return value->overloaded_hash ();
4370 inline bool
4371 non_overloaded_registered_function_hasher::equal (value_type value,
4372 const compare_type &key)
4374 return ((strcmp (value->overload_name, key->overload_name) == 0)
4375 && value->overloaded_hash () == key->overloaded_hash ());
4378 /* If TYPE is a built-in type defined by the RVV ABI, return the mangled name,
4379 otherwise return NULL. */
4380 const char *
4381 mangle_builtin_type (const_tree type)
4383 if (TYPE_NAME (type) && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL)
4384 type = TREE_TYPE (TYPE_NAME (type));
4385 if (tree attr = lookup_vector_type_attribute (type))
4386 if (tree id = TREE_VALUE (chain_index (0, TREE_VALUE (attr))))
4387 return IDENTIFIER_POINTER (id);
4388 return NULL;
4391 /* Return true if TYPE is a built-in RVV type defined by the ABI. */
4392 bool
4393 builtin_type_p (const_tree type)
4395 if (!type)
4396 return false;
4398 return lookup_vector_type_attribute (type);
4401 /* Initialize all compiler built-ins related to RVV that should be
4402 defined at start-up. */
4403 void
4404 init_builtins ()
4406 rvv_switcher rvv;
4407 if (!TARGET_VECTOR)
4408 return;
4409 register_builtin_types ();
4410 if (in_lto_p)
4411 handle_pragma_vector ();
4414 /* Implement TARGET_VERIFY_TYPE_CONTEXT for RVV types. */
4415 bool
4416 verify_type_context (location_t loc, type_context_kind context, const_tree type,
4417 bool silent_p)
4419 if (!sizeless_type_p (type))
4420 return true;
4422 switch (context)
4424 case TCTX_SIZEOF:
4425 case TCTX_STATIC_STORAGE:
4426 if (!silent_p)
4427 error_at (loc, "RVV type %qT does not have a fixed size", type);
4429 return false;
4431 case TCTX_ALIGNOF:
4432 if (!silent_p)
4433 error_at (loc, "RVV type %qT does not have a defined alignment", type);
4435 return false;
4437 case TCTX_THREAD_STORAGE:
4438 if (!silent_p)
4439 error_at (loc,
4440 "variables of type %qT cannot have thread-local"
4441 " storage duration",
4442 type);
4444 return false;
4446 case TCTX_POINTER_ARITH:
4447 if (!silent_p)
4448 error_at (loc, "arithmetic on pointer to RVV type %qT", type);
4450 return false;
4452 case TCTX_FIELD:
4453 if (silent_p)
4455 else if (lang_GNU_CXX ())
4456 error_at (loc, "member variables cannot have RVV type %qT", type);
4457 else
4458 error_at (loc, "fields cannot have RVV type %qT", type);
4460 return false;
4462 case TCTX_ARRAY_ELEMENT:
4463 if (!silent_p)
4464 error_at (loc, "array elements cannot have RVV type %qT", type);
4466 return false;
4468 case TCTX_ALLOCATION:
4469 if (!silent_p)
4470 error_at (loc, "cannot allocate objects with RVV type %qT", type);
4472 return false;
4474 case TCTX_DEALLOCATION:
4475 if (!silent_p)
4476 error_at (loc, "cannot delete objects with RVV type %qT", type);
4478 return false;
4480 case TCTX_EXCEPTIONS:
4481 if (!silent_p)
4482 error_at (loc, "cannot throw or catch RVV type %qT", type);
4484 return false;
4486 case TCTX_CAPTURE_BY_COPY:
4487 if (!silent_p)
4488 error_at (loc, "capture by copy of RVV type %qT", type);
4490 return false;
4493 gcc_unreachable ();
4496 /* Register the vxrm enum. */
4497 static void
4498 register_vxrm ()
4500 auto_vec<string_int_pair, 4> values;
4501 #define DEF_RVV_VXRM_ENUM(NAME, VALUE) \
4502 values.quick_push (string_int_pair ("__RISCV_VXRM_" #NAME, VALUE));
4503 #include "riscv-vector-builtins.def"
4504 #undef DEF_RVV_VXRM_ENUM
4506 lang_hooks.types.simulate_enum_decl (input_location, "__RISCV_VXRM", &values);
4509 /* Register the frm enum. */
4510 static void
4511 register_frm ()
4513 auto_vec<string_int_pair, 5> values;
4514 #define DEF_RVV_FRM_ENUM(NAME, VALUE) \
4515 values.quick_push (string_int_pair ("__RISCV_FRM_" #NAME, VALUE));
4516 #include "riscv-vector-builtins.def"
4517 #undef DEF_RVV_FRM_ENUM
4519 lang_hooks.types.simulate_enum_decl (input_location, "__RISCV_FRM", &values);
4522 /* Implement #pragma riscv intrinsic vector. */
4523 void
4524 handle_pragma_vector ()
4526 if (function_table || non_overloaded_function_table)
4528 error ("duplicate definition of %qs", "riscv_vector.h");
4529 return;
4531 rvv_switcher rvv;
4533 /* Define the vector and tuple types. */
4534 for (unsigned int type_i = 0; type_i < NUM_VECTOR_TYPES; ++type_i)
4535 register_vector_type ((enum vector_type_index) type_i);
4537 /* Define the enums. */
4538 register_vxrm ();
4539 register_frm ();
4541 /* Define the functions. */
4542 function_table = new hash_table<registered_function_hasher> (1023);
4543 non_overloaded_function_table
4544 = new hash_table<non_overloaded_registered_function_hasher> (1023);
4545 function_builder builder;
4546 for (unsigned int i = 0; i < ARRAY_SIZE (function_groups); ++i)
4548 if (function_groups[i].match (function_groups[i].required_extensions))
4549 builder.register_function_group (function_groups[i]);
4553 /* Return the function decl with RVV function subcode CODE, or error_mark_node
4554 if no such function exists. */
4555 tree
4556 builtin_decl (unsigned int code, bool)
4558 if (code >= vec_safe_length (registered_functions))
4559 return error_mark_node;
4561 return (*registered_functions)[code]->decl;
4564 /* Attempt to fold STMT, given that it's a call to the RVV function
4565 with subcode CODE. Return the new statement on success and null
4566 on failure. Insert any other new statements at GSI. */
4567 gimple *
4568 gimple_fold_builtin (unsigned int code, gimple_stmt_iterator *gsi, gcall *stmt)
4570 registered_function &rfn = *(*registered_functions)[code];
4571 return gimple_folder (rfn.instance, rfn.decl, gsi, stmt).fold ();
4574 /* Expand a call to the RVV function with subcode CODE. EXP is the call
4575 expression and TARGET is the preferred location for the result.
4576 Return the value of the lhs. */
4578 expand_builtin (unsigned int code, tree exp, rtx target)
4580 registered_function &rfn = *(*registered_functions)[code];
4581 return function_expander (rfn.instance, rfn.decl, exp, target).expand ();
4584 /* Perform any semantic checks needed for a call to the RVV function
4585 with subcode CODE, such as testing for integer constant expressions.
4586 The call occurs at location LOCATION and has NARGS arguments,
4587 given by ARGS. FNDECL is the original function decl, before
4588 overload resolution.
4590 Return true if the call is valid, otherwise report a suitable error. */
4591 bool
4592 check_builtin_call (location_t location, vec<location_t>, unsigned int code,
4593 tree fndecl, unsigned int nargs, tree *args)
4595 const registered_function &rfn = *(*registered_functions)[code];
4596 return function_checker (location, rfn.instance, fndecl,
4597 TREE_TYPE (rfn.decl), nargs, args).check ();
4600 tree
4601 resolve_overloaded_builtin (unsigned int code, vec<tree, va_gc> *arglist)
4603 if (code >= vec_safe_length (registered_functions))
4604 return NULL_TREE;
4606 registered_function *rfun = (*registered_functions)[code];
4608 if (!rfun || !rfun->overloaded_p)
4609 return NULL_TREE;
4611 hashval_t hash = rfun->overloaded_hash (*arglist);
4612 registered_function *rfn
4613 = non_overloaded_function_table->find_with_hash (rfun, hash);
4614 gcc_assert (rfn);
4615 return rfn->decl;
4618 function_instance
4619 get_read_vl_instance (void)
4621 return function_instance ("read_vl", bases::read_vl, shapes::read_vl,
4622 none_ops[0], PRED_TYPE_none, &p_none_void_ops);
4625 tree
4626 get_read_vl_decl (void)
4628 function_instance instance = get_read_vl_instance ();
4629 hashval_t hash = instance.hash ();
4630 registered_function *rfn = function_table->find_with_hash (instance, hash);
4631 gcc_assert (rfn);
4632 return rfn->decl;
4635 } // end namespace riscv_vector
4637 inline void
4638 gt_ggc_mx (function_instance *)
4641 inline void
4642 gt_pch_nx (function_instance *)
4645 inline void
4646 gt_pch_nx (function_instance *, gt_pointer_operator, void *)
4649 #include "gt-riscv-vector-builtins.h"