RISC-V: Allow RVV intrinsic when function target("arch=+v")
[official-gcc.git] / gcc / config / riscv / riscv-vector-builtins.cc
blobe07373d8b5758e56cde0562c92a0045e089ebca7
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 args for vector_type func (const scalar_type *, size_t)
938 * function. */
939 static CONSTEXPR const rvv_arg_type_info scalar_const_ptr_size_args[]
940 = {rvv_arg_type_info (RVV_BASE_scalar_const_ptr),
941 rvv_arg_type_info (RVV_BASE_size), rvv_arg_type_info_end};
943 /* A list of args for vector_type func (const scalar_type *, eew8_index_type)
944 * function. */
945 static CONSTEXPR const rvv_arg_type_info scalar_const_ptr_index_args[]
946 = {rvv_arg_type_info (RVV_BASE_scalar_const_ptr),
947 rvv_arg_type_info (RVV_BASE_unsigned_vector), rvv_arg_type_info_end};
949 /* A list of args for void func (scalar_type *, eew8_index_type, vector_type)
950 * function. */
951 static CONSTEXPR const rvv_arg_type_info scalar_ptr_index_args[]
952 = {rvv_arg_type_info (RVV_BASE_scalar_ptr),
953 rvv_arg_type_info (RVV_BASE_unsigned_vector),
954 rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};
956 /* A list of args for void func (scalar_type *, size_t, vector_type)
957 * function. */
958 static CONSTEXPR const rvv_arg_type_info scalar_ptr_size_args[]
959 = {rvv_arg_type_info (RVV_BASE_scalar_ptr),
960 rvv_arg_type_info (RVV_BASE_size), rvv_arg_type_info (RVV_BASE_vector),
961 rvv_arg_type_info_end};
963 /* A list of none preds that will be registered for intrinsic functions. */
964 static CONSTEXPR const predication_type_index none_preds[]
965 = {PRED_TYPE_none, NUM_PRED_TYPES};
967 /* vop/vop_m/vop_tu/vop_tum/vop_tumu/vop_mu will be registered. */
968 static CONSTEXPR const predication_type_index full_preds[]
969 = {PRED_TYPE_none, PRED_TYPE_m, PRED_TYPE_tu, PRED_TYPE_tum,
970 PRED_TYPE_tumu, PRED_TYPE_mu, NUM_PRED_TYPES};
972 /* vop/vop_m/vop_tu/vop_tum/ will be registered. */
973 static CONSTEXPR const predication_type_index no_mu_preds[]
974 = {PRED_TYPE_none, PRED_TYPE_m, PRED_TYPE_tu, PRED_TYPE_tum, NUM_PRED_TYPES};
976 /* vop/vop_tu will be registered. */
977 static CONSTEXPR const predication_type_index none_tu_preds[]
978 = {PRED_TYPE_none, PRED_TYPE_tu, NUM_PRED_TYPES};
980 /* vop/vop_m will be registered. */
981 static CONSTEXPR const predication_type_index none_m_preds[]
982 = {PRED_TYPE_none, PRED_TYPE_m, NUM_PRED_TYPES};
984 /* vop/vop_m/vop_mu will be registered. */
985 static CONSTEXPR const predication_type_index none_m_mu_preds[]
986 = {PRED_TYPE_none, PRED_TYPE_m, PRED_TYPE_mu, NUM_PRED_TYPES};
988 /* A static operand information for size_t func () function registration. */
989 static CONSTEXPR const rvv_op_info i_none_size_void_ops
990 = {i_ops, /* Types */
991 OP_TYPE_none, /* Suffix */
992 rvv_arg_type_info (RVV_BASE_size), /* Return type */
993 void_args /* Args */};
995 /* A static operand information for size_t func (size_t) function registration.
997 static CONSTEXPR const rvv_op_info i_none_size_size_ops
998 = {i_ops, /* Types */
999 OP_TYPE_none, /* Suffix */
1000 rvv_arg_type_info (RVV_BASE_size), /* Return type */
1001 size_args /* Args */};
1003 /* A static operand information for vector_type func () function registration.
1005 static CONSTEXPR const rvv_op_info all_none_void_ops
1006 = {all_ops, /* Types */
1007 OP_TYPE_none, /* Suffix */
1008 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1009 void_args /* Args */};
1011 /* A static operand information for vector_type func (const scalar_type *)
1012 * function registration. */
1013 static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_ops
1014 = {all_ops, /* Types */
1015 OP_TYPE_v, /* Suffix */
1016 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1017 scalar_const_ptr_args /* Args */};
1019 /* A static operand information for vector_type func (const scalar_type *)
1020 * function registration. */
1021 static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_size_ptr_ops
1022 = {all_ops, /* Types */
1023 OP_TYPE_v, /* Suffix */
1024 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1025 scalar_const_ptr_size_ptr_args /* Args */};
1027 /* A static operand information for void func (scalar_type *, vector_type)
1028 * function registration. */
1029 static CONSTEXPR const rvv_op_info all_v_scalar_ptr_ops
1030 = {all_ops, /* Types */
1031 OP_TYPE_v, /* Suffix */
1032 rvv_arg_type_info (RVV_BASE_void), /* Return type */
1033 scalar_ptr_args /* Args */};
1035 /* A static operand information for vector_type func (const scalar_type *)
1036 * function registration. */
1037 static CONSTEXPR const rvv_op_info b_v_scalar_const_ptr_ops
1038 = {b_ops, /* Types */
1039 OP_TYPE_v, /* Suffix */
1040 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1041 scalar_const_ptr_args /* Args */};
1043 /* A static operand information for void func (scalar_type *, vector_type)
1044 * function registration. */
1045 static CONSTEXPR const rvv_op_info b_v_scalar_ptr_ops
1046 = {b_ops, /* Types */
1047 OP_TYPE_v, /* Suffix */
1048 rvv_arg_type_info (RVV_BASE_void), /* Return type */
1049 scalar_ptr_args /* Args */};
1051 /* A static operand information for vector_type func (vector_type, vector_type)
1052 * function registration. */
1053 static CONSTEXPR const rvv_op_info b_mmm_ops
1054 = {b_ops, /* Types */
1055 OP_TYPE_mm, /* Suffix */
1056 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1057 vv_args /* Args */};
1059 /* A static operand information for vector_type func (vector_type)
1060 * function registration. */
1061 static CONSTEXPR const rvv_op_info b_mm_ops
1062 = {b_ops, /* Types */
1063 OP_TYPE_m, /* Suffix */
1064 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1065 v_args /* Args */};
1067 /* A static operand information for vector_type func (vector_type)
1068 * function registration. */
1069 static CONSTEXPR const rvv_op_info u_vm_ops
1070 = {u_ops, /* Types */
1071 OP_TYPE_m, /* Suffix */
1072 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1073 m_args /* Args */};
1075 /* A static operand information for vector_type func ()
1076 * function registration. */
1077 static CONSTEXPR const rvv_op_info b_m_ops
1078 = {b_ops, /* Types */
1079 OP_TYPE_m, /* Suffix */
1080 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1081 end_args /* Args */};
1083 /* A static operand information for vector_type func ()
1084 * function registration. */
1085 static CONSTEXPR const rvv_op_info u_v_ops
1086 = {u_ops, /* Types */
1087 OP_TYPE_v, /* Suffix */
1088 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1089 end_args /* Args */};
1091 /* A static operand information for vector_type func (vector_type)
1092 * function registration. */
1093 static CONSTEXPR const rvv_op_info u_vv_ops
1094 = {u_ops, /* Types */
1095 OP_TYPE_v, /* Suffix */
1096 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1097 v_args /* Args */};
1099 /* A static operand information for unsigned long func (vector_type)
1100 * function registration. */
1101 static CONSTEXPR const rvv_op_info b_ulong_m_ops
1102 = {b_ops, /* Types */
1103 OP_TYPE_m, /* Suffix */
1104 rvv_arg_type_info (RVV_BASE_unsigned_long), /* Return type */
1105 v_args /* Args */};
1107 /* A static operand information for long func (vector_type)
1108 * function registration. */
1109 static CONSTEXPR const rvv_op_info b_long_m_ops
1110 = {b_ops, /* Types */
1111 OP_TYPE_m, /* Suffix */
1112 rvv_arg_type_info (RVV_BASE_long), /* Return type */
1113 v_args /* Args */};
1115 /* A static operand information for vector_type func (const scalar_type *,
1116 * ptrdiff_t) function registration. */
1117 static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_ptrdiff_ops
1118 = {all_ops, /* Types */
1119 OP_TYPE_v, /* Suffix */
1120 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1121 scalar_const_ptr_ptrdiff_args /* Args */};
1123 /* A static operand information for vector_type func (const scalar_type *,
1124 * eew8_index_type) function registration. */
1125 static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_eew8_index_ops
1126 = {all_ops, /* Types */
1127 OP_TYPE_v, /* Suffix */
1128 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1129 scalar_const_ptr_eew8_index_args /* Args */};
1131 /* A static operand information for vector_type func (const scalar_type *,
1132 * eew16_index_type) function registration. */
1133 static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_eew16_index_ops
1134 = {all_ops, /* Types */
1135 OP_TYPE_v, /* Suffix */
1136 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1137 scalar_const_ptr_eew16_index_args /* Args */};
1139 /* A static operand information for vector_type func (const scalar_type *,
1140 * eew32_index_type) function registration. */
1141 static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_eew32_index_ops
1142 = {all_ops, /* Types */
1143 OP_TYPE_v, /* Suffix */
1144 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1145 scalar_const_ptr_eew32_index_args /* Args */};
1147 /* A static operand information for vector_type func (const scalar_type *,
1148 * eew64_index_type) function registration. */
1149 static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_eew64_index_ops
1150 = {all_ops, /* Types */
1151 OP_TYPE_v, /* Suffix */
1152 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1153 scalar_const_ptr_eew64_index_args /* Args */};
1155 /* A static operand information for void func (scalar_type *, ptrdiff_t,
1156 * vector_type) function registration. */
1157 static CONSTEXPR const rvv_op_info all_v_scalar_ptr_ptrdiff_ops
1158 = {all_ops, /* Types */
1159 OP_TYPE_v, /* Suffix */
1160 rvv_arg_type_info (RVV_BASE_void), /* Return type */
1161 scalar_ptr_ptrdiff_args /* Args */};
1163 /* A static operand information for void func (scalar_type *, eew8_index_type,
1164 * vector_type) function registration. */
1165 static CONSTEXPR const rvv_op_info all_v_scalar_ptr_eew8_index_ops
1166 = {all_ops, /* Types */
1167 OP_TYPE_v, /* Suffix */
1168 rvv_arg_type_info (RVV_BASE_void), /* Return type */
1169 scalar_ptr_eew8_index_args /* Args */};
1171 /* A static operand information for void func (scalar_type *, eew16_index_type,
1172 * vector_type) function registration. */
1173 static CONSTEXPR const rvv_op_info all_v_scalar_ptr_eew16_index_ops
1174 = {all_ops, /* Types */
1175 OP_TYPE_v, /* Suffix */
1176 rvv_arg_type_info (RVV_BASE_void), /* Return type */
1177 scalar_ptr_eew16_index_args /* Args */};
1179 /* A static operand information for void func (scalar_type *, eew32_index_type,
1180 * vector_type) function registration. */
1181 static CONSTEXPR const rvv_op_info all_v_scalar_ptr_eew32_index_ops
1182 = {all_ops, /* Types */
1183 OP_TYPE_v, /* Suffix */
1184 rvv_arg_type_info (RVV_BASE_void), /* Return type */
1185 scalar_ptr_eew32_index_args /* Args */};
1187 /* A static operand information for void func (scalar_type *, eew64_index_type,
1188 * vector_type) function registration. */
1189 static CONSTEXPR const rvv_op_info all_v_scalar_ptr_eew64_index_ops
1190 = {all_ops, /* Types */
1191 OP_TYPE_v, /* Suffix */
1192 rvv_arg_type_info (RVV_BASE_void), /* Return type */
1193 scalar_ptr_eew64_index_args /* Args */};
1195 /* A static operand information for vector_type func (vector_type, vector_type)
1196 * function registration. */
1197 static CONSTEXPR const rvv_op_info iu_vvv_ops
1198 = {iu_ops, /* Types */
1199 OP_TYPE_vv, /* Suffix */
1200 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1201 vv_args /* Args */};
1203 /* A static operand information for vector_type func (vector_type, vector_type,
1204 * vector_type) function registration. */
1205 static CONSTEXPR const rvv_op_info iu_vvvv_ops
1206 = {iu_ops, /* Types */
1207 OP_TYPE_vv, /* Suffix */
1208 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1209 vvv_args /* Args */};
1211 /* A static operand information for vector_type func (vector_type, scalar_type,
1212 * vector_type) function registration. */
1213 static CONSTEXPR const rvv_op_info iu_vvxv_ops
1214 = {iu_ops, /* Types */
1215 OP_TYPE_vx, /* Suffix */
1216 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1217 vxv_args /* Args */};
1219 /* A static operand information for vector_type func (vector_type, vector_type,
1220 * vector_type) function registration. */
1221 static CONSTEXPR const rvv_op_info f_vvvv_ops
1222 = {f_ops, /* Types */
1223 OP_TYPE_vv, /* Suffix */
1224 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1225 vvv_args /* Args */};
1227 /* A static operand information for vector_type func (vector_type, scalar_type,
1228 * vector_type) function registration. */
1229 static CONSTEXPR const rvv_op_info f_vvfv_ops
1230 = {f_ops, /* Types */
1231 OP_TYPE_vf, /* Suffix */
1232 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1233 vxv_args /* Args */};
1235 /* A static operand information for vector_type func (vector_type, vector_type,
1236 * mask_type) function registration. */
1237 static CONSTEXPR const rvv_op_info iu_vvvm_ops
1238 = {iu_ops, /* Types */
1239 OP_TYPE_vvm, /* Suffix */
1240 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1241 vvm_args /* Args */};
1243 /* A static operand information for vector_type func (vector_type, vector_type,
1244 * mask_type) function registration. */
1245 static CONSTEXPR const rvv_op_info all_vvvm_ops
1246 = {all_ops, /* Types */
1247 OP_TYPE_vvm, /* Suffix */
1248 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1249 vvm_args /* Args */};
1251 /* A static operand information for vector_type func (vector_type, vector_type,
1252 * mask_type) function registration. */
1253 static CONSTEXPR const rvv_op_info all_vvm_ops
1254 = {all_ops, /* Types */
1255 OP_TYPE_vm, /* Suffix */
1256 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1257 vm_args /* Args */};
1259 /* A static operand information for vector_type func (vector_type, scalar_type,
1260 * mask_type) function registration. */
1261 static CONSTEXPR const rvv_op_info iu_vvxm_ops
1262 = {iu_ops, /* Types */
1263 OP_TYPE_vxm, /* Suffix */
1264 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1265 vxm_args /* Args */};
1267 /* A static operand information for vector_type func (vector_type, scalar_type,
1268 * mask_type) function registration. */
1269 static CONSTEXPR const rvv_op_info f_vvfm_ops
1270 = {f_ops, /* Types */
1271 OP_TYPE_vfm, /* Suffix */
1272 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1273 vxm_args /* Args */};
1275 /* A static operand information for mask_type func (vector_type, vector_type,
1276 * mask_type) function registration. */
1277 static CONSTEXPR const rvv_op_info iu_mvvm_ops
1278 = {iu_ops, /* Types */
1279 OP_TYPE_vvm, /* Suffix */
1280 rvv_arg_type_info (RVV_BASE_mask), /* Return type */
1281 vvm_args /* Args */};
1283 /* A static operand information for mask_type func (vector_type, scalar_type,
1284 * mask_type) function registration. */
1285 static CONSTEXPR const rvv_op_info iu_mvxm_ops
1286 = {iu_ops, /* Types */
1287 OP_TYPE_vxm, /* Suffix */
1288 rvv_arg_type_info (RVV_BASE_mask), /* Return type */
1289 vxm_args /* Args */};
1291 /* A static operand information for mask_type func (vector_type, vector_type)
1292 * function registration. */
1293 static CONSTEXPR const rvv_op_info iu_mvv_ops
1294 = {iu_ops, /* Types */
1295 OP_TYPE_vv, /* Suffix */
1296 rvv_arg_type_info (RVV_BASE_mask), /* Return type */
1297 vv_args /* Args */};
1299 /* A static operand information for mask_type func (vector_type, vector_type)
1300 * function registration. */
1301 static CONSTEXPR const rvv_op_info i_mvv_ops
1302 = {i_ops, /* Types */
1303 OP_TYPE_vv, /* Suffix */
1304 rvv_arg_type_info (RVV_BASE_mask), /* Return type */
1305 vv_args /* Args */};
1307 /* A static operand information for mask_type func (vector_type, vector_type)
1308 * function registration. */
1309 static CONSTEXPR const rvv_op_info u_mvv_ops
1310 = {u_ops, /* Types */
1311 OP_TYPE_vv, /* Suffix */
1312 rvv_arg_type_info (RVV_BASE_mask), /* Return type */
1313 vv_args /* Args */};
1315 /* A static operand information for mask_type func (vector_type, vector_type)
1316 * function registration. */
1317 static CONSTEXPR const rvv_op_info f_mvv_ops
1318 = {f_ops, /* Types */
1319 OP_TYPE_vv, /* Suffix */
1320 rvv_arg_type_info (RVV_BASE_mask), /* Return type */
1321 vv_args /* Args */};
1323 /* A static operand information for mask_type func (vector_type, scalar_type)
1324 * function registration. */
1325 static CONSTEXPR const rvv_op_info iu_mvx_ops
1326 = {iu_ops, /* Types */
1327 OP_TYPE_vx, /* Suffix */
1328 rvv_arg_type_info (RVV_BASE_mask), /* Return type */
1329 vx_args /* Args */};
1331 /* A static operand information for mask_type func (vector_type, scalar_type)
1332 * function registration. */
1333 static CONSTEXPR const rvv_op_info i_mvx_ops
1334 = {i_ops, /* Types */
1335 OP_TYPE_vx, /* Suffix */
1336 rvv_arg_type_info (RVV_BASE_mask), /* Return type */
1337 vx_args /* Args */};
1339 /* A static operand information for mask_type func (vector_type, scalar_type)
1340 * function registration. */
1341 static CONSTEXPR const rvv_op_info u_mvx_ops
1342 = {u_ops, /* Types */
1343 OP_TYPE_vx, /* Suffix */
1344 rvv_arg_type_info (RVV_BASE_mask), /* Return type */
1345 vx_args /* Args */};
1347 /* A static operand information for mask_type func (vector_type, scalar_type)
1348 * function registration. */
1349 static CONSTEXPR const rvv_op_info f_mvf_ops
1350 = {f_ops, /* Types */
1351 OP_TYPE_vf, /* Suffix */
1352 rvv_arg_type_info (RVV_BASE_mask), /* Return type */
1353 vx_args /* Args */};
1355 /* A static operand information for vector_type func (vector_type, vector_type)
1356 * function registration. */
1357 static CONSTEXPR const rvv_op_info i_vvv_ops
1358 = {i_ops, /* Types */
1359 OP_TYPE_vv, /* Suffix */
1360 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1361 vv_args /* Args */};
1363 /* A static operand information for vector_type func (vector_type, vector_type)
1364 * function registration. */
1365 static CONSTEXPR const rvv_op_info u_vvv_ops
1366 = {u_ops, /* Types */
1367 OP_TYPE_vv, /* Suffix */
1368 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1369 vv_args /* Args */};
1371 /* A static operand information for vector_type func (vector_type, vector_type)
1372 * function registration. */
1373 static CONSTEXPR const rvv_op_info f_vvv_ops
1374 = {f_ops, /* Types */
1375 OP_TYPE_vv, /* Suffix */
1376 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1377 vv_args /* Args */};
1379 /* A static operand information for vector_type func (vector_type, vector_type)
1380 * function registration. */
1381 static CONSTEXPR const rvv_op_info f_vvf_ops
1382 = {f_ops, /* Types */
1383 OP_TYPE_vf, /* Suffix */
1384 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1385 vx_args /* Args */};
1387 /* A static operand information for vector_type func (vector_type, vector_type)
1388 * function registration. */
1389 static CONSTEXPR const rvv_op_info full_v_i_vvv_ops
1390 = {full_v_i_ops, /* Types */
1391 OP_TYPE_vv, /* Suffix */
1392 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1393 vv_args /* Args */};
1395 /* A static operand information for vector_type func (vector_type, vector_type)
1396 * function registration. */
1397 static CONSTEXPR const rvv_op_info full_v_u_vvv_ops
1398 = {full_v_u_ops, /* Types */
1399 OP_TYPE_vv, /* Suffix */
1400 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1401 vv_args /* Args */};
1403 /* A static operand information for vector_type func (signed vector_type,
1404 * unsigned vector_type) function registration. */
1405 static CONSTEXPR const rvv_op_info full_v_i_su_vvv_ops
1406 = {full_v_i_ops, /* Types */
1407 OP_TYPE_vv, /* Suffix */
1408 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1409 su_vv_args /* Args */};
1411 /* A static operand information for vector_type func (vector_type, scalar_type)
1412 * function registration. */
1413 static CONSTEXPR const rvv_op_info iu_vvx_ops
1414 = {iu_ops, /* Types */
1415 OP_TYPE_vx, /* Suffix */
1416 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1417 vx_args /* Args */};
1419 /* A static operand information for vector_type func (vector_type, scalar_type)
1420 * function registration. */
1421 static CONSTEXPR const rvv_op_info all_vvx_ops
1422 = {all_ops, /* Types */
1423 OP_TYPE_vx, /* Suffix */
1424 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1425 v_size_args /* Args */};
1427 /* A static operand information for vector_type func (vector_type, vector_type,
1428 * scalar_type) function registration. */
1429 static CONSTEXPR const rvv_op_info all_vvvx_ops
1430 = {all_ops, /* Types */
1431 OP_TYPE_vx, /* Suffix */
1432 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1433 vv_size_args /* Args */};
1435 /* A static operand information for vector_type func (vector_type, scalar_type)
1436 * function registration. */
1437 static CONSTEXPR const rvv_op_info i_vvx_ops
1438 = {i_ops, /* Types */
1439 OP_TYPE_vx, /* Suffix */
1440 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1441 vx_args /* Args */};
1443 /* A static operand information for vector_type func (vector_type, scalar_type)
1444 * function registration. */
1445 static CONSTEXPR const rvv_op_info u_vvx_ops
1446 = {u_ops, /* Types */
1447 OP_TYPE_vx, /* Suffix */
1448 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1449 vx_args /* Args */};
1451 /* A static operand information for vector_type func (vector_type, scalar_type)
1452 * function registration that require full 'V' extension. */
1453 static CONSTEXPR const rvv_op_info full_v_i_vvx_ops
1454 = {full_v_i_ops, /* Types */
1455 OP_TYPE_vx, /* Suffix */
1456 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1457 vx_args /* Args */};
1459 /* A static operand information for vector_type func (vector_type, scalar_type)
1460 * function registration that require full 'V' extension. */
1461 static CONSTEXPR const rvv_op_info full_v_u_vvx_ops
1462 = {full_v_u_ops, /* Types */
1463 OP_TYPE_vx, /* Suffix */
1464 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1465 vx_args /* Args */};
1467 /* A static operand information for vector_type func (signed vector_type,
1468 * unsigned scalar_type) function registration that require full 'V' extension.
1470 static CONSTEXPR const rvv_op_info full_v_i_su_vvx_ops
1471 = {full_v_i_ops, /* Types */
1472 OP_TYPE_vx, /* Suffix */
1473 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1474 su_vx_args /* Args */};
1476 /* A static operand information for vector_type func (vector_type, shift_type)
1477 * function registration. */
1478 static CONSTEXPR const rvv_op_info iu_shift_vvv_ops
1479 = {iu_ops, /* Types */
1480 OP_TYPE_vv, /* Suffix */
1481 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1482 shift_vv_args /* Args */};
1484 /* A static operand information for scalar_type func (vector_type, size_t)
1485 * function registration. */
1486 static CONSTEXPR const rvv_op_info iu_x_s_u_ops
1487 = {iu_ops, /* Types */
1488 OP_TYPE_vx, /* Suffix */
1489 rvv_arg_type_info (RVV_BASE_scalar), /* Return type */
1490 v_size_args /* Args */};
1492 /* A static operand information for vector_type func (vector_type, size_t)
1493 * function registration. */
1494 static CONSTEXPR const rvv_op_info iu_shift_vvx_ops
1495 = {iu_ops, /* Types */
1496 OP_TYPE_vx, /* Suffix */
1497 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1498 v_size_args /* Args */};
1500 /* A static operand information for vector_type func (vector_type, shift_type)
1501 * function registration. */
1502 static CONSTEXPR const rvv_op_info i_shift_vvv_ops
1503 = {i_ops, /* Types */
1504 OP_TYPE_vv, /* Suffix */
1505 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1506 shift_vv_args /* Args */};
1508 /* A static operand information for vector_type func (vector_type, size_t)
1509 * function registration. */
1510 static CONSTEXPR const rvv_op_info i_shift_vvx_ops
1511 = {i_ops, /* Types */
1512 OP_TYPE_vx, /* Suffix */
1513 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1514 v_size_args /* Args */};
1516 /* A static operand information for vector_type func (vector_type, shift_type)
1517 * function registration. */
1518 static CONSTEXPR const rvv_op_info u_shift_vvv_ops
1519 = {u_ops, /* Types */
1520 OP_TYPE_vv, /* Suffix */
1521 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1522 shift_vv_args /* Args */};
1524 /* A static operand information for vector_type func (vector_type, size_t)
1525 * function registration. */
1526 static CONSTEXPR const rvv_op_info u_shift_vvx_ops
1527 = {u_ops, /* Types */
1528 OP_TYPE_vx, /* Suffix */
1529 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1530 v_size_args /* Args */};
1532 /* A static operand information for vector_type func (vector_type, index_type)
1533 * function registration. */
1534 static CONSTEXPR const rvv_op_info all_gather_vvv_ops
1535 = {all_ops, /* Types */
1536 OP_TYPE_vv, /* Suffix */
1537 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1538 gather_vv_args /* Args */};
1540 /* A static operand information for vector_type func (vector_type, size_t)
1541 * function registration. */
1542 static CONSTEXPR const rvv_op_info all_gather_vvx_ops
1543 = {all_ops, /* Types */
1544 OP_TYPE_vx, /* Suffix */
1545 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1546 v_size_args /* Args */};
1548 /* A static operand information for vector_type func (vector_type, index_type)
1549 * function registration. */
1550 static CONSTEXPR const rvv_op_info all_gatherei16_vvv_ops
1551 = {ei16_ops, /* Types */
1552 OP_TYPE_vv, /* Suffix */
1553 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1554 gatherei16_vv_args /* Args */};
1556 /* A static operand information for vector_type func (vector_type)
1557 * function registration. */
1558 static CONSTEXPR const rvv_op_info iu_v_ops
1559 = {iu_ops, /* Types */
1560 OP_TYPE_v, /* Suffix */
1561 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1562 v_args /* Args */};
1564 /* A static operand information for scalar_type func (vector_type)
1565 * function registration. */
1566 static CONSTEXPR const rvv_op_info iu_x_s_ops
1567 = {iu_ops, /* Types */
1568 OP_TYPE_s, /* Suffix */
1569 rvv_arg_type_info (RVV_BASE_scalar), /* Return type */
1570 v_args /* Args */};
1572 /* A static operand information for scalar_type func (vector_type)
1573 * function registration. */
1574 static CONSTEXPR const rvv_op_info f_f_s_ops
1575 = {f_ops, /* Types */
1576 OP_TYPE_s, /* Suffix */
1577 rvv_arg_type_info (RVV_BASE_scalar), /* Return type */
1578 v_args /* Args */};
1580 /* A static operand information for vector_type func (vector_type)
1581 * function registration. */
1582 static CONSTEXPR const rvv_op_info iu_vs_ops
1583 = {iu_ops, /* Types */
1584 OP_TYPE_vs, /* Suffix */
1585 rvv_arg_type_info (RVV_BASE_lmul1_vector), /* Return type */
1586 vs_args /* Args */};
1588 /* A static operand information for vector_type func (vector_type)
1589 * function registration. */
1590 static CONSTEXPR const rvv_op_info f_vs_ops
1591 = {f_ops, /* Types */
1592 OP_TYPE_vs, /* Suffix */
1593 rvv_arg_type_info (RVV_BASE_lmul1_vector), /* Return type */
1594 vs_args /* Args */};
1596 /* A static operand information for vector_type func (vector_type)
1597 * function registration. */
1598 static CONSTEXPR const rvv_op_info wi_vs_ops
1599 = {wi_ops, /* Types */
1600 OP_TYPE_vs, /* Suffix */
1601 rvv_arg_type_info (RVV_BASE_widen_lmul1_vector), /* Return type */
1602 wvs_args /* Args */};
1604 /* A static operand information for vector_type func (vector_type)
1605 * function registration. */
1606 static CONSTEXPR const rvv_op_info wu_vs_ops
1607 = {wu_ops, /* Types */
1608 OP_TYPE_vs, /* Suffix */
1609 rvv_arg_type_info (RVV_BASE_widen_lmul1_vector), /* Return type */
1610 wvs_args /* Args */};
1612 /* A static operand information for vector_type func (vector_type)
1613 * function registration. */
1614 static CONSTEXPR const rvv_op_info wf_vs_ops
1615 = {wf_ops, /* Types */
1616 OP_TYPE_vs, /* Suffix */
1617 rvv_arg_type_info (RVV_BASE_widen_lmul1_vector), /* Return type */
1618 wvs_args /* Args */};
1620 /* A static operand information for vector_type func (vector_type)
1621 * function registration. */
1622 static CONSTEXPR const rvv_op_info f_v_ops
1623 = {f_ops, /* Types */
1624 OP_TYPE_v, /* Suffix */
1625 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1626 v_args /* Args */};
1628 /* A static operand information for vector_type func (vector_type)
1629 * function registration. */
1630 static CONSTEXPR const rvv_op_info f_to_u_v_ops
1631 = {convert_u_ops, /* Types */
1632 OP_TYPE_v, /* Suffix */
1633 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1634 f_v_args /* Args */};
1636 /* A static operand information for vector_type func (vector_type)
1637 * function registration. */
1638 static CONSTEXPR const rvv_op_info f_to_i_f_v_ops
1639 = {convert_i_ops, /* Types */
1640 OP_TYPE_f_v, /* Suffix */
1641 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1642 f_v_args /* Args */};
1644 /* A static operand information for vector_type func (vector_type)
1645 * function registration. */
1646 static CONSTEXPR const rvv_op_info f_to_wi_f_v_ops
1647 = {wconvert_i_ops, /* Types */
1648 OP_TYPE_f_v, /* Suffix */
1649 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1650 trunc_f_v_args /* Args */};
1652 /* A static operand information for vector_type func (vector_type)
1653 * function registration. */
1654 static CONSTEXPR const rvv_op_info f_to_ni_f_w_ops
1655 = {f_ops, /* Types */
1656 OP_TYPE_f_w, /* Suffix */
1657 rvv_arg_type_info (RVV_BASE_double_trunc_signed_vector), /* Return type */
1658 v_args /* Args */};
1660 /* A static operand information for vector_type func (vector_type)
1661 * function registration. */
1662 static CONSTEXPR const rvv_op_info f_to_nu_f_w_ops
1663 = {f_ops, /* Types */
1664 OP_TYPE_f_w, /* Suffix */
1665 rvv_arg_type_info (
1666 RVV_BASE_double_trunc_unsigned_vector), /* Return type */
1667 v_args /* Args */};
1669 /* A static operand information for vector_type func (vector_type)
1670 * function registration. */
1671 static CONSTEXPR const rvv_op_info i_to_f_x_v_ops
1672 = {f_ops, /* Types */
1673 OP_TYPE_x_v, /* Suffix */
1674 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1675 x_v_args /* Args */};
1677 /* A static operand information for vector_type func (vector_type)
1678 * function registration. */
1679 static CONSTEXPR const rvv_op_info u_to_f_xu_v_ops
1680 = {f_ops, /* Types */
1681 OP_TYPE_xu_v, /* Suffix */
1682 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1683 xu_v_args /* Args */};
1685 /* A static operand information for vector_type func (vector_type)
1686 * function registration. */
1687 static CONSTEXPR const rvv_op_info i_to_wf_x_v_ops
1688 = {f_ops, /* Types */
1689 OP_TYPE_x_v, /* Suffix */
1690 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1691 w_x_v_args /* Args */};
1693 /* A static operand information for vector_type func (vector_type)
1694 * function registration. */
1695 static CONSTEXPR const rvv_op_info u_to_wf_xu_v_ops
1696 = {f_ops, /* Types */
1697 OP_TYPE_xu_v, /* Suffix */
1698 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1699 w_xu_v_args /* Args */};
1701 /* A static operand information for vector_type func (vector_type)
1702 * function registration. */
1703 static CONSTEXPR const rvv_op_info i_to_nf_x_w_ops
1704 = {wconvert_i_ops, /* Types */
1705 OP_TYPE_x_w, /* Suffix */
1706 rvv_arg_type_info (RVV_BASE_double_trunc_float_vector), /* Return type */
1707 v_args /* Args */};
1709 /* A static operand information for vector_type func (vector_type)
1710 * function registration. */
1711 static CONSTEXPR const rvv_op_info u_to_nf_xu_w_ops
1712 = {wconvert_u_ops, /* Types */
1713 OP_TYPE_xu_w, /* Suffix */
1714 rvv_arg_type_info (RVV_BASE_double_trunc_float_vector), /* Return type */
1715 v_args /* Args */};
1717 /* A static operand information for vector_type func (vector_type)
1718 * function registration. */
1719 static CONSTEXPR const rvv_op_info f_to_u_f_v_ops
1720 = {convert_u_ops, /* Types */
1721 OP_TYPE_f_v, /* Suffix */
1722 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1723 f_v_args /* Args */};
1725 /* A static operand information for vector_type func (vector_type)
1726 * function registration. */
1727 static CONSTEXPR const rvv_op_info f_to_wu_f_v_ops
1728 = {wconvert_u_ops, /* Types */
1729 OP_TYPE_f_v, /* Suffix */
1730 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1731 trunc_f_v_args /* Args */};
1733 /* A static operand information for vector_type func (vector_type)
1734 * function registration. */
1735 static CONSTEXPR const rvv_op_info f_to_wf_f_v_ops
1736 = {f_ops, /* Types */
1737 OP_TYPE_f_v, /* Suffix */
1738 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1739 w_v_args /* Args */};
1741 /* A static operand information for vector_type func (vector_type)
1742 * function registration. */
1743 static CONSTEXPR const rvv_op_info f_to_nf_f_w_ops
1744 = {wconvert_f_ops, /* Types */
1745 OP_TYPE_f_w, /* Suffix */
1746 rvv_arg_type_info (RVV_BASE_double_trunc_float_vector), /* Return type */
1747 v_args /* Args */};
1749 /* A static operand information for vector_type func (vector_type)
1750 * function registration. */
1751 static CONSTEXPR const rvv_op_info all_v_ops
1752 = {all_ops, /* Types */
1753 OP_TYPE_v, /* Suffix */
1754 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1755 v_args /* Args */};
1757 /* A static operand information for vector_type func (vector_type)
1758 * function registration. */
1759 static CONSTEXPR const rvv_op_info i_v_u_ops
1760 = {i_ops, /* Types */
1761 OP_TYPE_v, /* Suffix */
1762 rvv_arg_type_info (RVV_BASE_unsigned_vector), /* Return type */
1763 v_args /* Args */};
1765 /* A static operand information for vector_type func (vector_type)
1766 * function registration. */
1767 static CONSTEXPR const rvv_op_info u_v_i_ops
1768 = {u_ops, /* Types */
1769 OP_TYPE_v, /* Suffix */
1770 rvv_arg_type_info (RVV_BASE_signed_vector), /* Return type */
1771 v_args /* Args */};
1773 /* A static operand information for vector_type func (vector_type)
1774 * function registration. */
1775 static CONSTEXPR const rvv_op_info iu_v_eew8_interpret_ops
1776 = {eew8_interpret_ops, /* Types */
1777 OP_TYPE_v, /* Suffix */
1778 rvv_arg_type_info (RVV_BASE_eew8_interpret), /* Return type */
1779 v_args /* Args */};
1781 /* A static operand information for vector_type func (vector_type)
1782 * function registration. */
1783 static CONSTEXPR const rvv_op_info iu_v_eew16_interpret_ops
1784 = {eew16_interpret_ops, /* Types */
1785 OP_TYPE_v, /* Suffix */
1786 rvv_arg_type_info (RVV_BASE_eew16_interpret), /* Return type */
1787 v_args /* Args */};
1789 /* A static operand information for vector_type func (vector_type)
1790 * function registration. */
1791 static CONSTEXPR const rvv_op_info iu_v_eew32_interpret_ops
1792 = {eew32_interpret_ops, /* Types */
1793 OP_TYPE_v, /* Suffix */
1794 rvv_arg_type_info (RVV_BASE_eew32_interpret), /* Return type */
1795 v_args /* Args */};
1797 /* A static operand information for vector_type func (vector_type)
1798 * function registration. */
1799 static CONSTEXPR const rvv_op_info iu_v_eew64_interpret_ops
1800 = {eew64_interpret_ops, /* Types */
1801 OP_TYPE_v, /* Suffix */
1802 rvv_arg_type_info (RVV_BASE_eew64_interpret), /* Return type */
1803 v_args /* Args */};
1805 /* A static operand information for vbool1_t func (vector_type)
1806 * function registration. */
1807 static CONSTEXPR const rvv_op_info iu_v_bool1_interpret_ops
1808 = {bool1_interpret_ops, /* Types */
1809 OP_TYPE_v, /* Suffix */
1810 rvv_arg_type_info (RVV_BASE_bool1_interpret), /* Return type */
1811 v_args /* Args */};
1813 /* A static operand information for vbool2_t func (vector_type)
1814 * function registration. */
1815 static CONSTEXPR const rvv_op_info iu_v_bool2_interpret_ops
1816 = {bool2_interpret_ops, /* Types */
1817 OP_TYPE_v, /* Suffix */
1818 rvv_arg_type_info (RVV_BASE_bool2_interpret), /* Return type */
1819 v_args /* Args */};
1821 /* A static operand information for vbool4_t func (vector_type)
1822 * function registration. */
1823 static CONSTEXPR const rvv_op_info iu_v_bool4_interpret_ops
1824 = {bool4_interpret_ops, /* Types */
1825 OP_TYPE_v, /* Suffix */
1826 rvv_arg_type_info (RVV_BASE_bool4_interpret), /* Return type */
1827 v_args /* Args */};
1829 /* A static operand information for vbool8_t func (vector_type)
1830 * function registration. */
1831 static CONSTEXPR const rvv_op_info iu_v_bool8_interpret_ops
1832 = {bool8_interpret_ops, /* Types */
1833 OP_TYPE_v, /* Suffix */
1834 rvv_arg_type_info (RVV_BASE_bool8_interpret), /* Return type */
1835 v_args /* Args */};
1837 /* A static operand information for vbool16_t func (vector_type)
1838 * function registration. */
1839 static CONSTEXPR const rvv_op_info iu_v_bool16_interpret_ops
1840 = {bool16_interpret_ops, /* Types */
1841 OP_TYPE_v, /* Suffix */
1842 rvv_arg_type_info (RVV_BASE_bool16_interpret), /* Return type */
1843 v_args /* Args */};
1845 /* A static operand information for vbool32_t func (vector_type)
1846 * function registration. */
1847 static CONSTEXPR const rvv_op_info iu_v_bool32_interpret_ops
1848 = {bool32_interpret_ops, /* Types */
1849 OP_TYPE_v, /* Suffix */
1850 rvv_arg_type_info (RVV_BASE_bool32_interpret), /* Return type */
1851 v_args /* Args */};
1853 /* A static operand information for vbool64_t func (vector_type)
1854 * function registration. */
1855 static CONSTEXPR const rvv_op_info iu_v_bool64_interpret_ops
1856 = {bool64_interpret_ops, /* Types */
1857 OP_TYPE_v, /* Suffix */
1858 rvv_arg_type_info (RVV_BASE_bool64_interpret), /* Return type */
1859 v_args /* Args */};
1861 /* A static operand information for vint8_t func (vector_type)
1862 * function registration. */
1863 static CONSTEXPR const rvv_op_info b_v_signed_eew8_lmul1_interpret_ops
1864 = {signed_eew8_lmul1_interpret_ops, /* Types */
1865 OP_TYPE_v, /* Suffix */
1866 rvv_arg_type_info (RVV_BASE_signed_eew8_lmul1_interpret),/* Return type */
1867 v_args /* Args */};
1869 /* A static operand information for vint16_t func (vector_type)
1870 * function registration. */
1871 static CONSTEXPR const rvv_op_info b_v_signed_eew16_lmul1_interpret_ops
1872 = {signed_eew16_lmul1_interpret_ops, /* Types */
1873 OP_TYPE_v, /* Suffix */
1874 rvv_arg_type_info (RVV_BASE_signed_eew16_lmul1_interpret),/* Return type */
1875 v_args /* Args */};
1877 /* A static operand information for vint32_t func (vector_type)
1878 * function registration. */
1879 static CONSTEXPR const rvv_op_info b_v_signed_eew32_lmul1_interpret_ops
1880 = {signed_eew32_lmul1_interpret_ops, /* Types */
1881 OP_TYPE_v, /* Suffix */
1882 rvv_arg_type_info (RVV_BASE_signed_eew32_lmul1_interpret),/* Return type */
1883 v_args /* Args */};
1885 /* A static operand information for vint64_t func (vector_type)
1886 * function registration. */
1887 static CONSTEXPR const rvv_op_info b_v_signed_eew64_lmul1_interpret_ops
1888 = {signed_eew64_lmul1_interpret_ops, /* Types */
1889 OP_TYPE_v, /* Suffix */
1890 rvv_arg_type_info (RVV_BASE_signed_eew64_lmul1_interpret),/* Return type */
1891 v_args /* Args */};
1893 /* A static operand information for vuint8_t func (vector_type)
1894 * function registration. */
1895 static CONSTEXPR const rvv_op_info b_v_unsigned_eew8_lmul1_interpret_ops
1896 = {unsigned_eew8_lmul1_interpret_ops, /* Types */
1897 OP_TYPE_v, /* Suffix */
1898 rvv_arg_type_info (RVV_BASE_unsigned_eew8_lmul1_interpret),/* Return type */
1899 v_args /* Args */};
1901 /* A static operand information for vuint16_t func (vector_type)
1902 * function registration. */
1903 static CONSTEXPR const rvv_op_info b_v_unsigned_eew16_lmul1_interpret_ops
1904 = {unsigned_eew16_lmul1_interpret_ops, /* Types */
1905 OP_TYPE_v, /* Suffix */
1906 rvv_arg_type_info (RVV_BASE_unsigned_eew16_lmul1_interpret),/* Return type */
1907 v_args /* Args */};
1909 /* A static operand information for vuint32_t func (vector_type)
1910 * function registration. */
1911 static CONSTEXPR const rvv_op_info b_v_unsigned_eew32_lmul1_interpret_ops
1912 = {unsigned_eew32_lmul1_interpret_ops, /* Types */
1913 OP_TYPE_v, /* Suffix */
1914 rvv_arg_type_info (RVV_BASE_unsigned_eew32_lmul1_interpret),/* Return type */
1915 v_args /* Args */};
1917 /* A static operand information for vuint64_t func (vector_type)
1918 * function registration. */
1919 static CONSTEXPR const rvv_op_info b_v_unsigned_eew64_lmul1_interpret_ops
1920 = {unsigned_eew64_lmul1_interpret_ops, /* Types */
1921 OP_TYPE_v, /* Suffix */
1922 rvv_arg_type_info (RVV_BASE_unsigned_eew64_lmul1_interpret),/* Return type */
1923 v_args /* Args */};
1925 /* A static operand information for vector_type func (vector_type)
1926 * function registration. */
1927 static CONSTEXPR const rvv_op_info all_v_vlmul_ext_x2_ops
1928 = {vlmul_ext_x2_ops, /* Types */
1929 OP_TYPE_v, /* Suffix */
1930 rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), /* Return type */
1931 v_args /* Args */};
1933 /* A static operand information for vector_type func (vector_type)
1934 * function registration. */
1935 static CONSTEXPR const rvv_op_info all_v_vlmul_ext_x4_ops
1936 = {vlmul_ext_x4_ops, /* Types */
1937 OP_TYPE_v, /* Suffix */
1938 rvv_arg_type_info (RVV_BASE_vlmul_ext_x4), /* Return type */
1939 v_args /* Args */};
1941 /* A static operand information for vector_type func (vector_type)
1942 * function registration. */
1943 static CONSTEXPR const rvv_op_info all_v_vlmul_ext_x8_ops
1944 = {vlmul_ext_x8_ops, /* Types */
1945 OP_TYPE_v, /* Suffix */
1946 rvv_arg_type_info (RVV_BASE_vlmul_ext_x8), /* Return type */
1947 v_args /* Args */};
1949 /* A static operand information for vector_type func (vector_type)
1950 * function registration. */
1951 static CONSTEXPR const rvv_op_info all_v_vlmul_ext_x16_ops
1952 = {vlmul_ext_x16_ops, /* Types */
1953 OP_TYPE_v, /* Suffix */
1954 rvv_arg_type_info (RVV_BASE_vlmul_ext_x16), /* Return type */
1955 v_args /* Args */};
1957 /* A static operand information for vector_type func (vector_type)
1958 * function registration. */
1959 static CONSTEXPR const rvv_op_info all_v_vlmul_ext_x32_ops
1960 = {vlmul_ext_x32_ops, /* Types */
1961 OP_TYPE_v, /* Suffix */
1962 rvv_arg_type_info (RVV_BASE_vlmul_ext_x32), /* Return type */
1963 v_args /* Args */};
1965 /* A static operand information for vector_type func (vector_type)
1966 * function registration. */
1967 static CONSTEXPR const rvv_op_info all_v_vlmul_ext_x64_ops
1968 = {vlmul_ext_x64_ops, /* Types */
1969 OP_TYPE_v, /* Suffix */
1970 rvv_arg_type_info (RVV_BASE_vlmul_ext_x64), /* Return type */
1971 v_args /* Args */};
1973 /* A static operand information for vector_type func (vector_type)
1974 * function registration. */
1975 static CONSTEXPR const rvv_op_info all_v_vlmul_trunc_x2_ops
1976 = {vlmul_ext_x2_ops, /* Types */
1977 OP_TYPE_v, /* Suffix */
1978 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1979 v_x2_trunc_args /* Args */};
1981 /* A static operand information for vector_type func (vector_type)
1982 * function registration. */
1983 static CONSTEXPR const rvv_op_info all_v_vlmul_trunc_x4_ops
1984 = {vlmul_ext_x4_ops, /* Types */
1985 OP_TYPE_v, /* Suffix */
1986 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1987 v_x4_trunc_args /* Args */};
1989 /* A static operand information for vector_type func (vector_type)
1990 * function registration. */
1991 static CONSTEXPR const rvv_op_info all_v_vlmul_trunc_x8_ops
1992 = {vlmul_ext_x8_ops, /* Types */
1993 OP_TYPE_v, /* Suffix */
1994 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
1995 v_x8_trunc_args /* Args */};
1997 /* A static operand information for vector_type func (vector_type)
1998 * function registration. */
1999 static CONSTEXPR const rvv_op_info all_v_vlmul_trunc_x16_ops
2000 = {vlmul_ext_x16_ops, /* Types */
2001 OP_TYPE_v, /* Suffix */
2002 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2003 v_x16_trunc_args /* Args */};
2005 /* A static operand information for vector_type func (vector_type)
2006 * function registration. */
2007 static CONSTEXPR const rvv_op_info all_v_vlmul_trunc_x32_ops
2008 = {vlmul_ext_x32_ops, /* Types */
2009 OP_TYPE_v, /* Suffix */
2010 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2011 v_x32_trunc_args /* Args */};
2013 /* A static operand information for vector_type func (vector_type)
2014 * function registration. */
2015 static CONSTEXPR const rvv_op_info all_v_vlmul_trunc_x64_ops
2016 = {vlmul_ext_x64_ops, /* Types */
2017 OP_TYPE_v, /* Suffix */
2018 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2019 v_x64_trunc_args /* Args */};
2021 /* A static operand information for vector_type func (vector_type)
2022 * function registration. */
2023 static CONSTEXPR const rvv_op_info f_v_i_ops
2024 = {f_ops, /* Types */
2025 OP_TYPE_v, /* Suffix */
2026 rvv_arg_type_info (RVV_BASE_signed_vector), /* Return type */
2027 v_args /* Args */};
2029 /* A static operand information for vector_type func (vector_type)
2030 * function registration. */
2031 static CONSTEXPR const rvv_op_info f_v_u_ops
2032 = {f_ops, /* Types */
2033 OP_TYPE_v, /* Suffix */
2034 rvv_arg_type_info (RVV_BASE_unsigned_vector), /* Return type */
2035 v_args /* Args */};
2037 /* A static operand information for vector_type func (vector_type)
2038 * function registration. */
2039 static CONSTEXPR const rvv_op_info i_v_f_ops
2040 = {f_ops, /* Types */
2041 OP_TYPE_v, /* Suffix */
2042 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2043 x_v_args /* Args */};
2045 /* A static operand information for vector_type func (vector_type)
2046 * function registration. */
2047 static CONSTEXPR const rvv_op_info u_v_f_ops
2048 = {f_ops, /* Types */
2049 OP_TYPE_v, /* Suffix */
2050 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2051 xu_v_args /* Args */};
2053 /* A static operand information for vector_type func (scalar_type)
2054 * function registration. */
2055 static CONSTEXPR const rvv_op_info iu_x_ops
2056 = {iu_ops, /* Types */
2057 OP_TYPE_x, /* Suffix */
2058 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2059 x_args /* Args */};
2061 /* A static operand information for vector_type func (scalar_type)
2062 * function registration. */
2063 static CONSTEXPR const rvv_op_info iu_s_x_ops
2064 = {iu_ops, /* Types */
2065 OP_TYPE_x, /* Suffix */
2066 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2067 x_args /* Args */};
2069 /* A static operand information for vector_type func (scalar_type)
2070 * function registration. */
2071 static CONSTEXPR const rvv_op_info f_f_ops
2072 = {f_ops, /* Types */
2073 OP_TYPE_f, /* Suffix */
2074 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2075 x_args /* Args */};
2077 /* A static operand information for vector_type func (scalar_type)
2078 * function registration. */
2079 static CONSTEXPR const rvv_op_info f_s_f_ops
2080 = {f_ops, /* Types */
2081 OP_TYPE_f, /* Suffix */
2082 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2083 x_args /* Args */};
2085 /* A static operand information for vector_type func (double demote type)
2086 * function registration. */
2087 static CONSTEXPR const rvv_op_info i_vf2_ops
2088 = {wexti_ops, /* Types */
2089 OP_TYPE_vf2, /* Suffix */
2090 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2091 vf2_args /* Args */};
2093 /* A static operand information for vector_type func (quad demote type)
2094 * function registration. */
2095 static CONSTEXPR const rvv_op_info i_vf4_ops
2096 = {qexti_ops, /* Types */
2097 OP_TYPE_vf4, /* Suffix */
2098 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2099 vf4_args /* Args */};
2101 /* A static operand information for vector_type func (oct demote type)
2102 * function registration. */
2103 static CONSTEXPR const rvv_op_info i_vf8_ops
2104 = {oexti_ops, /* Types */
2105 OP_TYPE_vf8, /* Suffix */
2106 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2107 vf8_args /* Args */};
2109 /* A static operand information for vector_type func (double demote type)
2110 * function registration. */
2111 static CONSTEXPR const rvv_op_info u_vf2_ops
2112 = {wextu_ops, /* Types */
2113 OP_TYPE_vf2, /* Suffix */
2114 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2115 vf2_args /* Args */};
2117 /* A static operand information for vector_type func (quad demote type)
2118 * function registration. */
2119 static CONSTEXPR const rvv_op_info u_vf4_ops
2120 = {qextu_ops, /* Types */
2121 OP_TYPE_vf4, /* Suffix */
2122 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2123 vf4_args /* Args */};
2125 /* A static operand information for vector_type func (oct demote type)
2126 * function registration. */
2127 static CONSTEXPR const rvv_op_info u_vf8_ops
2128 = {oextu_ops, /* Types */
2129 OP_TYPE_vf8, /* Suffix */
2130 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2131 vf8_args /* Args */};
2133 /* A static operand information for vector_type func (double demote type, double
2134 * demote type) function registration. */
2135 static CONSTEXPR const rvv_op_info i_wvv_ops
2136 = {wexti_ops, /* Types */
2137 OP_TYPE_vv, /* Suffix */
2138 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2139 wvv_args /* Args */};
2141 /* A static operand information for vector_type func (double demote type, double
2142 * demote type) function registration. */
2143 static CONSTEXPR const rvv_op_info f_wvv_ops
2144 = {wextf_ops, /* Types */
2145 OP_TYPE_vv, /* Suffix */
2146 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2147 wvv_args /* Args */};
2149 /* A static operand information for vector_type func (vector_type, double demote
2150 * type, double demote type) function registration. */
2151 static CONSTEXPR const rvv_op_info i_wwvv_ops
2152 = {wexti_ops, /* Types */
2153 OP_TYPE_vv, /* Suffix */
2154 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2155 wwvv_args /* Args */};
2157 /* A static operand information for vector_type func (vector_type, double demote
2158 * scalar_type, double demote type) function registration. */
2159 static CONSTEXPR const rvv_op_info i_wwxv_ops
2160 = {wexti_ops, /* Types */
2161 OP_TYPE_vx, /* Suffix */
2162 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2163 wwxv_args /* Args */};
2165 /* A static operand information for vector_type func (vector_type, double demote
2166 * type, double demote type) function registration. */
2167 static CONSTEXPR const rvv_op_info f_wwvv_ops
2168 = {wextf_ops, /* Types */
2169 OP_TYPE_vv, /* Suffix */
2170 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2171 wwvv_args /* Args */};
2173 /* A static operand information for vector_type func (vector_type, double demote
2174 * scalar_type, double demote type) function registration. */
2175 static CONSTEXPR const rvv_op_info f_wwfv_ops
2176 = {wextf_ops, /* Types */
2177 OP_TYPE_vf, /* Suffix */
2178 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2179 wwxv_args /* Args */};
2181 /* A static operand information for vector_type func (vector_type, double demote
2182 * type, double demote type) function registration. */
2183 static CONSTEXPR const rvv_op_info u_wwvv_ops
2184 = {wextu_ops, /* Types */
2185 OP_TYPE_vv, /* Suffix */
2186 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2187 wwvv_args /* Args */};
2189 /* A static operand information for vector_type func (vector_type, double demote
2190 * scalar_type, double demote type) function registration. */
2191 static CONSTEXPR const rvv_op_info u_wwxv_ops
2192 = {wextu_ops, /* Types */
2193 OP_TYPE_vx, /* Suffix */
2194 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2195 wwxv_args /* Args */};
2197 /* A static operand information for vector_type func (vector_type, double demote
2198 * type, double demote type) function registration. */
2199 static CONSTEXPR const rvv_op_info i_su_wwvv_ops
2200 = {wexti_ops, /* Types */
2201 OP_TYPE_vv, /* Suffix */
2202 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2203 su_wwvv_args /* Args */};
2205 /* A static operand information for vector_type func (vector_type, double demote
2206 * scalar_type, double demote type) function registration. */
2207 static CONSTEXPR const rvv_op_info i_su_wwxv_ops
2208 = {wexti_ops, /* Types */
2209 OP_TYPE_vx, /* Suffix */
2210 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2211 su_wwxv_args /* Args */};
2213 /* A static operand information for vector_type func (vector_type, double demote
2214 * scalar_type, double demote type) function registration. */
2215 static CONSTEXPR const rvv_op_info i_us_wwxv_ops
2216 = {wexti_ops, /* Types */
2217 OP_TYPE_vx, /* Suffix */
2218 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2219 us_wwxv_args /* Args */};
2221 /* A static operand information for vector_type func (signed double demote type,
2222 * unsigned double demote type) function registration. */
2223 static CONSTEXPR const rvv_op_info i_su_wvv_ops
2224 = {wexti_ops, /* Types */
2225 OP_TYPE_vv, /* Suffix */
2226 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2227 su_wvv_args /* Args */};
2229 /* A static operand information for vector_type func (double demote type, double
2230 * demote type) function registration. */
2231 static CONSTEXPR const rvv_op_info u_wvv_ops
2232 = {wextu_ops, /* Types */
2233 OP_TYPE_vv, /* Suffix */
2234 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2235 wvv_args /* Args */};
2237 /* A static operand information for vector_type func (double demote type, size type)
2238 * function registration. */
2239 static CONSTEXPR const rvv_op_info u_shift_wvx_ops
2240 = {wextu_ops, /* Types */
2241 OP_TYPE_vx, /* Suffix */
2242 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2243 wv_size_args /* Args */};
2245 /* A static operand information for vector_type func (double demote type, double
2246 * demote scalar_type) function registration. */
2247 static CONSTEXPR const rvv_op_info i_wvx_ops
2248 = {wexti_ops, /* Types */
2249 OP_TYPE_vx, /* Suffix */
2250 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2251 wvx_args /* Args */};
2253 /* A static operand information for vector_type func (double demote type, double
2254 * demote scalar_type) function registration. */
2255 static CONSTEXPR const rvv_op_info f_wvf_ops
2256 = {wextf_ops, /* Types */
2257 OP_TYPE_vf, /* Suffix */
2258 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2259 wvx_args /* Args */};
2261 /* A static operand information for vector_type func (signed double demote type,
2262 * unsigned double demote scalar_type) function registration. */
2263 static CONSTEXPR const rvv_op_info i_su_wvx_ops
2264 = {wexti_ops, /* Types */
2265 OP_TYPE_vx, /* Suffix */
2266 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2267 su_wvx_args /* Args */};
2269 /* A static operand information for vector_type func (vector_type, double
2270 * demote type) function registration. */
2271 static CONSTEXPR const rvv_op_info i_wwv_ops
2272 = {wexti_ops, /* Types */
2273 OP_TYPE_wv, /* Suffix */
2274 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2275 wwv_args /* Args */};
2277 /* A static operand information for vector_type func (vector_type, double
2278 * demote type) function registration. */
2279 static CONSTEXPR const rvv_op_info f_wwv_ops
2280 = {wextf_ops, /* Types */
2281 OP_TYPE_wv, /* Suffix */
2282 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2283 wwv_args /* Args */};
2285 /* A static operand information for vector_type func (vector_type, double
2286 * demote scalar_type) function registration. */
2287 static CONSTEXPR const rvv_op_info i_wwx_ops
2288 = {wexti_ops, /* Types */
2289 OP_TYPE_wx, /* Suffix */
2290 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2291 wwx_args /* Args */};
2293 /* A static operand information for vector_type func (vector_type, double
2294 * demote scalar_type) function registration. */
2295 static CONSTEXPR const rvv_op_info f_wwf_ops
2296 = {wextf_ops, /* Types */
2297 OP_TYPE_wf, /* Suffix */
2298 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2299 wwx_args /* Args */};
2301 /* A static operand information for vector_type func (vector_type, double
2302 * demote type) function registration. */
2303 static CONSTEXPR const rvv_op_info u_wwv_ops
2304 = {wextu_ops, /* Types */
2305 OP_TYPE_wv, /* Suffix */
2306 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2307 wwv_args /* Args */};
2309 /* A static operand information for vector_type func (vector_type, double
2310 * demote scalar_type) function registration. */
2311 static CONSTEXPR const rvv_op_info u_wwx_ops
2312 = {wextu_ops, /* Types */
2313 OP_TYPE_wx, /* Suffix */
2314 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2315 wwx_args /* Args */};
2317 /* A static operand information for vector_type func (double demote type, double
2318 * demote scalar_type) function registration. */
2319 static CONSTEXPR const rvv_op_info u_wvx_ops
2320 = {wextu_ops, /* Types */
2321 OP_TYPE_vx, /* Suffix */
2322 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2323 wvx_args /* Args */};
2325 /* A static operand information for vector_type func (double demote type)
2326 * function registration. */
2327 static CONSTEXPR const rvv_op_info i_x_x_v_ops
2328 = {wexti_ops, /* Types */
2329 OP_TYPE_x_v, /* Suffix */
2330 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2331 x_x_v_args /* Args */};
2333 /* A static operand information for vector_type func (unsigned double demote
2334 * type) function registration. */
2335 static CONSTEXPR const rvv_op_info u_x_x_v_ops
2336 = {wextu_ops, /* Types */
2337 OP_TYPE_x_v, /* Suffix */
2338 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2339 x_x_v_args /* Args */};
2341 /* A static operand information for double demote type func (vector_type,
2342 * shift_type) function registration. */
2343 static CONSTEXPR const rvv_op_info i_narrow_shift_vwv_ops
2344 = {wexti_ops, /* Types */
2345 OP_TYPE_wv, /* Suffix */
2346 rvv_arg_type_info (RVV_BASE_double_trunc_vector), /* Return type */
2347 shift_wv_args /* Args */};
2349 /* A static operand information for double demote type func (vector_type,
2350 * shift_type) function registration. */
2351 static CONSTEXPR const rvv_op_info u_narrow_shift_vwv_ops
2352 = {wextu_ops, /* Types */
2353 OP_TYPE_wv, /* Suffix */
2354 rvv_arg_type_info (RVV_BASE_double_trunc_vector), /* Return type */
2355 shift_wv_args /* Args */};
2357 /* A static operand information for double demote type func (vector_type,
2358 * size_t) function registration. */
2359 static CONSTEXPR const rvv_op_info i_narrow_shift_vwx_ops
2360 = {wexti_ops, /* Types */
2361 OP_TYPE_wx, /* Suffix */
2362 rvv_arg_type_info (RVV_BASE_double_trunc_vector), /* Return type */
2363 v_size_args /* Args */};
2365 /* A static operand information for double demote type func (vector_type,
2366 * size_t) function registration. */
2367 static CONSTEXPR const rvv_op_info u_narrow_shift_vwx_ops
2368 = {wextu_ops, /* Types */
2369 OP_TYPE_wx, /* Suffix */
2370 rvv_arg_type_info (RVV_BASE_double_trunc_vector), /* Return type */
2371 v_size_args /* Args */};
2373 /* A static operand information for double demote type func (vector_type)
2374 * function registration. */
2375 static CONSTEXPR const rvv_op_info iu_trunc_ops
2376 = {wextiu_ops, /* Types */
2377 OP_TYPE_x_w, /* Suffix */
2378 rvv_arg_type_info (RVV_BASE_double_trunc_vector), /* Return type */
2379 v_args /* Args */};
2381 /* A static operand information for vector_type func (vector_type)
2382 * function registration. */
2383 static CONSTEXPR const rvv_op_info all_v_vset_lmul1_x2_ops
2384 = {lmul1_ops, /* Types */
2385 OP_TYPE_v, /* Suffix */
2386 rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), /* Return type */
2387 ext_x2_vset_args /* Args */};
2389 /* A static operand information for vector_type func (vector_type)
2390 * function registration. */
2391 static CONSTEXPR const rvv_op_info all_v_vset_lmul1_x4_ops
2392 = {lmul1_ops, /* Types */
2393 OP_TYPE_v, /* Suffix */
2394 rvv_arg_type_info (RVV_BASE_vlmul_ext_x4), /* Return type */
2395 ext_x4_vset_args /* Args */};
2397 /* A static operand information for vector_type func (vector_type)
2398 * function registration. */
2399 static CONSTEXPR const rvv_op_info all_v_vset_lmul1_x8_ops
2400 = {lmul1_ops, /* Types */
2401 OP_TYPE_v, /* Suffix */
2402 rvv_arg_type_info (RVV_BASE_vlmul_ext_x8), /* Return type */
2403 ext_x8_vset_args /* Args */};
2405 /* A static operand information for vector_type func (vector_type)
2406 * function registration. */
2407 static CONSTEXPR const rvv_op_info all_v_vset_lmul2_x2_ops
2408 = {lmul2_ops, /* Types */
2409 OP_TYPE_v, /* Suffix */
2410 rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), /* Return type */
2411 ext_x2_vset_args /* Args */};
2413 /* A static operand information for vector_type func (vector_type)
2414 * function registration. */
2415 static CONSTEXPR const rvv_op_info all_v_vset_lmul2_x4_ops
2416 = {lmul2_ops, /* Types */
2417 OP_TYPE_v, /* Suffix */
2418 rvv_arg_type_info (RVV_BASE_vlmul_ext_x4), /* Return type */
2419 ext_x4_vset_args /* Args */};
2421 /* A static operand information for vector_type func (vector_type)
2422 * function registration. */
2423 static CONSTEXPR const rvv_op_info all_v_vset_lmul4_x2_ops
2424 = {lmul4_ops, /* Types */
2425 OP_TYPE_v, /* Suffix */
2426 rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), /* Return type */
2427 ext_x2_vset_args /* Args */};
2429 /* A static operand information for vector_type func (vector_type)
2430 * function registration. */
2431 static CONSTEXPR const rvv_op_info all_v_vget_lmul1_x2_ops
2432 = {lmul1_ops, /* Types */
2433 OP_TYPE_v, /* Suffix */
2434 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2435 ext_x2_vget_args /* Args */};
2437 /* A static operand information for vector_type func (vector_type)
2438 * function registration. */
2439 static CONSTEXPR const rvv_op_info all_v_vget_lmul1_x4_ops
2440 = {lmul1_ops, /* Types */
2441 OP_TYPE_v, /* Suffix */
2442 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2443 ext_x4_vget_args /* Args */};
2445 /* A static operand information for vector_type func (vector_type)
2446 * function registration. */
2447 static CONSTEXPR const rvv_op_info all_v_vget_lmul1_x8_ops
2448 = {lmul1_ops, /* Types */
2449 OP_TYPE_v, /* Suffix */
2450 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2451 ext_x8_vget_args /* Args */};
2453 /* A static operand information for vector_type func (vector_type)
2454 * function registration. */
2455 static CONSTEXPR const rvv_op_info all_v_vget_lmul2_x2_ops
2456 = {lmul2_ops, /* Types */
2457 OP_TYPE_v, /* Suffix */
2458 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2459 ext_x2_vget_args /* Args */};
2461 /* A static operand information for vector_type func (vector_type)
2462 * function registration. */
2463 static CONSTEXPR const rvv_op_info all_v_vget_lmul2_x4_ops
2464 = {lmul2_ops, /* Types */
2465 OP_TYPE_v, /* Suffix */
2466 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2467 ext_x4_vget_args /* Args */};
2469 /* A static operand information for vector_type func (vector_type)
2470 * function registration. */
2471 static CONSTEXPR const rvv_op_info all_v_vget_lmul4_x2_ops
2472 = {lmul4_ops, /* Types */
2473 OP_TYPE_v, /* Suffix */
2474 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2475 ext_x2_vget_args /* Args */};
2477 /* A static operand information for size_t func () function registration. */
2478 static CONSTEXPR const rvv_op_info p_none_void_ops
2479 = {none_ops, /* Types */
2480 OP_TYPE_none, /* Suffix */
2481 rvv_arg_type_info (RVV_BASE_size), /* Return type */
2482 void_args /* Args */};
2484 /* A static operand information for unsigned long func () function registration. */
2485 static CONSTEXPR const rvv_op_info ul_none_void_ops
2486 = {none_ops, /* Types */
2487 OP_TYPE_none, /* Suffix */
2488 rvv_arg_type_info (RVV_BASE_unsigned_long), /* Return type */
2489 void_args /* Args */};
2491 /* A static operand information for vector_type func (vector_type)
2492 * function registration. */
2493 static CONSTEXPR const rvv_op_info all_v_vset_tuple_ops
2494 = {tuple_ops, /* Types */
2495 OP_TYPE_v, /* Suffix */
2496 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2497 tuple_vset_args /* Args */};
2499 /* A static operand information for vector_type func (vector_type)
2500 * function registration. */
2501 static CONSTEXPR const rvv_op_info all_v_vget_tuple_ops
2502 = {tuple_ops, /* Types */
2503 OP_TYPE_v, /* Suffix */
2504 rvv_arg_type_info (RVV_BASE_tuple_subpart), /* Return type */
2505 v_size_args /* Args */};
2507 /* A static operand information for vector_type func (const scalar_type *)
2508 * function registration. */
2509 static CONSTEXPR const rvv_op_info tuple_v_scalar_const_ptr_ops
2510 = {tuple_ops, /* Types */
2511 OP_TYPE_v, /* Suffix */
2512 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2513 scalar_const_ptr_args /* Args */};
2515 /* A static operand information for void func (scalar_type *, vector_type)
2516 * function registration. */
2517 static CONSTEXPR const rvv_op_info tuple_v_scalar_ptr_ops
2518 = {tuple_ops, /* Types */
2519 OP_TYPE_v, /* Suffix */
2520 rvv_arg_type_info (RVV_BASE_void), /* Return type */
2521 scalar_ptr_args /* Args */};
2523 /* A static operand information for vector_type func (const scalar_type *,
2524 * ptrdiff_t) function registration. */
2525 static CONSTEXPR const rvv_op_info tuple_v_scalar_const_ptr_ptrdiff_ops
2526 = {tuple_ops, /* Types */
2527 OP_TYPE_v, /* Suffix */
2528 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2529 scalar_const_ptr_ptrdiff_args /* Args */};
2531 /* A static operand information for void func (scalar_type *, ptrdiff_t,
2532 * vector_type) function registration. */
2533 static CONSTEXPR const rvv_op_info tuple_v_scalar_ptr_ptrdiff_ops
2534 = {tuple_ops, /* Types */
2535 OP_TYPE_v, /* Suffix */
2536 rvv_arg_type_info (RVV_BASE_void), /* Return type */
2537 scalar_ptr_ptrdiff_args /* Args */};
2539 /* A static operand information for vector_type func (const scalar_type *,
2540 * eew8_index_type) function registration. */
2541 static CONSTEXPR const rvv_op_info tuple_v_scalar_const_ptr_eew8_index_ops
2542 = {tuple_ops, /* Types */
2543 OP_TYPE_v, /* Suffix */
2544 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2545 scalar_const_ptr_eew8_index_args /* Args */};
2547 /* A static operand information for vector_type func (const scalar_type *,
2548 * eew16_index_type) function registration. */
2549 static CONSTEXPR const rvv_op_info tuple_v_scalar_const_ptr_eew16_index_ops
2550 = {tuple_ops, /* Types */
2551 OP_TYPE_v, /* Suffix */
2552 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2553 scalar_const_ptr_eew16_index_args /* Args */};
2555 /* A static operand information for vector_type func (const scalar_type *,
2556 * eew32_index_type) function registration. */
2557 static CONSTEXPR const rvv_op_info tuple_v_scalar_const_ptr_eew32_index_ops
2558 = {tuple_ops, /* Types */
2559 OP_TYPE_v, /* Suffix */
2560 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2561 scalar_const_ptr_eew32_index_args /* Args */};
2563 /* A static operand information for vector_type func (const scalar_type *,
2564 * eew64_index_type) function registration. */
2565 static CONSTEXPR const rvv_op_info tuple_v_scalar_const_ptr_eew64_index_ops
2566 = {tuple_ops, /* Types */
2567 OP_TYPE_v, /* Suffix */
2568 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2569 scalar_const_ptr_eew64_index_args /* Args */};
2571 /* A static operand information for void func (scalar_type *, eew8_index_type,
2572 * vector_type) function registration. */
2573 static CONSTEXPR const rvv_op_info tuple_v_scalar_ptr_eew8_index_ops
2574 = {tuple_ops, /* Types */
2575 OP_TYPE_v, /* Suffix */
2576 rvv_arg_type_info (RVV_BASE_void), /* Return type */
2577 scalar_ptr_eew8_index_args /* Args */};
2579 /* A static operand information for void func (scalar_type *, eew16_index_type,
2580 * vector_type) function registration. */
2581 static CONSTEXPR const rvv_op_info tuple_v_scalar_ptr_eew16_index_ops
2582 = {tuple_ops, /* Types */
2583 OP_TYPE_v, /* Suffix */
2584 rvv_arg_type_info (RVV_BASE_void), /* Return type */
2585 scalar_ptr_eew16_index_args /* Args */};
2587 /* A static operand information for void func (scalar_type *, eew32_index_type,
2588 * vector_type) function registration. */
2589 static CONSTEXPR const rvv_op_info tuple_v_scalar_ptr_eew32_index_ops
2590 = {tuple_ops, /* Types */
2591 OP_TYPE_v, /* Suffix */
2592 rvv_arg_type_info (RVV_BASE_void), /* Return type */
2593 scalar_ptr_eew32_index_args /* Args */};
2595 /* A static operand information for void func (scalar_type *, eew64_index_type,
2596 * vector_type) function registration. */
2597 static CONSTEXPR const rvv_op_info tuple_v_scalar_ptr_eew64_index_ops
2598 = {tuple_ops, /* Types */
2599 OP_TYPE_v, /* Suffix */
2600 rvv_arg_type_info (RVV_BASE_void), /* Return type */
2601 scalar_ptr_eew64_index_args /* Args */};
2603 /* A static operand information for vector_type func (const scalar_type *)
2604 * function registration. */
2605 static CONSTEXPR const rvv_op_info tuple_v_scalar_const_ptr_size_ptr_ops
2606 = {tuple_ops, /* Types */
2607 OP_TYPE_v, /* Suffix */
2608 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2609 scalar_const_ptr_size_ptr_args /* Args */};
2611 /* A static operand information for vector_type func (vector_type)
2612 * function registration. */
2613 static CONSTEXPR const rvv_op_info all_v_vcreate_tuple_ops
2614 = {tuple_ops, /* Types */
2615 OP_TYPE_v, /* Suffix */
2616 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2617 tuple_vcreate_args /* Args */};
2619 /* A static operand information for vector_type func () function registration.
2621 static CONSTEXPR const rvv_op_info all_none_void_tuple_ops
2622 = {tuple_ops, /* Types */
2623 OP_TYPE_none, /* Suffix */
2624 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2625 void_args /* Args */};
2627 /* A static operand information for vector_type func (vector_type)
2628 * function registration. */
2629 static CONSTEXPR const rvv_op_info all_v_vcreate_lmul1_x2_ops
2630 = {lmul1_ops, /* Types */
2631 OP_TYPE_v, /* Suffix */
2632 rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), /* Return type */
2633 ext_vcreate_args /* Args */};
2635 /* A static operand information for vector_type func (vector_type)
2636 * function registration. */
2637 static CONSTEXPR const rvv_op_info all_v_vcreate_lmul1_x4_ops
2638 = {lmul1_ops, /* Types */
2639 OP_TYPE_v, /* Suffix */
2640 rvv_arg_type_info (RVV_BASE_vlmul_ext_x4), /* Return type */
2641 ext_vcreate_args /* Args */};
2643 /* A static operand information for vector_type func (vector_type)
2644 * function registration. */
2645 static CONSTEXPR const rvv_op_info all_v_vcreate_lmul1_x8_ops
2646 = {lmul1_ops, /* Types */
2647 OP_TYPE_v, /* Suffix */
2648 rvv_arg_type_info (RVV_BASE_vlmul_ext_x8), /* Return type */
2649 ext_vcreate_args /* Args */};
2651 /* A static operand information for vector_type func (vector_type)
2652 * function registration. */
2653 static CONSTEXPR const rvv_op_info all_v_vcreate_lmul2_x2_ops
2654 = {lmul2_ops, /* Types */
2655 OP_TYPE_v, /* Suffix */
2656 rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), /* Return type */
2657 ext_vcreate_args /* Args */};
2659 /* A static operand information for vector_type func (vector_type)
2660 * function registration. */
2661 static CONSTEXPR const rvv_op_info all_v_vcreate_lmul2_x4_ops
2662 = {lmul2_ops, /* Types */
2663 OP_TYPE_v, /* Suffix */
2664 rvv_arg_type_info (RVV_BASE_vlmul_ext_x4), /* Return type */
2665 ext_vcreate_args /* Args */};
2667 /* A static operand information for vector_type func (vector_type)
2668 * function registration. */
2669 static CONSTEXPR const rvv_op_info all_v_vcreate_lmul4_x2_ops
2670 = {lmul4_ops, /* Types */
2671 OP_TYPE_v, /* Suffix */
2672 rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), /* Return type */
2673 ext_vcreate_args /* Args */};
2675 /* A static operand information for vector_type func (const scalar_type *,
2676 * size_t) function registration. */
2677 static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_size_ops
2678 = {all_ops, /* Types */
2679 OP_TYPE_v, /* Suffix */
2680 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2681 scalar_const_ptr_size_args /* Args */};
2683 /* A static operand information for void func (scalar_type *, size_t,
2684 * vector_type) function registration. */
2685 static CONSTEXPR const rvv_op_info all_v_scalar_ptr_size_ops
2686 = {all_ops, /* Types */
2687 OP_TYPE_v, /* Suffix */
2688 rvv_arg_type_info (RVV_BASE_void), /* Return type */
2689 scalar_ptr_size_args /* Args */};
2691 /* A static operand information for vector_type func (const scalar_type *,
2692 * index_type) function registration. */
2693 static CONSTEXPR const rvv_op_info all_v_scalar_const_ptr_index_ops
2694 = {all_ops, /* Types */
2695 OP_TYPE_v, /* Suffix */
2696 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2697 scalar_const_ptr_index_args /* Args */};
2699 /* A static operand information for void func (scalar_type *, index_type,
2700 * vector_type) function registration. */
2701 static CONSTEXPR const rvv_op_info all_v_scalar_ptr_index_ops
2702 = {all_ops, /* Types */
2703 OP_TYPE_v, /* Suffix */
2704 rvv_arg_type_info (RVV_BASE_void), /* Return type */
2705 scalar_ptr_index_args /* Args */};
2707 /* A static operand information for vector_type func (vector_type).
2708 Some ins just supports SEW=32, such as crypto vectol Zvkg extension.
2709 * function registration. */
2710 static CONSTEXPR const rvv_arg_type_info vs_lmul_x2_args[]
2711 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x2),
2712 rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};
2714 static CONSTEXPR const rvv_arg_type_info vs_lmul_x4_args[]
2715 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x4),
2716 rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};
2718 static CONSTEXPR const rvv_arg_type_info vs_lmul_x8_args[]
2719 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x8),
2720 rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};
2722 static CONSTEXPR const rvv_arg_type_info vs_lmul_x16_args[]
2723 = {rvv_arg_type_info (RVV_BASE_vlmul_ext_x16),
2724 rvv_arg_type_info (RVV_BASE_vector), rvv_arg_type_info_end};
2726 static CONSTEXPR const rvv_op_info u_vvv_crypto_sew32_ops
2727 = {crypto_sew32_ops, /* Types */
2728 OP_TYPE_vv, /* Suffix */
2729 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2730 vv_args /* Args */};
2732 static CONSTEXPR const rvv_op_info u_vvvv_crypto_sew32_ops
2733 = {crypto_sew32_ops, /* Types */
2734 OP_TYPE_vv, /* Suffix */
2735 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2736 vvv_args /* Args */};
2738 static CONSTEXPR const rvv_op_info u_vvv_size_crypto_sew32_ops
2739 = {crypto_sew32_ops, /* Types */
2740 OP_TYPE_vi, /* Suffix */
2741 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2742 vv_size_args /* Args */};
2744 static CONSTEXPR const rvv_op_info u_vv_size_crypto_sew32_ops
2745 = {crypto_sew32_ops, /* Types */
2746 OP_TYPE_vi, /* Suffix */
2747 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2748 v_size_args /* Args */};
2750 static CONSTEXPR const rvv_op_info u_vvs_crypto_sew32_ops
2751 = {crypto_sew32_ops, /* Types */
2752 OP_TYPE_vs, /* Suffix */
2753 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2754 vv_args /* Args */};
2756 static CONSTEXPR const rvv_op_info u_vvs_crypto_sew32_lmul_x2_ops
2757 = {crypto_sew32_ops, /* Types */
2758 OP_TYPE_vs, /* Suffix */
2759 rvv_arg_type_info (RVV_BASE_vlmul_ext_x2), /* Return type */
2760 vs_lmul_x2_args /* Args */};
2762 static CONSTEXPR const rvv_op_info u_vvs_crypto_sew32_lmul_x4_ops
2763 = {crypto_sew32_ops, /* Types */
2764 OP_TYPE_vs, /* Suffix */
2765 rvv_arg_type_info (RVV_BASE_vlmul_ext_x4), /* Return type */
2766 vs_lmul_x4_args /* Args */};
2768 static CONSTEXPR const rvv_op_info u_vvs_crypto_sew32_lmul_x8_ops
2769 = {crypto_sew32_ops, /* Types */
2770 OP_TYPE_vs, /* Suffix */
2771 rvv_arg_type_info (RVV_BASE_vlmul_ext_x8), /* Return type */
2772 vs_lmul_x8_args /* Args */};
2774 static CONSTEXPR const rvv_op_info u_vvs_crypto_sew32_lmul_x16_ops
2775 = {crypto_sew32_ops, /* Types */
2776 OP_TYPE_vs, /* Suffix */
2777 rvv_arg_type_info (RVV_BASE_vlmul_ext_x16), /* Return type */
2778 vs_lmul_x16_args /* Args */};
2780 /* A static operand information for vector_type func (vector_type).
2781 Some ins just supports SEW=64, such as crypto vectol Zvbc extension
2782 vclmul.vv, vclmul.vx.
2783 * function registration. */
2784 static CONSTEXPR const rvv_op_info u_vvv_crypto_sew64_ops
2785 = {crypto_sew64_ops, /* Types */
2786 OP_TYPE_vv, /* Suffix */
2787 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2788 vv_args /* Args */};
2790 static CONSTEXPR const rvv_op_info u_vvx_crypto_sew64_ops
2791 = {crypto_sew64_ops, /* Types */
2792 OP_TYPE_vx, /* Suffix */
2793 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2794 vx_args /* Args */};
2796 static CONSTEXPR const rvv_op_info u_vvvv_crypto_sew64_ops
2797 = {crypto_sew64_ops, /* Types */
2798 OP_TYPE_vv, /* Suffix */
2799 rvv_arg_type_info (RVV_BASE_vector), /* Return type */
2800 vvv_args /* Args */};
2802 /* A list of all RVV base function types. */
2803 static CONSTEXPR const function_type_info function_types[] = {
2804 #define DEF_RVV_TYPE_INDEX( \
2805 VECTOR, MASK, SIGNED, UNSIGNED, EEW8_INDEX, EEW16_INDEX, EEW32_INDEX, \
2806 EEW64_INDEX, SHIFT, DOUBLE_TRUNC, QUAD_TRUNC, OCT_TRUNC, \
2807 DOUBLE_TRUNC_SCALAR, DOUBLE_TRUNC_SIGNED, DOUBLE_TRUNC_UNSIGNED, \
2808 DOUBLE_TRUNC_UNSIGNED_SCALAR, DOUBLE_TRUNC_FLOAT, FLOAT, LMUL1, WLMUL1, \
2809 EEW8_INTERPRET, EEW16_INTERPRET, EEW32_INTERPRET, EEW64_INTERPRET, \
2810 BOOL1_INTERPRET, BOOL2_INTERPRET, BOOL4_INTERPRET, BOOL8_INTERPRET, \
2811 BOOL16_INTERPRET, BOOL32_INTERPRET, BOOL64_INTERPRET, \
2812 SIGNED_EEW8_LMUL1_INTERPRET, SIGNED_EEW16_LMUL1_INTERPRET, \
2813 SIGNED_EEW32_LMUL1_INTERPRET, SIGNED_EEW64_LMUL1_INTERPRET, \
2814 UNSIGNED_EEW8_LMUL1_INTERPRET, UNSIGNED_EEW16_LMUL1_INTERPRET, \
2815 UNSIGNED_EEW32_LMUL1_INTERPRET, UNSIGNED_EEW64_LMUL1_INTERPRET, \
2816 X2_VLMUL_EXT, X4_VLMUL_EXT, X8_VLMUL_EXT, X16_VLMUL_EXT, X32_VLMUL_EXT, \
2817 X64_VLMUL_EXT, TUPLE_SUBPART) \
2819 VECTOR_TYPE_##VECTOR, \
2820 VECTOR_TYPE_INVALID, \
2821 VECTOR_TYPE_##MASK, \
2822 VECTOR_TYPE_##SIGNED, \
2823 VECTOR_TYPE_##UNSIGNED, \
2824 VECTOR_TYPE_INVALID, \
2825 VECTOR_TYPE_INVALID, \
2826 VECTOR_TYPE_INVALID, \
2827 VECTOR_TYPE_INVALID, \
2828 VECTOR_TYPE_INVALID, \
2829 VECTOR_TYPE_INVALID, \
2830 VECTOR_TYPE_INVALID, \
2831 VECTOR_TYPE_INVALID, \
2832 VECTOR_TYPE_INVALID, \
2833 VECTOR_TYPE_##EEW8_INDEX, \
2834 VECTOR_TYPE_##EEW16_INDEX, \
2835 VECTOR_TYPE_##EEW32_INDEX, \
2836 VECTOR_TYPE_##EEW64_INDEX, \
2837 VECTOR_TYPE_##SHIFT, \
2838 VECTOR_TYPE_##DOUBLE_TRUNC, \
2839 VECTOR_TYPE_##QUAD_TRUNC, \
2840 VECTOR_TYPE_##OCT_TRUNC, \
2841 VECTOR_TYPE_##DOUBLE_TRUNC_SCALAR, \
2842 VECTOR_TYPE_##DOUBLE_TRUNC_SIGNED, \
2843 VECTOR_TYPE_##DOUBLE_TRUNC_UNSIGNED, \
2844 VECTOR_TYPE_##DOUBLE_TRUNC_UNSIGNED_SCALAR, \
2845 VECTOR_TYPE_##DOUBLE_TRUNC_FLOAT, \
2846 VECTOR_TYPE_##FLOAT, \
2847 VECTOR_TYPE_##LMUL1, \
2848 VECTOR_TYPE_##WLMUL1, \
2849 VECTOR_TYPE_##EEW8_INTERPRET, \
2850 VECTOR_TYPE_##EEW16_INTERPRET, \
2851 VECTOR_TYPE_##EEW32_INTERPRET, \
2852 VECTOR_TYPE_##EEW64_INTERPRET, \
2853 VECTOR_TYPE_##BOOL1_INTERPRET, \
2854 VECTOR_TYPE_##BOOL2_INTERPRET, \
2855 VECTOR_TYPE_##BOOL4_INTERPRET, \
2856 VECTOR_TYPE_##BOOL8_INTERPRET, \
2857 VECTOR_TYPE_##BOOL16_INTERPRET, \
2858 VECTOR_TYPE_##BOOL32_INTERPRET, \
2859 VECTOR_TYPE_##BOOL64_INTERPRET, \
2860 VECTOR_TYPE_##SIGNED_EEW8_LMUL1_INTERPRET, \
2861 VECTOR_TYPE_##SIGNED_EEW16_LMUL1_INTERPRET, \
2862 VECTOR_TYPE_##SIGNED_EEW32_LMUL1_INTERPRET, \
2863 VECTOR_TYPE_##SIGNED_EEW64_LMUL1_INTERPRET, \
2864 VECTOR_TYPE_##UNSIGNED_EEW8_LMUL1_INTERPRET, \
2865 VECTOR_TYPE_##UNSIGNED_EEW16_LMUL1_INTERPRET, \
2866 VECTOR_TYPE_##UNSIGNED_EEW32_LMUL1_INTERPRET, \
2867 VECTOR_TYPE_##UNSIGNED_EEW64_LMUL1_INTERPRET, \
2868 VECTOR_TYPE_##X2_VLMUL_EXT, \
2869 VECTOR_TYPE_##X4_VLMUL_EXT, \
2870 VECTOR_TYPE_##X8_VLMUL_EXT, \
2871 VECTOR_TYPE_##X16_VLMUL_EXT, \
2872 VECTOR_TYPE_##X32_VLMUL_EXT, \
2873 VECTOR_TYPE_##X64_VLMUL_EXT, \
2874 VECTOR_TYPE_INVALID, \
2875 VECTOR_TYPE_##TUPLE_SUBPART, \
2877 #include "riscv-vector-builtins.def"
2878 }; // namespace riscv_vector
2880 /* A list of all RVV intrinsic functions. */
2881 static function_group_info function_groups[] = {
2882 #define DEF_RVV_FUNCTION(NAME, SHAPE, PREDS, OPS_INFO) \
2883 {#NAME, &bases::NAME, &shapes::SHAPE, PREDS, OPS_INFO, REQUIRED_EXTENSIONS},
2884 #include "riscv-vector-builtins-functions.def"
2885 #undef DEF_RVV_FUNCTION
2886 #define DEF_RVV_FUNCTION(NAME, SHAPE, PREDS, OPS_INFO) \
2887 {#NAME, &bases::NAME, &shapes::SHAPE, PREDS, OPS_INFO, REQUIRED_EXTENSIONS},
2888 #include "thead-vector-builtins-functions.def"
2891 /* The RVV types, with their built-in
2892 "__rvv..._t" name. Allow an index of NUM_VECTOR_TYPES, which always
2893 yields a null tree. */
2894 static GTY (()) tree abi_vector_types[NUM_VECTOR_TYPES + 1];
2896 /* Same, but with the riscv_vector.h "v..._t" name. */
2897 extern GTY (()) rvv_builtin_types_t builtin_types[NUM_VECTOR_TYPES + 1];
2898 rvv_builtin_types_t builtin_types[NUM_VECTOR_TYPES + 1];
2900 /* The list of all registered function decls, indexed by code. */
2901 static GTY (()) vec<registered_function *, va_gc> *registered_functions;
2903 /* All registered function decls, hashed on the function_instance
2904 that they implement. This is used for looking up implementations of
2905 overloaded functions. */
2906 static hash_table<registered_function_hasher> *function_table;
2908 /* All registered function decls, hashed on overload_name and argument list
2909 of the registered_function. This is used for looking up implementations
2910 of non-overloaded functions. */
2911 static hash_table<non_overloaded_registered_function_hasher>
2912 *non_overloaded_function_table;
2914 /* RAII class for enabling enough RVV features to define the built-in
2915 types and implement the riscv_vector.h pragma.
2917 Note: According to 'TYPE_MODE' macro implementation, we need set
2918 have_regs_of_mode[mode] to be true if we want to get the exact mode
2919 from 'TYPE_MODE'. However, have_regs_of_mode has not been set yet in
2920 targetm.init_builtins (). We need rvv_switcher to set have_regs_of_mode
2921 before targetm.init_builtins () and recover back have_regs_of_mode
2922 after targetm.init_builtins (). */
2923 class rvv_switcher
2925 public:
2926 rvv_switcher ();
2927 ~rvv_switcher ();
2929 private:
2930 bool m_old_have_regs_of_mode[MAX_MACHINE_MODE];
2933 rvv_switcher::rvv_switcher ()
2935 /* Set have_regs_of_mode before targetm.init_builtins (). */
2936 memcpy (m_old_have_regs_of_mode, have_regs_of_mode,
2937 sizeof (have_regs_of_mode));
2938 for (int i = 0; i < NUM_MACHINE_MODES; ++i)
2939 if (riscv_v_ext_vector_mode_p ((machine_mode) i))
2940 have_regs_of_mode[i] = true;
2943 rvv_switcher::~rvv_switcher ()
2945 /* Recover back have_regs_of_mode. */
2946 memcpy (have_regs_of_mode, m_old_have_regs_of_mode,
2947 sizeof (have_regs_of_mode));
2950 /* Add attribute NAME to ATTRS. */
2951 static tree
2952 add_attribute (const char *name, tree attrs)
2954 return tree_cons (get_identifier (name), NULL_TREE, attrs);
2957 /* Add type attributes to builtin type tree, currently only the mangled name. */
2958 static void
2959 add_vector_type_attribute (tree type, const char *mangled_name)
2961 tree mangled_name_tree = get_identifier (mangled_name);
2962 tree value = tree_cons (NULL_TREE, mangled_name_tree, NULL_TREE);
2963 TYPE_ATTRIBUTES (type)
2964 = tree_cons (get_identifier ("RVV type"), value, TYPE_ATTRIBUTES (type));
2967 /* Force TYPE to be a sizeless type. */
2968 static void
2969 make_type_sizeless (tree type)
2971 TYPE_ATTRIBUTES (type) = tree_cons (get_identifier ("RVV sizeless type"),
2972 NULL_TREE, TYPE_ATTRIBUTES (type));
2975 /* Return true if TYPE is a sizeless type. */
2976 static bool
2977 sizeless_type_p (const_tree type)
2979 if (type == error_mark_node)
2980 return NULL_TREE;
2981 return lookup_attribute ("RVV sizeless type", TYPE_ATTRIBUTES (type));
2984 /* If TYPE is an ABI-defined RVV type, return its attribute descriptor,
2985 otherwise return null. */
2986 tree
2987 lookup_vector_type_attribute (const_tree type)
2989 if (type == error_mark_node)
2990 return NULL_TREE;
2991 return lookup_attribute ("RVV type", TYPE_ATTRIBUTES (type));
2994 /* Return a representation of "const T *". */
2995 static tree
2996 build_const_pointer (tree t)
2998 return build_pointer_type (build_qualified_type (t, TYPE_QUAL_CONST));
3001 /* Helper function for register a single built-in RVV ABI type. */
3002 static void
3003 register_builtin_type (vector_type_index type, tree eltype, machine_mode mode)
3005 builtin_types[type].scalar = eltype;
3006 builtin_types[type].scalar_ptr = build_pointer_type (eltype);
3007 builtin_types[type].scalar_const_ptr = build_const_pointer (eltype);
3008 /* TODO: We currently just skip the register of the illegal RVV type.
3009 Ideally, we should report error message more friendly instead of
3010 reporting "unknown" type. Support more friendly error message in
3011 the future. */
3012 if (!riscv_v_ext_vector_mode_p (mode))
3013 return;
3015 tree vectype = build_vector_type_for_mode (eltype, mode);
3016 gcc_assert (VECTOR_MODE_P (TYPE_MODE (vectype)) && TYPE_MODE (vectype) == mode
3017 && TYPE_MODE_RAW (vectype) == mode && TYPE_ALIGN (vectype) <= 128
3018 && known_eq (tree_to_poly_uint64 (TYPE_SIZE (vectype)),
3019 GET_MODE_BITSIZE (mode)));
3020 vectype = build_distinct_type_copy (vectype);
3021 gcc_assert (vectype == TYPE_MAIN_VARIANT (vectype));
3022 SET_TYPE_STRUCTURAL_EQUALITY (vectype);
3023 TYPE_ARTIFICIAL (vectype) = 1;
3024 TYPE_INDIVISIBLE_P (vectype) = 1;
3025 add_vector_type_attribute (vectype, vector_types[type].mangled_name);
3026 make_type_sizeless (vectype);
3027 abi_vector_types[type] = vectype;
3028 lang_hooks.types.register_builtin_type (vectype, vector_types[type].abi_name);
3031 /* Register the tuple type that contains NUM_VECTORS vectors of type TYPE. */
3032 static void
3033 register_tuple_type (vector_type_index type, vector_type_index subpart_type,
3034 tree eltype, unsigned int nf)
3036 /* TODO: We currently just skip the register of the illegal RVV type.
3037 Ideally, we should report error message more friendly instead of
3038 reporting "unknown" type. Support more friendly error message in
3039 the future. */
3040 if (!abi_vector_types[subpart_type])
3041 return;
3042 tree tuple_type = lang_hooks.types.make_type (RECORD_TYPE);
3044 /* The contents of the type are opaque, so we can define them in any
3045 way that maps to the correct ABI type.
3047 Here we choose to use the same layout as for riscv_vector.h, with
3048 "__val":
3050 struct vfooxN_t { vfoo_t __val[N]; };
3052 (It wouldn't be possible to write that directly in C or C++ for
3053 sizeless types, but that's not a problem for this function.)
3055 Using arrays simplifies the handling of vget and vset for variable
3056 arguments. */
3057 tree array_type = build_array_type_nelts (abi_vector_types[subpart_type], nf);
3058 gcc_assert (array_type);
3059 gcc_assert (VECTOR_MODE_P (TYPE_MODE (array_type))
3060 && TYPE_MODE_RAW (array_type) == TYPE_MODE (array_type));
3062 tree field = build_decl (input_location, FIELD_DECL, get_identifier ("__val"),
3063 array_type);
3064 DECL_FIELD_CONTEXT (field) = tuple_type;
3065 TYPE_FIELDS (tuple_type) = field;
3066 add_vector_type_attribute (tuple_type, vector_types[type].mangled_name);
3067 make_type_sizeless (tuple_type);
3068 layout_type (tuple_type);
3069 gcc_assert (VECTOR_MODE_P (TYPE_MODE (tuple_type))
3070 && TYPE_MODE_RAW (tuple_type) == TYPE_MODE (tuple_type));
3072 tree decl
3073 = build_decl (input_location, TYPE_DECL,
3074 get_identifier (vector_types[type].abi_name), tuple_type);
3075 TYPE_NAME (tuple_type) = decl;
3076 TYPE_STUB_DECL (tuple_type) = decl;
3077 lang_hooks.decls.pushdecl (decl);
3078 /* ??? Undo the effect of set_underlying_type for C. The C frontend
3079 doesn't recognize DECL as a built-in because (as intended) the decl has
3080 a real location instead of BUILTINS_LOCATION. The frontend therefore
3081 treats the decl like a normal C "typedef struct foo foo;", expecting
3082 the type for tag "struct foo" to have a dummy unnamed TYPE_DECL instead
3083 of the named one we attached above. It then sets DECL_ORIGINAL_TYPE
3084 on the supposedly unnamed decl, creating a circularity that upsets
3085 dwarf2out.
3087 We don't want to follow the normal C model and create "struct foo"
3088 tags for tuple types since (a) the types are supposed to be opaque
3089 and (b) they couldn't be defined as a real struct anyway. Treating
3090 the TYPE_DECLs as "typedef struct foo foo;" without creating
3091 "struct foo" would lead to confusing error messages. */
3092 DECL_ORIGINAL_TYPE (decl) = NULL_TREE;
3094 builtin_types[type].scalar = eltype;
3095 builtin_types[type].scalar_ptr = build_pointer_type (eltype);
3096 builtin_types[type].scalar_const_ptr = build_const_pointer (eltype);
3097 abi_vector_types[type] = tuple_type;
3100 /* Register the built-in RVV ABI types, such as __rvv_int32m1_t. */
3101 static void
3102 register_builtin_types ()
3104 /* Get type node from get_typenode_from_name to prevent we have different type
3105 node define in different target libraries, e.g. int32_t defined as
3106 `long` in RV32/newlib-stdint, but `int` for RV32/glibc-stdint.h.
3107 NOTE: uint[16|32|64]_type_node already defined in tree.h. */
3108 tree int8_type_node = get_typenode_from_name (INT8_TYPE);
3109 tree uint8_type_node = get_typenode_from_name (UINT8_TYPE);
3110 tree int16_type_node = get_typenode_from_name (INT16_TYPE);
3111 tree int32_type_node = get_typenode_from_name (INT32_TYPE);
3112 tree int64_type_node = get_typenode_from_name (INT64_TYPE);
3114 machine_mode mode;
3115 #define DEF_RVV_TYPE(NAME, NCHARS, ABI_NAME, SCALAR_TYPE, VECTOR_MODE, \
3116 ARGS...) \
3117 mode = VECTOR_MODE##mode; \
3118 register_builtin_type (VECTOR_TYPE_##NAME, SCALAR_TYPE##_type_node, mode);
3119 #define DEF_RVV_TUPLE_TYPE(NAME, NCHARS, ABI_NAME, SUBPART_TYPE, SCALAR_TYPE, \
3120 NF, VECTOR_SUFFIX) \
3121 register_tuple_type (VECTOR_TYPE_##NAME, VECTOR_TYPE_##SUBPART_TYPE, \
3122 SCALAR_TYPE##_type_node, NF);
3123 #include "riscv-vector-builtins.def"
3126 /* Register vector type TYPE under its risv_vector.h name. */
3127 static void
3128 register_vector_type (vector_type_index type)
3130 tree vectype = abi_vector_types[type];
3132 /* When vectype is NULL, the corresponding builtin type
3133 is disabled according to '-march'. */
3134 /* TODO: We currently just skip the register of the illegal RVV type.
3135 Ideally, we should report error message more friendly instead of
3136 reporting "unknown" type. Support more friendly error message in
3137 the future. */
3138 if (!vectype)
3139 return;
3140 tree id = get_identifier (vector_types[type].name);
3141 tree decl = build_decl (input_location, TYPE_DECL, id, vectype);
3142 decl = lang_hooks.decls.pushdecl (decl);
3144 /* Record the new RVV type if pushdecl succeeded without error. Use
3145 the ABI type otherwise, so that the type we record at least has the
3146 right form, even if it doesn't have the right name. This should give
3147 better error recovery behavior than installing error_mark_node or
3148 installing an incorrect type. */
3149 if (decl && TREE_CODE (decl) == TYPE_DECL
3150 && TREE_TYPE (decl) != error_mark_node
3151 && TYPE_MAIN_VARIANT (TREE_TYPE (decl)) == vectype)
3152 vectype = TREE_TYPE (decl);
3154 builtin_types[type].vector = vectype;
3155 builtin_types[type].vector_ptr = build_pointer_type (vectype);
3158 /* Return true if the type has required_extensions. */
3159 static bool
3160 required_extensions_p (enum rvv_base_type type)
3162 switch (type)
3164 case RVV_BASE_eew8_index:
3165 case RVV_BASE_eew16_index:
3166 case RVV_BASE_eew32_index:
3167 case RVV_BASE_eew64_index:
3168 case RVV_BASE_float_vector:
3169 case RVV_BASE_double_trunc_float_vector:
3170 case RVV_BASE_double_trunc_vector:
3171 case RVV_BASE_widen_lmul1_vector:
3172 case RVV_BASE_eew8_interpret:
3173 case RVV_BASE_eew16_interpret:
3174 case RVV_BASE_eew32_interpret:
3175 case RVV_BASE_eew64_interpret:
3176 case RVV_BASE_bool1_interpret:
3177 case RVV_BASE_bool2_interpret:
3178 case RVV_BASE_bool4_interpret:
3179 case RVV_BASE_bool8_interpret:
3180 case RVV_BASE_bool16_interpret:
3181 case RVV_BASE_bool32_interpret:
3182 case RVV_BASE_bool64_interpret:
3183 case RVV_BASE_signed_eew8_lmul1_interpret:
3184 case RVV_BASE_signed_eew16_lmul1_interpret:
3185 case RVV_BASE_signed_eew32_lmul1_interpret:
3186 case RVV_BASE_signed_eew64_lmul1_interpret:
3187 case RVV_BASE_unsigned_eew8_lmul1_interpret:
3188 case RVV_BASE_unsigned_eew16_lmul1_interpret:
3189 case RVV_BASE_unsigned_eew32_lmul1_interpret:
3190 case RVV_BASE_unsigned_eew64_lmul1_interpret:
3191 case RVV_BASE_vlmul_ext_x2:
3192 case RVV_BASE_vlmul_ext_x4:
3193 case RVV_BASE_vlmul_ext_x8:
3194 case RVV_BASE_vlmul_ext_x16:
3195 case RVV_BASE_vlmul_ext_x32:
3196 case RVV_BASE_vlmul_ext_x64:
3197 return true;
3198 default:
3199 return false;
3202 gcc_unreachable ();
3205 static uint64_t
3206 get_required_extensions (vector_type_index type_idx)
3208 for (unsigned int i = 0; all_ops[i].index != NUM_VECTOR_TYPES; i++)
3209 if (type_idx == all_ops[i].index)
3210 return all_ops[i].required_extensions;
3211 for (unsigned int i = 0; b_ops[i].index != NUM_VECTOR_TYPES; i++)
3212 if (type_idx == b_ops[i].index)
3213 return b_ops[i].required_extensions;
3214 gcc_unreachable ();
3217 /* Check whether all the RVV_REQUIRE_* values in REQUIRED_EXTENSIONS are
3218 enabled. */
3219 static bool
3220 check_required_extensions (const function_instance &instance)
3222 rvv_type_info type_info = instance.type;
3223 uint64_t required_extensions = type_info.required_extensions;
3224 const rvv_op_info *op_info = instance.op_info;
3226 if (required_extensions_p (op_info->ret.base_type))
3228 enum vector_type_index ret_type_idx
3229 = op_info->ret.get_function_type_index (type_info.index);
3230 if (ret_type_idx == NUM_VECTOR_TYPES)
3231 return false;
3232 required_extensions |= get_required_extensions (ret_type_idx);
3235 for (unsigned i = 0; op_info->args[i].base_type != NUM_BASE_TYPES; ++i)
3237 if (!required_extensions_p (op_info->args[i].base_type))
3238 continue;
3240 enum vector_type_index vector_type
3241 = op_info->args[i].get_function_type_index (type_info.index);
3242 if (vector_type == NUM_VECTOR_TYPES)
3243 return false;
3244 required_extensions |= get_required_extensions (vector_type);
3246 /* According to RVV ISA, EEW=64 index of indexed loads/stores require
3247 XLEN = 64. */
3248 if (op_info->args[i].base_type == RVV_BASE_eew64_index)
3249 required_extensions |= RVV_REQUIRE_RV64BIT;
3252 uint64_t riscv_isa_flags = 0;
3254 if (TARGET_VECTOR_ELEN_FP_16)
3255 riscv_isa_flags |= RVV_REQUIRE_ELEN_FP_16;
3256 if (TARGET_VECTOR_ELEN_FP_32)
3257 riscv_isa_flags |= RVV_REQUIRE_ELEN_FP_32;
3258 if (TARGET_VECTOR_ELEN_FP_64)
3259 riscv_isa_flags |= RVV_REQUIRE_ELEN_FP_64;
3260 if (TARGET_VECTOR_ELEN_64)
3261 riscv_isa_flags |= RVV_REQUIRE_ELEN_64;
3262 if (TARGET_64BIT)
3263 riscv_isa_flags |= RVV_REQUIRE_RV64BIT;
3264 if (TARGET_FULL_V)
3265 riscv_isa_flags |= RVV_REQUIRE_FULL_V;
3266 if (TARGET_MIN_VLEN > 32)
3267 riscv_isa_flags |= RVV_REQUIRE_MIN_VLEN_64;
3269 uint64_t missing_extensions = required_extensions & ~riscv_isa_flags;
3270 if (missing_extensions != 0)
3271 return false;
3272 return true;
3275 /* Return true if predication is using a real mask operand. */
3276 static bool
3277 use_real_mask_p (enum predication_type_index pred)
3279 return pred == PRED_TYPE_m || pred == PRED_TYPE_tum || pred == PRED_TYPE_tumu
3280 || pred == PRED_TYPE_mu;
3283 /* Return true if predication is using a real merge operand. */
3284 static bool
3285 use_real_merge_p (enum predication_type_index pred)
3287 return pred == PRED_TYPE_tu || pred == PRED_TYPE_tum || pred == PRED_TYPE_tumu
3288 || pred == PRED_TYPE_mu;
3291 /* Get TAIL policy for predication. If predication indicates TU, return the TU.
3292 Otherwise, return the prefer default configuration. */
3293 static rtx
3294 get_tail_policy_for_pred (enum predication_type_index pred)
3296 if (pred == PRED_TYPE_tu || pred == PRED_TYPE_tum || pred == PRED_TYPE_tumu)
3297 return gen_int_mode (TAIL_UNDISTURBED, Pmode);
3298 return gen_int_mode (get_prefer_tail_policy (), Pmode);
3301 /* Get MASK policy for predication. If predication indicates MU, return the MU.
3302 Otherwise, return the prefer default configuration. */
3303 static rtx
3304 get_mask_policy_for_pred (enum predication_type_index pred)
3306 if (pred == PRED_TYPE_tumu || pred == PRED_TYPE_mu)
3307 return gen_int_mode (MASK_UNDISTURBED, Pmode);
3308 return gen_int_mode (get_prefer_mask_policy (), Pmode);
3311 tree
3312 rvv_arg_type_info::get_scalar_ptr_type (vector_type_index type_idx) const
3314 /* According to the latest rvv-intrinsic-doc, it defines vsm.v intrinsic:
3315 __riscv_vsm (uint8_t *base, vbool1_t value, size_t vl). */
3316 if (type_idx >= VECTOR_TYPE_vbool64_t && type_idx <= VECTOR_TYPE_vbool1_t)
3317 return builtin_types[VECTOR_TYPE_vuint8mf8_t].scalar_ptr;
3318 else
3319 return builtin_types[type_idx].scalar_ptr;
3322 tree
3323 rvv_arg_type_info::get_scalar_const_ptr_type (vector_type_index type_idx) const
3325 /* According to the latest rvv-intrinsic-doc, it defines vlm.v intrinsic:
3326 __riscv_vlm_v_b1 (const uint8_t *base, size_t vl). */
3327 if (type_idx >= VECTOR_TYPE_vbool64_t && type_idx <= VECTOR_TYPE_vbool1_t)
3328 return builtin_types[VECTOR_TYPE_vuint8mf8_t].scalar_const_ptr;
3329 else
3330 return builtin_types[type_idx].scalar_const_ptr;
3333 vector_type_index
3334 rvv_arg_type_info::get_function_type_index (vector_type_index type_idx) const
3336 tree type
3337 = builtin_types[function_types[type_idx].type_indexes[base_type]].vector;
3338 return type ? function_types[type_idx].type_indexes[base_type]
3339 : NUM_VECTOR_TYPES;
3342 tree
3343 rvv_arg_type_info::get_tree_type (vector_type_index type_idx) const
3345 /* If the builtin type is not registered means '-march' doesn't
3346 satisfy the require extension of the type. For example,
3347 vfloat32m1_t require floating-point extension. In this case,
3348 just return NULL_TREE. */
3349 if (type_idx != VECTOR_TYPE_INVALID && !builtin_types[type_idx].vector)
3350 return NULL_TREE;
3352 switch (base_type)
3354 #define DEF_RVV_BASE_TYPE(NAME, TYPE) \
3355 case RVV_BASE_##NAME: \
3356 return TYPE;
3357 #include "riscv-vector-builtins.def"
3358 default:
3359 gcc_unreachable ();
3361 gcc_unreachable ();
3364 tree
3365 rvv_arg_type_info::get_tuple_subpart_type (vector_type_index type_idx) const
3367 switch (type_idx)
3369 #define DEF_RVV_TUPLE_TYPE(NAME, NCHARS, ABI_NAME, SUBPART_TYPE, ARGS...) \
3370 case VECTOR_TYPE_##NAME: \
3371 return builtin_types[VECTOR_TYPE_##SUBPART_TYPE].vector;
3372 #include "riscv-vector-builtins.def"
3373 default:
3374 gcc_unreachable ();
3376 gcc_unreachable ();
3379 function_instance::function_instance (const char *base_name_in,
3380 const function_base *base_in,
3381 const function_shape *shape_in,
3382 rvv_type_info type_in,
3383 predication_type_index pred_in,
3384 const rvv_op_info *op_info_in)
3385 : base_name (base_name_in), base (base_in), shape (shape_in), type (type_in),
3386 pred (pred_in), op_info (op_info_in)
3390 bool
3391 function_instance::operator== (const function_instance &other) const
3393 for (unsigned int i = 0; op_info->args[i].base_type != NUM_BASE_TYPES; ++i)
3394 if (op_info->args[i].base_type != other.op_info->args[i].base_type)
3395 return false;
3396 return (base == other.base && shape == other.shape
3397 && type.index == other.type.index && op_info->op == other.op_info->op
3398 && pred == other.pred
3399 && op_info->ret.base_type == other.op_info->ret.base_type);
3402 bool
3403 function_instance::any_type_float_p () const
3405 if (FLOAT_MODE_P (TYPE_MODE (get_return_type ())))
3406 return true;
3408 for (int i = 0; op_info->args[i].base_type != NUM_BASE_TYPES; ++i)
3409 if (FLOAT_MODE_P (TYPE_MODE (get_arg_type (i))))
3410 return true;
3412 return false;
3415 tree
3416 function_instance::get_return_type () const
3418 return op_info->ret.get_tree_type (type.index);
3421 tree
3422 function_instance::get_arg_type (unsigned opno) const
3424 return op_info->args[opno].get_tree_type (type.index);
3427 /* Return a hash code for a function_instance. */
3428 hashval_t
3429 function_instance::hash () const
3431 inchash::hash h;
3432 /* BASE uniquely determines BASE_NAME, so we don't need to hash both. */
3433 h.add_ptr (base);
3434 h.add_ptr (shape);
3435 h.add_int (type.index);
3436 h.add_int (op_info->op);
3437 h.add_int (pred);
3438 h.add_int (op_info->ret.base_type);
3439 for (unsigned int i = 0; op_info->args[i].base_type != NUM_BASE_TYPES; ++i)
3440 h.add_int (op_info->args[i].base_type);
3441 return h.end ();
3444 /* Return a set of CP_* flags that describe what the function could do,
3445 taking the command-line flags into account. */
3446 unsigned int
3447 function_instance::call_properties () const
3449 unsigned int flags = base->call_properties (*this);
3451 /* -fno-trapping-math means that we can assume any FP exceptions
3452 are not user-visible. */
3453 if (!flag_trapping_math)
3454 flags &= ~CP_RAISE_FP_EXCEPTIONS;
3456 return flags;
3459 /* Return true if calls to the function could read some form of
3460 global state. */
3461 bool
3462 function_instance::reads_global_state_p () const
3464 unsigned int flags = call_properties ();
3466 /* Preserve any dependence on rounding mode, flush to zero mode, etc.
3467 There is currently no way of turning this off; in particular,
3468 -fno-rounding-math (which is the default) means that we should make
3469 the usual assumptions about rounding mode, which for intrinsics means
3470 acting as the instructions do. */
3471 if (flags & CP_READ_FPCR)
3472 return true;
3474 /* Handle direct reads of global state. */
3475 return flags & (CP_READ_MEMORY | CP_READ_CSR);
3478 /* Return true if calls to the function could modify some form of
3479 global state. */
3480 bool
3481 function_instance::modifies_global_state_p () const
3483 unsigned int flags = call_properties ();
3485 /* Preserve any exception state written back to the FPCR,
3486 unless -fno-trapping-math says this is unnecessary. */
3487 if (flags & CP_RAISE_FP_EXCEPTIONS)
3488 return true;
3490 /* Handle direct modifications of global state. */
3491 return flags & (CP_WRITE_MEMORY | CP_WRITE_CSR);
3494 /* Return true if calls to the function could raise a signal. */
3495 bool
3496 function_instance::could_trap_p () const
3498 unsigned int flags = call_properties ();
3500 /* Handle functions that could raise SIGFPE. */
3501 if (flags & CP_RAISE_FP_EXCEPTIONS)
3502 return true;
3504 /* Handle functions that could raise SIGBUS or SIGSEGV. */
3505 if (flags & (CP_READ_MEMORY | CP_WRITE_MEMORY))
3506 return true;
3508 return false;
3511 function_builder::function_builder ()
3513 m_direct_overloads = lang_GNU_CXX ();
3514 gcc_obstack_init (&m_string_obstack);
3517 function_builder::~function_builder ()
3519 obstack_free (&m_string_obstack, NULL);
3522 /* Allocate arguments of the function. */
3523 void
3524 function_builder::allocate_argument_types (const function_instance &instance,
3525 vec<tree> &argument_types) const
3527 for (unsigned int i = 0;
3528 instance.op_info->args[i].base_type != NUM_BASE_TYPES; ++i)
3529 argument_types.quick_push (
3530 instance.op_info->args[i].get_tree_type (instance.type.index));
3533 /* Apply predication into argument_types. */
3534 void
3535 function_builder::apply_predication (const function_instance &instance,
3536 tree return_type,
3537 vec<tree> &argument_types) const
3539 /* These predication types need to apply merge type. */
3540 if (instance.base->has_merge_operand_p ())
3541 if (instance.pred == PRED_TYPE_tu || instance.pred == PRED_TYPE_tum
3542 || instance.pred == PRED_TYPE_tumu || instance.pred == PRED_TYPE_mu)
3543 argument_types.quick_insert (0, return_type);
3545 /* These predication types need to apply mask type. */
3546 vector_type_index mask_type_index
3547 = function_types[instance.type.index].type_indexes[RVV_BASE_mask];
3548 tree mask_type = builtin_types[mask_type_index].vector;
3549 if (instance.pred == PRED_TYPE_m || instance.pred == PRED_TYPE_tum
3550 || instance.pred == PRED_TYPE_tumu || instance.pred == PRED_TYPE_mu)
3551 argument_types.quick_insert (0, mask_type);
3553 /* check if rounding mode parameter need */
3554 if (instance.base->has_rounding_mode_operand_p ())
3555 argument_types.quick_push (unsigned_type_node);
3557 /* check if vl parameter need */
3558 if (instance.base->apply_vl_p ())
3559 argument_types.quick_push (size_type_node);
3562 /* Register all the functions in GROUP. */
3563 void
3564 function_builder::register_function_group (const function_group_info &group)
3566 (*group.shape)->build (*this, group);
3569 /* Add NAME to the end of the function name being built. */
3570 void
3571 function_builder::append_name (const char *name)
3573 obstack_grow (&m_string_obstack, name, strlen (name));
3576 /* Add "__riscv_" and "name". */
3577 void
3578 function_builder::append_base_name (const char *name)
3580 append_name ("__riscv_");
3581 append_name (name);
3584 /* Add SEW into function name. */
3585 void
3586 function_builder::append_sew (int sew)
3588 switch (sew)
3590 case 8:
3591 append_name ("8");
3592 break;
3593 case 16:
3594 append_name ("16");
3595 break;
3596 case 32:
3597 append_name ("32");
3598 break;
3599 case 64:
3600 append_name ("64");
3601 break;
3602 default:
3603 gcc_unreachable ();
3607 /* Add NF into function name. */
3608 void
3609 function_builder::append_nf (int nf)
3611 switch (nf)
3613 case 2:
3614 append_name ("2");
3615 break;
3616 case 3:
3617 append_name ("3");
3618 break;
3619 case 4:
3620 append_name ("4");
3621 break;
3622 case 5:
3623 append_name ("5");
3624 break;
3625 case 6:
3626 append_name ("6");
3627 break;
3628 case 7:
3629 append_name ("7");
3630 break;
3631 case 8:
3632 append_name ("8");
3633 break;
3634 default:
3635 gcc_unreachable ();
3639 /* Zero-terminate and complete the function name being built. */
3640 char *
3641 function_builder::finish_name ()
3643 obstack_1grow (&m_string_obstack, 0);
3644 return (char *) obstack_finish (&m_string_obstack);
3647 /* Return the appropriate function attributes for INSTANCE. */
3648 tree
3649 function_builder::get_attributes (const function_instance &instance)
3651 tree attrs = NULL_TREE;
3653 if (!instance.modifies_global_state_p ())
3655 if (instance.reads_global_state_p ())
3656 attrs = add_attribute ("pure", attrs);
3657 else
3658 attrs = add_attribute ("const", attrs);
3661 if (!flag_non_call_exceptions || !instance.could_trap_p ())
3662 attrs = add_attribute ("nothrow", attrs);
3664 return add_attribute ("leaf", attrs);
3667 /* Add a function called NAME with type FNTYPE and attributes ATTRS.
3668 INSTANCE describes what the function does. */
3669 registered_function &
3670 function_builder::add_function (const function_instance &instance,
3671 const char *name, tree fntype, tree attrs,
3672 bool placeholder_p, const char *overload_name,
3673 const vec<tree> &argument_types,
3674 bool overloaded_p = false)
3676 unsigned int code = vec_safe_length (registered_functions);
3677 code = (code << RISCV_BUILTIN_SHIFT) + RISCV_BUILTIN_VECTOR;
3679 /* We need to be able to generate placeholders to enusre that we have a
3680 consistent numbering scheme for function codes between the C and C++
3681 frontends, so that everything ties up in LTO.
3683 Currently, tree-streamer-in.c:unpack_ts_function_decl_value_fields
3684 validates that tree nodes returned by TARGET_BUILTIN_DECL are non-NULL and
3685 some node other than error_mark_node. This is a holdover from when builtin
3686 decls were streamed by code rather than by value.
3688 Ultimately, we should be able to remove this validation of BUILT_IN_MD
3689 nodes and remove the target hook. For now, however, we need to appease the
3690 validation and return a non-NULL, non-error_mark_node node, so we
3691 arbitrarily choose integer_zero_node. */
3692 tree decl = placeholder_p
3693 ? integer_zero_node
3694 : simulate_builtin_function_decl (input_location, name, fntype,
3695 code, NULL, attrs);
3697 registered_function &rfn = *ggc_alloc<registered_function> ();
3698 rfn.instance = instance;
3699 rfn.decl = decl;
3700 rfn.overload_name = overload_name ? xstrdup (overload_name) : NULL;
3701 rfn.argument_types = argument_types;
3702 rfn.overloaded_p = overloaded_p;
3703 vec_safe_push (registered_functions, &rfn);
3705 return rfn;
3708 /* Add a built-in function for INSTANCE, with the argument types given
3709 by ARGUMENT_TYPES and the return type given by RETURN_TYPE. NAME is
3710 the "full" name for C function. OVERLOAD_NAME is the "short" name for
3711 C++ overloaded function. OVERLOAD_NAME can be nullptr because some
3712 instance doesn't have C++ overloaded function. */
3713 void
3714 function_builder::add_unique_function (const function_instance &instance,
3715 const function_shape *shape,
3716 tree return_type,
3717 vec<tree> &argument_types)
3719 /* Do not add this function if it is invalid. */
3720 if (!check_required_extensions (instance))
3721 return;
3723 /* Also add the function under its overloaded alias, if we want
3724 a separate decl for each instance of an overloaded function. */
3725 char *overload_name = shape->get_name (*this, instance, true);
3727 /* Add the function under its full (unique) name. */
3728 char *name = shape->get_name (*this, instance, false);
3729 tree fntype
3730 = build_function_type_array (return_type, argument_types.length (),
3731 argument_types.address ());
3732 tree attrs = get_attributes (instance);
3733 registered_function &rfn
3734 = add_function (instance, name, fntype, attrs, false, overload_name,
3735 argument_types.copy ());
3737 /* Enter the function into the hash table. */
3738 hashval_t hash = instance.hash ();
3739 registered_function **rfn_slot
3740 = function_table->find_slot_with_hash (instance, hash, INSERT);
3741 gcc_assert (!*rfn_slot);
3742 *rfn_slot = &rfn;
3744 if (overload_name)
3746 /* Attribute lists shouldn't be shared. */
3747 tree attrs = get_attributes (instance);
3748 bool placeholder_p = !m_direct_overloads;
3749 add_function (instance, overload_name, fntype, attrs, placeholder_p, NULL,
3750 vNULL);
3752 /* Enter the function into the non-overloaded hash table. */
3753 hash = rfn.overloaded_hash ();
3754 rfn_slot = non_overloaded_function_table->find_slot_with_hash (&rfn, hash,
3755 INSERT);
3756 gcc_assert (!*rfn_slot);
3757 *rfn_slot = &rfn;
3759 obstack_free (&m_string_obstack, name);
3762 /* Add overloaded function for gcc. */
3763 void
3764 function_builder::add_overloaded_function (const function_instance &instance,
3765 const function_shape *shape)
3767 if (!check_required_extensions (instance))
3768 return;
3770 char *name = shape->get_name (*this, instance, true);
3772 if (name)
3774 /* To avoid API conflicting, take void return type and void argument
3775 for the overloaded function. */
3776 tree fntype = build_function_type (void_type_node, void_list_node);
3777 add_function (instance, name, fntype, NULL_TREE, m_direct_overloads, name,
3778 vNULL, true);
3779 obstack_free (&m_string_obstack, name);
3783 function_call_info::function_call_info (location_t location_in,
3784 const function_instance &instance_in,
3785 tree fndecl_in)
3786 : function_instance (instance_in), location (location_in), fndecl (fndecl_in)
3789 gimple_folder::gimple_folder (const function_instance &instance, tree fndecl,
3790 gimple_stmt_iterator *gsi_in, gcall *call_in)
3791 : function_call_info (gimple_location (call_in), instance, fndecl),
3792 gsi (gsi_in), call (call_in), lhs (gimple_call_lhs (call_in))
3796 /* Try to fold the call. Return the new statement on success and null
3797 on failure. */
3798 gimple *
3799 gimple_folder::fold ()
3801 /* Don't fold anything when RVV is disabled; emit an error during
3802 expansion instead. */
3803 if (!TARGET_VECTOR)
3804 return NULL;
3806 /* Punt if the function has a return type and no result location is
3807 provided. The attributes should allow target-independent code to
3808 remove the calls if appropriate. */
3809 if (!lhs && TREE_TYPE (gimple_call_fntype (call)) != void_type_node)
3810 return NULL;
3812 return base->fold (*this);
3815 function_expander::function_expander (const function_instance &instance,
3816 tree fndecl_in, tree exp_in,
3817 rtx target_in)
3818 : function_call_info (EXPR_LOCATION (exp_in), instance, fndecl_in),
3819 exp (exp_in), target (target_in), opno (0)
3821 if (!function_returns_void_p ())
3823 if (target != NULL_RTX && MEM_P (target))
3824 /* Since there is no intrinsic where target is a mem operand, it
3825 should be converted to reg if it is a mem operand. */
3826 target = force_reg (GET_MODE (target), target);
3827 create_output_operand (&m_ops[opno++], target,
3828 TYPE_MODE (TREE_TYPE (exp)));
3832 /* Take argument ARGNO from EXP's argument list and convert it into
3833 an expand operand. Store the operand in *M_OPS. */
3834 void
3835 function_expander::add_input_operand (unsigned argno)
3837 tree arg = CALL_EXPR_ARG (exp, argno);
3838 rtx x = expand_normal (arg);
3839 add_input_operand (TYPE_MODE (TREE_TYPE (arg)), x);
3842 /* Since we may normalize vop/vop_tu/vop_m/vop_tumu.. into a single patter.
3843 We add a undef for the intrinsics that don't need a real merge. */
3844 void
3845 function_expander::add_vundef_operand (machine_mode mode)
3847 add_input_operand (mode, RVV_VUNDEF (mode));
3850 /* Add a memory operand with mode MODE and address ADDR. */
3851 void
3852 function_expander::add_mem_operand (machine_mode mode, unsigned argno)
3854 gcc_assert (VECTOR_MODE_P (mode));
3855 rtx addr = expand_normal (CALL_EXPR_ARG (exp, argno));
3856 rtx mem = gen_rtx_MEM (mode, memory_address (mode, addr));
3857 /* The memory is only guaranteed to be element-aligned. */
3858 set_mem_align (mem, GET_MODE_ALIGNMENT (GET_MODE_INNER (mode)));
3859 add_fixed_operand (mem);
3862 /* Return the machine_mode of the corresponding mask type. */
3863 machine_mode
3864 function_expander::mask_mode (void) const
3866 vector_type_index mask_type_index
3867 = function_types[type.index].type_indexes[RVV_BASE_mask];
3868 return TYPE_MODE (builtin_types[mask_type_index].vector);
3871 /* Implement the call using instruction ICODE, with a 1:1 mapping between
3872 arguments and input operands. */
3874 function_expander::use_exact_insn (insn_code icode)
3876 machine_mode mode = TYPE_MODE (TREE_TYPE (exp));
3878 /* Record the offset to get the argument. */
3879 int arg_offset = 0;
3881 if (base->use_mask_predication_p ())
3883 if (use_real_mask_p (pred))
3884 add_input_operand (arg_offset++);
3885 else
3886 add_all_one_mask_operand (mask_mode ());
3889 /* Store operation doesn't have merge operand. */
3890 if (!function_returns_void_p () && base->has_merge_operand_p ())
3892 if (use_real_merge_p (pred))
3893 add_input_operand (arg_offset++);
3894 else
3895 add_vundef_operand (mode);
3898 for (int argno = arg_offset; argno < call_expr_nargs (exp); argno++)
3900 if (base->has_rounding_mode_operand_p ()
3901 && argno == call_expr_nargs (exp) - 2)
3903 /* Since the rounding mode argument position is not consistent with
3904 the instruction pattern, we need to skip rounding mode argument
3905 here. */
3906 continue;
3908 add_input_operand (argno);
3911 if (base->apply_tail_policy_p ())
3912 add_input_operand (Pmode, get_tail_policy_for_pred (pred));
3913 if (base->apply_mask_policy_p ())
3914 add_input_operand (Pmode, get_mask_policy_for_pred (pred));
3916 if (base->apply_vl_p ())
3917 add_input_operand (Pmode, get_avl_type_rtx (avl_type::NONVLMAX));
3919 if (base->has_rounding_mode_operand_p ())
3920 add_input_operand (call_expr_nargs (exp) - 2);
3922 /* The RVV floating-point only support dynamic rounding mode in the
3923 FRM register. */
3924 if (opno != insn_data[icode].n_generator_args)
3925 add_input_operand (Pmode, gen_int_mode (riscv_vector::FRM_DYN, Pmode));
3927 return generate_insn (icode);
3930 /* Use contiguous load INSN. */
3932 function_expander::use_contiguous_load_insn (insn_code icode)
3934 gcc_assert (call_expr_nargs (exp) > 0);
3935 machine_mode mode = TYPE_MODE (TREE_TYPE (exp));
3937 /* Record the offset to get the argument. */
3938 int arg_offset = 0;
3940 if (use_real_mask_p (pred))
3941 add_input_operand (arg_offset++);
3942 else
3943 add_all_one_mask_operand (mask_mode ());
3945 if (use_real_merge_p (pred))
3946 add_input_operand (arg_offset++);
3947 else
3948 add_vundef_operand (mode);
3950 add_mem_operand (mode, arg_offset++);
3952 for (int argno = arg_offset; argno < call_expr_nargs (exp); argno++)
3953 add_input_operand (argno);
3955 if (GET_MODE_CLASS (mode) != MODE_VECTOR_BOOL)
3957 add_input_operand (Pmode, get_tail_policy_for_pred (pred));
3958 add_input_operand (Pmode, get_mask_policy_for_pred (pred));
3961 if (opno != insn_data[icode].n_generator_args)
3962 add_input_operand (Pmode, get_avl_type_rtx (avl_type::NONVLMAX));
3964 return generate_insn (icode);
3967 /* Use contiguous store INSN. */
3969 function_expander::use_contiguous_store_insn (insn_code icode)
3971 gcc_assert (call_expr_nargs (exp) > 0);
3972 machine_mode mode = TYPE_MODE (builtin_types[type.index].vector);
3974 /* Record the offset to get the argument. */
3975 int arg_offset = 0;
3977 add_mem_operand (mode, use_real_mask_p (pred) ? 1 : 0);
3979 if (use_real_mask_p (pred))
3980 add_input_operand (arg_offset++);
3981 else
3982 add_all_one_mask_operand (mask_mode ());
3984 arg_offset++;
3985 for (int argno = arg_offset; argno < call_expr_nargs (exp); argno++)
3986 add_input_operand (argno);
3988 add_input_operand (Pmode, get_avl_type_rtx (avl_type::NONVLMAX));
3989 return generate_insn (icode);
3992 /* Implement the call using instruction ICODE, with a 1:1 mapping between
3993 arguments and input operands. */
3995 function_expander::use_compare_insn (rtx_code rcode, insn_code icode)
3997 machine_mode mode = TYPE_MODE (builtin_types[type.index].vector);
3998 machine_mode mask_mode = TYPE_MODE (TREE_TYPE (exp));
4000 /* Record the offset to get the argument. */
4001 int arg_offset = 0;
4003 if (use_real_mask_p (pred))
4004 add_input_operand (arg_offset++);
4005 else
4006 add_all_one_mask_operand (mask_mode);
4008 if (use_real_merge_p (pred))
4009 add_input_operand (arg_offset++);
4010 else
4011 add_vundef_operand (mask_mode);
4013 rtx op1 = expand_normal (CALL_EXPR_ARG (exp, arg_offset++));
4014 rtx op2 = expand_normal (CALL_EXPR_ARG (exp, arg_offset++));
4015 if (!insn_operand_matches (icode, opno + 1, op1))
4016 op1 = force_reg (mode, op1);
4017 if (!insn_operand_matches (icode, opno + 2, op2))
4019 if (VECTOR_MODE_P (GET_MODE (op2)))
4020 op2 = force_reg (mode, op2);
4021 else
4022 op2 = force_reg (GET_MODE_INNER (mode), op2);
4024 rtx comparison = gen_rtx_fmt_ee (rcode, mask_mode, op1, op2);
4025 if (!VECTOR_MODE_P (GET_MODE (op2)))
4026 comparison = gen_rtx_fmt_ee (rcode, mask_mode, op1,
4027 gen_rtx_VEC_DUPLICATE (mode, op2));
4028 add_fixed_operand (comparison);
4029 add_fixed_operand (op1);
4030 if (CONST_INT_P (op2))
4031 add_integer_operand (op2);
4032 else
4033 add_fixed_operand (op2);
4034 for (int argno = arg_offset; argno < call_expr_nargs (exp); argno++)
4035 add_input_operand (argno);
4037 add_input_operand (Pmode, get_mask_policy_for_pred (pred));
4038 add_input_operand (Pmode, get_avl_type_rtx (avl_type::NONVLMAX));
4039 return generate_insn (icode);
4042 /* Implement the call using instruction ICODE, with a 1:1 mapping between
4043 arguments and input operands. */
4045 function_expander::use_ternop_insn (bool vd_accum_p, insn_code icode)
4047 machine_mode mode = TYPE_MODE (builtin_types[type.index].vector);
4049 /* Record the offset to get the argument. */
4050 int arg_offset = 0;
4052 if (use_real_mask_p (pred))
4053 add_input_operand (arg_offset++);
4054 else
4055 add_all_one_mask_operand (mask_mode ());
4057 rtx vd = expand_normal (CALL_EXPR_ARG (exp, arg_offset++));
4058 rtx vs1 = expand_normal (CALL_EXPR_ARG (exp, arg_offset++));
4059 rtx vs2 = expand_normal (CALL_EXPR_ARG (exp, arg_offset++));
4061 if (VECTOR_MODE_P (GET_MODE (vs1)))
4063 if (!vd_accum_p)
4064 add_input_operand (mode, vd);
4065 add_input_operand (mode, vs1);
4066 add_input_operand (mode, vs2);
4067 if (vd_accum_p)
4068 add_input_operand (mode, vd);
4069 add_input_operand (mode, vd);
4071 else
4073 add_input_operand (GET_MODE_INNER (mode), vs1);
4074 if (vd_accum_p)
4076 add_input_operand (mode, vs2);
4077 add_input_operand (mode, vd);
4079 else
4081 add_input_operand (mode, vd);
4082 add_input_operand (mode, vs2);
4084 add_input_operand (mode, vd);
4087 for (int argno = arg_offset; argno < call_expr_nargs (exp); argno++)
4089 if (base->has_rounding_mode_operand_p ()
4090 && argno == call_expr_nargs (exp) - 2)
4092 /* Since the rounding mode argument position is not consistent with
4093 the instruction pattern, we need to skip rounding mode argument
4094 here. */
4095 continue;
4097 add_input_operand (argno);
4100 add_input_operand (Pmode, get_tail_policy_for_pred (pred));
4101 add_input_operand (Pmode, get_mask_policy_for_pred (pred));
4102 add_input_operand (Pmode, get_avl_type_rtx (avl_type::NONVLMAX));
4104 if (base->has_rounding_mode_operand_p ())
4105 add_input_operand (call_expr_nargs (exp) - 2);
4107 /* The RVV floating-point only support dynamic rounding mode in the
4108 FRM register. */
4109 if (opno != insn_data[icode].n_generator_args)
4110 add_input_operand (Pmode, gen_int_mode (riscv_vector::FRM_DYN, Pmode));
4112 return generate_insn (icode);
4115 /* Implement the call using instruction ICODE, with a 1:1 mapping between
4116 arguments and input operands. */
4118 function_expander::use_widen_ternop_insn (insn_code icode)
4120 /* Record the offset to get the argument. */
4121 int arg_offset = 0;
4123 if (use_real_mask_p (pred))
4124 add_input_operand (arg_offset++);
4125 else
4126 add_all_one_mask_operand (mask_mode ());
4128 for (int argno = arg_offset; argno < call_expr_nargs (exp); argno++)
4130 if (base->has_rounding_mode_operand_p ()
4131 && argno == call_expr_nargs (exp) - 2)
4133 /* Since the rounding mode argument position is not consistent with
4134 the instruction pattern, we need to skip rounding mode argument
4135 here. */
4136 continue;
4138 add_input_operand (argno);
4141 add_input_operand (Pmode, get_tail_policy_for_pred (pred));
4142 add_input_operand (Pmode, get_mask_policy_for_pred (pred));
4143 add_input_operand (Pmode, get_avl_type_rtx (avl_type::NONVLMAX));
4145 if (base->has_rounding_mode_operand_p ())
4146 add_input_operand (call_expr_nargs (exp) - 2);
4148 /* The RVV floating-point only support dynamic rounding mode in the
4149 FRM register. */
4150 if (opno != insn_data[icode].n_generator_args)
4151 add_input_operand (Pmode, gen_int_mode (riscv_vector::FRM_DYN, Pmode));
4153 return generate_insn (icode);
4156 /* Implement the call using instruction ICODE, with a 1:1 mapping between
4157 arguments and input operands. */
4159 function_expander::use_scalar_move_insn (insn_code icode)
4161 machine_mode mode = TYPE_MODE (TREE_TYPE (exp));
4163 /* Record the offset to get the argument. */
4164 int arg_offset = 0;
4165 add_scalar_move_mask_operand (mask_mode ());
4167 if (use_real_merge_p (pred))
4168 add_input_operand (arg_offset++);
4169 else
4170 add_vundef_operand (mode);
4172 for (int argno = arg_offset; argno < call_expr_nargs (exp); argno++)
4173 add_input_operand (argno);
4175 add_input_operand (Pmode, get_tail_policy_for_pred (pred));
4176 add_input_operand (Pmode, get_mask_policy_for_pred (pred));
4177 add_input_operand (Pmode, get_avl_type_rtx (avl_type::NONVLMAX));
4178 return generate_insn (icode);
4181 /* Generate instruction ICODE, given that its operands have already
4182 been added to M_OPS. Return the value of the first operand. */
4184 function_expander::generate_insn (insn_code icode)
4186 gcc_assert (opno == insn_data[icode].n_generator_args);
4187 if (!maybe_expand_insn (icode, opno, m_ops))
4189 error ("invalid argument to built-in function");
4190 return NULL_RTX;
4192 return function_returns_void_p () ? const0_rtx : m_ops[0].value;
4195 function_checker::function_checker (location_t location,
4196 const function_instance &instance,
4197 tree fndecl, tree fntype,
4198 unsigned int nargs, tree *args)
4199 : function_call_info (location, instance, fndecl), m_fntype (fntype),
4200 m_nargs (nargs), m_args (args)
4203 /* Report that LOCATION has a call to FNDECL in which argument ARGNO
4204 was not an integer constant expression. ARGNO counts from zero. */
4205 void
4206 function_checker::report_non_ice (unsigned int argno) const
4208 error_at (location,
4209 "argument %d of %qE must be an integer constant"
4210 " expression",
4211 argno + 1, fndecl);
4214 /* Report that LOCATION has a call to FNDECL in which argument ARGNO has
4215 the value ACTUAL, whereas the function requires a value in the range
4216 [MIN, MAX]. ARGNO counts from zero. */
4217 void
4218 function_checker::report_out_of_range (unsigned int argno, HOST_WIDE_INT actual,
4219 HOST_WIDE_INT min,
4220 HOST_WIDE_INT max) const
4222 error_at (location,
4223 "passing %wd to argument %d of %qE, which expects"
4224 " a value in the range [%wd, %wd]",
4225 actual, argno + 1, fndecl, min, max);
4228 /* Report that LOCATION has a call to FNDECL in which argument ARGNO has
4229 the value ACTUAL, whereas the function requires a value in the range
4230 [MIN, MAX] or OR_VAL. ARGNO counts from zero. */
4231 void
4232 function_checker::report_out_of_range_and_not (unsigned int argno,
4233 HOST_WIDE_INT actual,
4234 HOST_WIDE_INT min,
4235 HOST_WIDE_INT max,
4236 HOST_WIDE_INT or_val) const
4238 error_at (location,
4239 "passing %wd to argument %d of %qE, which expects"
4240 " a value in the range [%wd, %wd] or %wd",
4241 actual, argno + 1, fndecl, min, max, or_val);
4245 /* Check that argument ARGNO is an integer constant expression and
4246 store its value in VALUE_OUT if so. The caller should first
4247 check that argument ARGNO exists. */
4248 bool
4249 function_checker::require_immediate (unsigned int argno, HOST_WIDE_INT min,
4250 HOST_WIDE_INT max) const
4252 gcc_assert (argno < m_nargs);
4253 tree arg = m_args[argno];
4255 /* The type and range are unsigned, so read the argument as an
4256 unsigned rather than signed HWI. */
4257 if (!tree_fits_uhwi_p (arg))
4259 report_non_ice (argno);
4260 return false;
4262 return require_immediate_range (argno, min, max);
4265 /* Check that argument REL_ARGNO is an integer constant expression in the
4266 range [MIN, MAX]. REL_ARGNO counts from the end of the predication
4267 arguments. */
4268 bool
4269 function_checker::require_immediate_range (unsigned int argno,
4270 HOST_WIDE_INT min,
4271 HOST_WIDE_INT max) const
4273 gcc_assert (argno < m_nargs);
4274 tree arg = m_args[argno];
4275 HOST_WIDE_INT actual = tree_to_uhwi (arg);
4277 if (!IN_RANGE (actual, min, max))
4279 report_out_of_range (argno, actual, min, max);
4280 return false;
4283 return true;
4286 /* Check that argument REL_ARGNO is an integer constant expression in the
4287 range [MIN, MAX] or OR_VAL. REL_ARGNO counts from the end of the
4288 predication arguments. */
4289 bool
4290 function_checker::require_immediate_range_or (unsigned int argno,
4291 HOST_WIDE_INT min,
4292 HOST_WIDE_INT max,
4293 HOST_WIDE_INT or_val) const
4295 gcc_assert (min >= 0 && min <= max);
4296 gcc_assert (argno < m_nargs);
4298 tree arg = m_args[argno];
4299 HOST_WIDE_INT actual = tree_to_uhwi (arg);
4301 if (!IN_RANGE (actual, min, max) && actual != or_val)
4303 report_out_of_range_and_not (argno, actual, min, max, or_val);
4304 return false;
4307 return true;
4310 /* Perform semantic checks on the call. Return true if the call is valid,
4311 otherwise report a suitable error. */
4312 bool
4313 function_checker::check ()
4315 return shape->check (*this);
4318 inline hashval_t
4319 registered_function_hasher::hash (value_type value)
4321 return value->instance.hash ();
4324 inline bool
4325 registered_function_hasher::equal (value_type value, const compare_type &key)
4327 return value->instance == key;
4330 hashval_t
4331 registered_function::overloaded_hash () const
4333 inchash::hash h;
4334 tree type;
4335 unsigned int unsigned_p, mode_p;
4336 h.add (overload_name, strlen (overload_name));
4337 for (unsigned int i = 0; i < argument_types.length (); i++)
4339 type = argument_types[i];
4340 unsigned_p = POINTER_TYPE_P (type) ? TYPE_UNSIGNED (TREE_TYPE (type))
4341 : TYPE_UNSIGNED (type);
4342 mode_p = POINTER_TYPE_P (type) ? TYPE_MODE (TREE_TYPE (type))
4343 : TYPE_MODE (type);
4344 if (POINTER_TYPE_P (type) || lookup_vector_type_attribute (type))
4346 h.add_int (unsigned_p);
4347 h.add_int (mode_p);
4349 else if (instance.base->may_require_vxrm_p ()
4350 || instance.base->may_require_frm_p ())
4352 h.add_int (argument_types.length ());
4353 break;
4357 return h.end ();
4360 hashval_t
4361 registered_function::overloaded_hash (const vec<tree, va_gc> &arglist)
4363 argument_types = vNULL;
4364 unsigned int len = arglist.length ();
4366 for (unsigned int i = 0; i < len; i++)
4367 argument_types.safe_push (TREE_TYPE (arglist[i]));
4369 return overloaded_hash ();
4372 inline hashval_t
4373 non_overloaded_registered_function_hasher::hash (value_type value)
4375 return value->overloaded_hash ();
4378 inline bool
4379 non_overloaded_registered_function_hasher::equal (value_type value,
4380 const compare_type &key)
4382 return ((strcmp (value->overload_name, key->overload_name) == 0)
4383 && value->overloaded_hash () == key->overloaded_hash ());
4386 /* If TYPE is a built-in type defined by the RVV ABI, return the mangled name,
4387 otherwise return NULL. */
4388 const char *
4389 mangle_builtin_type (const_tree type)
4391 if (TYPE_NAME (type) && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL)
4392 type = TREE_TYPE (TYPE_NAME (type));
4393 if (tree attr = lookup_vector_type_attribute (type))
4394 if (tree id = TREE_VALUE (chain_index (0, TREE_VALUE (attr))))
4395 return IDENTIFIER_POINTER (id);
4396 return NULL;
4399 /* Return true if TYPE is a built-in RVV type defined by the ABI. */
4400 bool
4401 builtin_type_p (const_tree type)
4403 if (!type)
4404 return false;
4406 return lookup_vector_type_attribute (type);
4409 /* Initialize all compiler built-ins related to RVV that should be
4410 defined at start-up. */
4411 void
4412 init_builtins ()
4414 rvv_switcher rvv;
4415 if (!TARGET_VECTOR)
4416 return;
4417 register_builtin_types ();
4418 if (in_lto_p)
4419 handle_pragma_vector ();
4422 /* Implement TARGET_VERIFY_TYPE_CONTEXT for RVV types. */
4423 bool
4424 verify_type_context (location_t loc, type_context_kind context, const_tree type,
4425 bool silent_p)
4427 if (!sizeless_type_p (type))
4428 return true;
4430 switch (context)
4432 case TCTX_SIZEOF:
4433 case TCTX_STATIC_STORAGE:
4434 if (!silent_p)
4435 error_at (loc, "RVV type %qT does not have a fixed size", type);
4437 return false;
4439 case TCTX_ALIGNOF:
4440 if (!silent_p)
4441 error_at (loc, "RVV type %qT does not have a defined alignment", type);
4443 return false;
4445 case TCTX_THREAD_STORAGE:
4446 if (!silent_p)
4447 error_at (loc,
4448 "variables of type %qT cannot have thread-local"
4449 " storage duration",
4450 type);
4452 return false;
4454 case TCTX_POINTER_ARITH:
4455 if (!silent_p)
4456 error_at (loc, "arithmetic on pointer to RVV type %qT", type);
4458 return false;
4460 case TCTX_FIELD:
4461 if (silent_p)
4463 else if (lang_GNU_CXX ())
4464 error_at (loc, "member variables cannot have RVV type %qT", type);
4465 else
4466 error_at (loc, "fields cannot have RVV type %qT", type);
4468 return false;
4470 case TCTX_ARRAY_ELEMENT:
4471 if (!silent_p)
4472 error_at (loc, "array elements cannot have RVV type %qT", type);
4474 return false;
4476 case TCTX_ALLOCATION:
4477 if (!silent_p)
4478 error_at (loc, "cannot allocate objects with RVV type %qT", type);
4480 return false;
4482 case TCTX_DEALLOCATION:
4483 if (!silent_p)
4484 error_at (loc, "cannot delete objects with RVV type %qT", type);
4486 return false;
4488 case TCTX_EXCEPTIONS:
4489 if (!silent_p)
4490 error_at (loc, "cannot throw or catch RVV type %qT", type);
4492 return false;
4494 case TCTX_CAPTURE_BY_COPY:
4495 if (!silent_p)
4496 error_at (loc, "capture by copy of RVV type %qT", type);
4498 return false;
4501 gcc_unreachable ();
4504 /* Register the vxrm enum. */
4505 static void
4506 register_vxrm ()
4508 auto_vec<string_int_pair, 4> values;
4509 #define DEF_RVV_VXRM_ENUM(NAME, VALUE) \
4510 values.quick_push (string_int_pair ("__RISCV_VXRM_" #NAME, VALUE));
4511 #include "riscv-vector-builtins.def"
4512 #undef DEF_RVV_VXRM_ENUM
4514 lang_hooks.types.simulate_enum_decl (input_location, "__RISCV_VXRM", &values);
4517 /* Register the frm enum. */
4518 static void
4519 register_frm ()
4521 auto_vec<string_int_pair, 5> values;
4522 #define DEF_RVV_FRM_ENUM(NAME, VALUE) \
4523 values.quick_push (string_int_pair ("__RISCV_FRM_" #NAME, VALUE));
4524 #include "riscv-vector-builtins.def"
4525 #undef DEF_RVV_FRM_ENUM
4527 lang_hooks.types.simulate_enum_decl (input_location, "__RISCV_FRM", &values);
4530 /* Implement #pragma riscv intrinsic vector. */
4531 void
4532 handle_pragma_vector ()
4534 if (function_table || non_overloaded_function_table)
4536 error ("duplicate definition of %qs", "riscv_vector.h");
4537 return;
4539 rvv_switcher rvv;
4541 /* Define the vector and tuple types. */
4542 for (unsigned int type_i = 0; type_i < NUM_VECTOR_TYPES; ++type_i)
4543 register_vector_type ((enum vector_type_index) type_i);
4545 /* Define the enums. */
4546 register_vxrm ();
4547 register_frm ();
4549 /* Define the functions. */
4550 function_table = new hash_table<registered_function_hasher> (1023);
4551 non_overloaded_function_table
4552 = new hash_table<non_overloaded_registered_function_hasher> (1023);
4553 function_builder builder;
4554 for (unsigned int i = 0; i < ARRAY_SIZE (function_groups); ++i)
4556 if (function_groups[i].match (function_groups[i].required_extensions))
4557 builder.register_function_group (function_groups[i]);
4561 /* Return the function decl with RVV function subcode CODE, or error_mark_node
4562 if no such function exists. */
4563 tree
4564 builtin_decl (unsigned int code, bool)
4566 if (code >= vec_safe_length (registered_functions))
4567 return error_mark_node;
4569 return (*registered_functions)[code]->decl;
4572 /* Attempt to fold STMT, given that it's a call to the RVV function
4573 with subcode CODE. Return the new statement on success and null
4574 on failure. Insert any other new statements at GSI. */
4575 gimple *
4576 gimple_fold_builtin (unsigned int code, gimple_stmt_iterator *gsi, gcall *stmt)
4578 registered_function &rfn = *(*registered_functions)[code];
4579 return gimple_folder (rfn.instance, rfn.decl, gsi, stmt).fold ();
4582 /* Expand a call to the RVV function with subcode CODE. EXP is the call
4583 expression and TARGET is the preferred location for the result.
4584 Return the value of the lhs. */
4586 expand_builtin (unsigned int code, tree exp, rtx target)
4588 registered_function &rfn = *(*registered_functions)[code];
4590 if (!TARGET_VECTOR)
4591 error_at (EXPR_LOCATION (exp),
4592 "builtin function %qE requires the V ISA extension", exp);
4594 return function_expander (rfn.instance, rfn.decl, exp, target).expand ();
4597 /* Perform any semantic checks needed for a call to the RVV function
4598 with subcode CODE, such as testing for integer constant expressions.
4599 The call occurs at location LOCATION and has NARGS arguments,
4600 given by ARGS. FNDECL is the original function decl, before
4601 overload resolution.
4603 Return true if the call is valid, otherwise report a suitable error. */
4604 bool
4605 check_builtin_call (location_t location, vec<location_t>, unsigned int code,
4606 tree fndecl, unsigned int nargs, tree *args)
4608 const registered_function &rfn = *(*registered_functions)[code];
4609 return function_checker (location, rfn.instance, fndecl,
4610 TREE_TYPE (rfn.decl), nargs, args).check ();
4613 tree
4614 resolve_overloaded_builtin (location_t loc, unsigned int code, tree fndecl,
4615 vec<tree, va_gc> *arglist)
4617 if (code >= vec_safe_length (registered_functions))
4618 return NULL_TREE;
4620 registered_function *rfun = (*registered_functions)[code];
4622 if (!rfun || !rfun->overloaded_p)
4623 return NULL_TREE;
4625 /* According to the rvv intrinisc doc, we have no such overloaded function
4626 with empty args. Unfortunately, we register the empty args function as
4627 overloaded for avoiding conflict. Thus, there will actual one register
4628 function after return NULL_TREE back to the middle-end, and finally result
4629 in ICE when expanding. For example:
4631 1. First we registered void __riscv_vfredmax () as the overloaded function.
4632 2. Then resolve_overloaded_builtin (this func) return NULL_TREE.
4633 3. The functions register in step 1 bypass the args check as empty args.
4634 4. Finally, fall into expand_builtin with empty args and meet ICE.
4636 Here we report error when overloaded function with empty args. */
4637 if (rfun->overloaded_p && arglist->length () == 0)
4638 error_at (loc, "no matching function call to %qE with empty arguments",
4639 fndecl);
4641 hashval_t hash = rfun->overloaded_hash (*arglist);
4642 registered_function *rfn
4643 = non_overloaded_function_table->find_with_hash (rfun, hash);
4645 return rfn ? rfn->decl : NULL_TREE;
4648 function_instance
4649 get_read_vl_instance (void)
4651 return function_instance ("read_vl", bases::read_vl, shapes::read_vl,
4652 none_ops[0], PRED_TYPE_none, &p_none_void_ops);
4655 tree
4656 get_read_vl_decl (void)
4658 function_instance instance = get_read_vl_instance ();
4659 hashval_t hash = instance.hash ();
4660 registered_function *rfn = function_table->find_with_hash (instance, hash);
4661 gcc_assert (rfn);
4662 return rfn->decl;
4665 } // end namespace riscv_vector
4667 inline void
4668 gt_ggc_mx (function_instance *)
4671 inline void
4672 gt_pch_nx (function_instance *)
4675 inline void
4676 gt_pch_nx (function_instance *, gt_pointer_operator, void *)
4679 #include "gt-riscv-vector-builtins.h"