| 1 |
/* function_base implementation for RISC-V 'V' Extension for GNU compiler. |
| 2 |
Copyright (C) 2022-2025 Free Software Foundation, Inc. |
| 3 |
Contributed by Ju-Zhe Zhong ([email protected]), RiVAI Technologies Ltd. |
| 4 |
|
| 5 |
This file is part of GCC. |
| 6 |
|
| 7 |
GCC is free software; you can redistribute it and/or modify it |
| 8 |
under the terms of the GNU General Public License as published by |
| 9 |
the Free Software Foundation; either version 3, or (at your option) |
| 10 |
any later version. |
| 11 |
|
| 12 |
GCC is distributed in the hope that it will be useful, but |
| 13 |
WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 |
General Public License for more details. |
| 16 |
|
| 17 |
You should have received a copy of the GNU General Public License |
| 18 |
along with GCC; see the file COPYING3. If not see |
| 19 |
<http://www.gnu.org/licenses/>. */ |
| 20 |
|
| 21 |
#include "config.h" |
| 22 |
#include "system.h" |
| 23 |
#include "coretypes.h" |
| 24 |
#include "tm.h" |
| 25 |
#include "tree.h" |
| 26 |
#include "rtl.h" |
| 27 |
#include "tm_p.h" |
| 28 |
#include "memmodel.h" |
| 29 |
#include "insn-codes.h" |
| 30 |
#include "optabs.h" |
| 31 |
#include "recog.h" |
| 32 |
#include "expr.h" |
| 33 |
#include "basic-block.h" |
| 34 |
#include "function.h" |
| 35 |
#include "fold-const.h" |
| 36 |
#include "gimple.h" |
| 37 |
#include "gimple-iterator.h" |
| 38 |
#include "gimplify.h" |
| 39 |
#include "explow.h" |
| 40 |
#include "emit-rtl.h" |
| 41 |
#include "tree-vector-builder.h" |
| 42 |
#include "rtx-vector-builder.h" |
| 43 |
#include "riscv-vector-builtins.h" |
| 44 |
#include "riscv-vector-builtins-shapes.h" |
| 45 |
#include "riscv-vector-builtins-bases.h" |
| 46 |
|
| 47 |
using namespace riscv_vector; |
| 48 |
|
| 49 |
namespace riscv_vector { |
| 50 |
|
| 51 |
/* Enumerates types of loads/stores operations. |
| 52 |
It's only used in here so we don't define it |
| 53 |
in riscv-vector-builtins-bases.h. */ |
| 54 |
enum lst_type |
| 55 |
{ |
| 56 |
LST_UNIT_STRIDE, |
| 57 |
LST_STRIDED, |
| 58 |
LST_INDEXED, |
| 59 |
}; |
| 60 |
|
| 61 |
/* Implements vsetvl<mode> && vsetvlmax<mode>. */ |
| 62 |
template<bool VLMAX_P> |
| 63 |
class vsetvl : public function_base |
| 64 |
{ |
| 65 |
public: |
| 66 |
bool apply_vl_p () const override |
| 67 |
{ |
| 68 |
return false; |
| 69 |
} |
| 70 |
|
| 71 |
rtx expand (function_expander &e) const override |
| 72 |
{ |
| 73 |
if (VLMAX_P) |
| 74 |
e.add_input_operand (Pmode, gen_rtx_REG (Pmode, 0)); |
| 75 |
else |
| 76 |
e.add_input_operand (0); |
| 77 |
|
| 78 |
tree type = builtin_types[e.type.index].vector; |
| 79 |
machine_mode mode = TYPE_MODE (type); |
| 80 |
|
| 81 |
if (TARGET_XTHEADVECTOR) |
| 82 |
{ |
| 83 |
machine_mode inner_mode = GET_MODE_INNER (mode); |
| 84 |
/* SEW. */ |
| 85 |
e.add_input_operand (Pmode, |
| 86 |
gen_int_mode (GET_MODE_BITSIZE (inner_mode), Pmode)); |
| 87 |
/* LMUL. */ |
| 88 |
e.add_input_operand (Pmode, |
| 89 |
gen_int_mode (get_vlmul (mode), Pmode)); |
| 90 |
} |
| 91 |
else |
| 92 |
{ |
| 93 |
/* Normalize same RATO (SEW/LMUL) into same vsetvl instruction. |
| 94 |
|
| 95 |
- e8,mf8/e16,mf4/e32,mf2/e64,m1 --> e8mf8 |
| 96 |
- e8,mf4/e16,mf2/e32,m1/e64,m2 --> e8mf4 |
| 97 |
- e8,mf2/e16,m1/e32,m2/e64,m4 --> e8mf2 |
| 98 |
- e8,m1/e16,m2/e32,m4/e64,m8 --> e8m1 |
| 99 |
- e8,m2/e16,m4/e32,m8 --> e8m2 |
| 100 |
- e8,m4/e16,m8 --> e8m4 |
| 101 |
- e8,m8 --> e8m8 |
| 102 |
*/ |
| 103 |
/* SEW. */ |
| 104 |
e.add_input_operand (Pmode, gen_int_mode (8, Pmode)); |
| 105 |
|
| 106 |
/* LMUL. */ |
| 107 |
machine_mode e8_mode |
| 108 |
= get_vector_mode (QImode, GET_MODE_NUNITS (mode)).require (); |
| 109 |
e.add_input_operand (Pmode, gen_int_mode (get_vlmul (e8_mode), Pmode)); |
| 110 |
} |
| 111 |
|
| 112 |
/* TAIL_ANY. */ |
| 113 |
e.add_input_operand (Pmode, |
| 114 |
gen_int_mode (get_prefer_tail_policy (), Pmode)); |
| 115 |
|
| 116 |
/* MASK_ANY. */ |
| 117 |
e.add_input_operand (Pmode, |
| 118 |
gen_int_mode (get_prefer_mask_policy (), Pmode)); |
| 119 |
return e.generate_insn (code_for_vsetvl_no_side_effects (Pmode)); |
| 120 |
} |
| 121 |
}; |
| 122 |
|
| 123 |
/* Implements |
| 124 |
* vle.v/vse.v/vlm.v/vsm.v/vlse.v/vsse.v/vluxei.v/vloxei.v/vsuxei.v/vsoxei.v |
| 125 |
* codegen. */ |
| 126 |
template<bool STORE_P, lst_type LST_TYPE, bool ORDERED_P> |
| 127 |
class loadstore : public function_base |
| 128 |
{ |
| 129 |
public: |
| 130 |
bool apply_tail_policy_p () const override { return !STORE_P; } |
| 131 |
bool apply_mask_policy_p () const override { return !STORE_P; } |
| 132 |
|
| 133 |
unsigned int call_properties (const function_instance &) const override |
| 134 |
{ |
| 135 |
if (STORE_P) |
| 136 |
return CP_WRITE_MEMORY; |
| 137 |
else |
| 138 |
return CP_READ_MEMORY; |
| 139 |
} |
| 140 |
|
| 141 |
bool can_be_overloaded_p (enum predication_type_index pred) const override |
| 142 |
{ |
| 143 |
if (STORE_P || LST_TYPE == LST_INDEXED) |
| 144 |
return true; |
| 145 |
return pred != PRED_TYPE_none; |
| 146 |
} |
| 147 |
|
| 148 |
rtx expand (function_expander &e) const override |
| 149 |
{ |
| 150 |
if (LST_TYPE == LST_INDEXED) |
| 151 |
{ |
| 152 |
int unspec = ORDERED_P ? UNSPEC_ORDERED : UNSPEC_UNORDERED; |
| 153 |
if (STORE_P) |
| 154 |
return e.use_exact_insn ( |
| 155 |
code_for_pred_indexed_store (unspec, e.vector_mode (), |
| 156 |
e.index_mode ())); |
| 157 |
else |
| 158 |
{ |
| 159 |
unsigned src_eew_bitsize |
| 160 |
= GET_MODE_BITSIZE (GET_MODE_INNER (e.index_mode ())); |
| 161 |
unsigned dst_eew_bitsize |
| 162 |
= GET_MODE_BITSIZE (GET_MODE_INNER (e.vector_mode ())); |
| 163 |
if (dst_eew_bitsize == src_eew_bitsize) |
| 164 |
return e.use_exact_insn ( |
| 165 |
code_for_pred_indexed_load_same_eew (unspec, e.vector_mode ())); |
| 166 |
else if (dst_eew_bitsize > src_eew_bitsize) |
| 167 |
{ |
| 168 |
unsigned factor = dst_eew_bitsize / src_eew_bitsize; |
| 169 |
switch (factor) |
| 170 |
{ |
| 171 |
case 2: |
| 172 |
return e.use_exact_insn ( |
| 173 |
code_for_pred_indexed_load_x2_greater_eew ( |
| 174 |
unspec, e.vector_mode ())); |
| 175 |
case 4: |
| 176 |
return e.use_exact_insn ( |
| 177 |
code_for_pred_indexed_load_x4_greater_eew ( |
| 178 |
unspec, e.vector_mode ())); |
| 179 |
case 8: |
| 180 |
return e.use_exact_insn ( |
| 181 |
code_for_pred_indexed_load_x8_greater_eew ( |
| 182 |
unspec, e.vector_mode ())); |
| 183 |
default: |
| 184 |
gcc_unreachable (); |
| 185 |
} |
| 186 |
} |
| 187 |
else |
| 188 |
{ |
| 189 |
unsigned factor = src_eew_bitsize / dst_eew_bitsize; |
| 190 |
switch (factor) |
| 191 |
{ |
| 192 |
case 2: |
| 193 |
return e.use_exact_insn ( |
| 194 |
code_for_pred_indexed_load_x2_smaller_eew ( |
| 195 |
unspec, e.vector_mode ())); |
| 196 |
case 4: |
| 197 |
return e.use_exact_insn ( |
| 198 |
code_for_pred_indexed_load_x4_smaller_eew ( |
| 199 |
unspec, e.vector_mode ())); |
| 200 |
case 8: |
| 201 |
return e.use_exact_insn ( |
| 202 |
code_for_pred_indexed_load_x8_smaller_eew ( |
| 203 |
unspec, e.vector_mode ())); |
| 204 |
default: |
| 205 |
gcc_unreachable (); |
| 206 |
} |
| 207 |
} |
| 208 |
} |
| 209 |
} |
| 210 |
else if (LST_TYPE == LST_STRIDED) |
| 211 |
{ |
| 212 |
if (STORE_P) |
| 213 |
return e.use_contiguous_store_insn ( |
| 214 |
code_for_pred_strided_store (e.vector_mode ())); |
| 215 |
else |
| 216 |
return e.use_contiguous_load_insn ( |
| 217 |
code_for_pred_strided_load (e.vector_mode ())); |
| 218 |
} |
| 219 |
else |
| 220 |
{ |
| 221 |
if (STORE_P) |
| 222 |
return e.use_contiguous_store_insn ( |
| 223 |
code_for_pred_store (e.vector_mode ())); |
| 224 |
else |
| 225 |
return e.use_contiguous_load_insn ( |
| 226 |
code_for_pred_mov (e.vector_mode ())); |
| 227 |
} |
| 228 |
} |
| 229 |
}; |
| 230 |
|
| 231 |
/* Implements |
| 232 |
vadd/vsub/vand/vor/vxor/vsll/vsra/vsrl/ |
| 233 |
vmin/vmax/vminu/vmaxu/vdiv/vrem/vdivu/ |
| 234 |
vremu/vsadd/vsaddu/vssub/vssubu |
| 235 |
vfadd/vfsub/ |
| 236 |
*/ |
| 237 |
template <rtx_code CODE, bool MAY_REQUIRE_FRM = false, |
| 238 |
enum frm_op_type FRM_OP = NO_FRM> |
| 239 |
class binop : public function_base |
| 240 |
{ |
| 241 |
public: |
| 242 |
bool has_rounding_mode_operand_p () const override |
| 243 |
{ |
| 244 |
return FRM_OP == HAS_FRM; |
| 245 |
} |
| 246 |
|
| 247 |
bool may_require_frm_p () const override { return MAY_REQUIRE_FRM; } |
| 248 |
|
| 249 |
rtx expand (function_expander &e) const override |
| 250 |
{ |
| 251 |
switch (e.op_info->op) |
| 252 |
{ |
| 253 |
case OP_TYPE_vx: |
| 254 |
gcc_assert (FRM_OP == NO_FRM); |
| 255 |
case OP_TYPE_vf: |
| 256 |
return e.use_exact_insn (code_for_pred_scalar (CODE, e.vector_mode ())); |
| 257 |
case OP_TYPE_vv: |
| 258 |
return e.use_exact_insn (code_for_pred (CODE, e.vector_mode ())); |
| 259 |
default: |
| 260 |
gcc_unreachable (); |
| 261 |
} |
| 262 |
} |
| 263 |
}; |
| 264 |
|
| 265 |
/* Implements vrsub. */ |
| 266 |
class vrsub : public function_base |
| 267 |
{ |
| 268 |
public: |
| 269 |
rtx expand (function_expander &e) const override |
| 270 |
{ |
| 271 |
return e.use_exact_insn ( |
| 272 |
code_for_pred_sub_reverse_scalar (e.vector_mode ())); |
| 273 |
} |
| 274 |
}; |
| 275 |
|
| 276 |
/* Implements vneg/vnot. */ |
| 277 |
template<rtx_code CODE, enum frm_op_type FRM_OP = NO_FRM> |
| 278 |
class unop : public function_base |
| 279 |
{ |
| 280 |
public: |
| 281 |
bool has_rounding_mode_operand_p () const override |
| 282 |
{ |
| 283 |
return FRM_OP == HAS_FRM; |
| 284 |
} |
| 285 |
|
| 286 |
bool may_require_frm_p () const override { return true; } |
| 287 |
|
| 288 |
rtx expand (function_expander &e) const override |
| 289 |
{ |
| 290 |
return e.use_exact_insn (code_for_pred (CODE, e.vector_mode ())); |
| 291 |
} |
| 292 |
}; |
| 293 |
|
| 294 |
/* Implements vsext.vf2/vsext.vf4/vsext.vf8/vzext.vf2/vzext.vf4/vzext.vf8. */ |
| 295 |
template<rtx_code CODE> |
| 296 |
class ext : public function_base |
| 297 |
{ |
| 298 |
public: |
| 299 |
rtx expand (function_expander &e) const override |
| 300 |
{ |
| 301 |
switch (e.op_info->op) |
| 302 |
{ |
| 303 |
case OP_TYPE_vf2: |
| 304 |
return e.use_exact_insn (code_for_pred_vf2 (CODE, e.vector_mode ())); |
| 305 |
case OP_TYPE_vf4: |
| 306 |
return e.use_exact_insn (code_for_pred_vf4 (CODE, e.vector_mode ())); |
| 307 |
case OP_TYPE_vf8: |
| 308 |
return e.use_exact_insn (code_for_pred_vf8 (CODE, e.vector_mode ())); |
| 309 |
default: |
| 310 |
gcc_unreachable (); |
| 311 |
} |
| 312 |
} |
| 313 |
}; |
| 314 |
|
| 315 |
/* Implements vmulh/vmulhu/vmulhsu. */ |
| 316 |
template<int UNSPEC> |
| 317 |
class vmulh : public function_base |
| 318 |
{ |
| 319 |
public: |
| 320 |
rtx expand (function_expander &e) const override |
| 321 |
{ |
| 322 |
switch (e.op_info->op) |
| 323 |
{ |
| 324 |
case OP_TYPE_vx: |
| 325 |
return e.use_exact_insn ( |
| 326 |
code_for_pred_mulh_scalar (UNSPEC, e.vector_mode ())); |
| 327 |
case OP_TYPE_vv: |
| 328 |
return e.use_exact_insn ( |
| 329 |
code_for_pred_mulh (UNSPEC, e.vector_mode ())); |
| 330 |
default: |
| 331 |
gcc_unreachable (); |
| 332 |
} |
| 333 |
} |
| 334 |
}; |
| 335 |
|
| 336 |
/* Implements vwadd/vwsub/vwmul. */ |
| 337 |
template<rtx_code CODE1, rtx_code CODE2 = FLOAT_EXTEND> |
| 338 |
class widen_binop : public function_base |
| 339 |
{ |
| 340 |
public: |
| 341 |
rtx expand (function_expander &e) const override |
| 342 |
{ |
| 343 |
switch (e.op_info->op) |
| 344 |
{ |
| 345 |
case OP_TYPE_vv: |
| 346 |
return e.use_exact_insn ( |
| 347 |
code_for_pred_dual_widen (CODE1, CODE2, e.vector_mode ())); |
| 348 |
case OP_TYPE_vx: |
| 349 |
return e.use_exact_insn ( |
| 350 |
code_for_pred_dual_widen_scalar (CODE1, CODE2, e.vector_mode ())); |
| 351 |
case OP_TYPE_wv: |
| 352 |
if (CODE1 == PLUS) |
| 353 |
return e.use_exact_insn ( |
| 354 |
code_for_pred_single_widen_add (CODE2, e.vector_mode ())); |
| 355 |
else |
| 356 |
return e.use_exact_insn ( |
| 357 |
code_for_pred_single_widen_sub (CODE2, e.vector_mode ())); |
| 358 |
case OP_TYPE_wx: |
| 359 |
return e.use_exact_insn ( |
| 360 |
code_for_pred_single_widen_scalar (CODE1, CODE2, e.vector_mode ())); |
| 361 |
default: |
| 362 |
gcc_unreachable (); |
| 363 |
} |
| 364 |
} |
| 365 |
}; |
| 366 |
|
| 367 |
/* Implement vfwadd/vfwsub/vfwmul. */ |
| 368 |
template<rtx_code CODE, enum frm_op_type FRM_OP = NO_FRM> |
| 369 |
class widen_binop_fp : public function_base |
| 370 |
{ |
| 371 |
public: |
| 372 |
bool has_rounding_mode_operand_p () const override |
| 373 |
{ |
| 374 |
return FRM_OP == HAS_FRM; |
| 375 |
} |
| 376 |
|
| 377 |
bool may_require_frm_p () const override { return true; } |
| 378 |
|
| 379 |
rtx expand (function_expander &e) const override |
| 380 |
{ |
| 381 |
switch (e.op_info->op) |
| 382 |
{ |
| 383 |
case OP_TYPE_vv: |
| 384 |
return e.use_exact_insn ( |
| 385 |
code_for_pred_dual_widen (CODE, e.vector_mode ())); |
| 386 |
case OP_TYPE_vf: |
| 387 |
return e.use_exact_insn ( |
| 388 |
code_for_pred_dual_widen_scalar (CODE, e.vector_mode ())); |
| 389 |
case OP_TYPE_wv: |
| 390 |
if (CODE == PLUS) |
| 391 |
return e.use_exact_insn ( |
| 392 |
code_for_pred_single_widen_add (e.vector_mode ())); |
| 393 |
else |
| 394 |
return e.use_exact_insn ( |
| 395 |
code_for_pred_single_widen_sub (e.vector_mode ())); |
| 396 |
case OP_TYPE_wf: |
| 397 |
return e.use_exact_insn ( |
| 398 |
code_for_pred_single_widen_scalar (CODE, e.vector_mode ())); |
| 399 |
default: |
| 400 |
gcc_unreachable (); |
| 401 |
} |
| 402 |
} |
| 403 |
}; |
| 404 |
|
| 405 |
/* Implements vwmulsu. */ |
| 406 |
class vwmulsu : public function_base |
| 407 |
{ |
| 408 |
public: |
| 409 |
rtx expand (function_expander &e) const override |
| 410 |
{ |
| 411 |
switch (e.op_info->op) |
| 412 |
{ |
| 413 |
case OP_TYPE_vv: |
| 414 |
return e.use_exact_insn (code_for_pred_widen_mulsu (e.vector_mode ())); |
| 415 |
case OP_TYPE_vx: |
| 416 |
return e.use_exact_insn ( |
| 417 |
code_for_pred_widen_mulsu_scalar (e.vector_mode ())); |
| 418 |
default: |
| 419 |
gcc_unreachable (); |
| 420 |
} |
| 421 |
} |
| 422 |
}; |
| 423 |
|
| 424 |
/* Implements vwcvt. */ |
| 425 |
template<rtx_code CODE> |
| 426 |
class vwcvt : public function_base |
| 427 |
{ |
| 428 |
public: |
| 429 |
rtx expand (function_expander &e) const override |
| 430 |
{ |
| 431 |
return e.use_exact_insn (code_for_pred (CODE, e.vector_mode ())); |
| 432 |
} |
| 433 |
}; |
| 434 |
|
| 435 |
/* Implements vadc. */ |
| 436 |
class vadc : public function_base |
| 437 |
{ |
| 438 |
public: |
| 439 |
bool apply_mask_policy_p () const override { return false; } |
| 440 |
bool use_mask_predication_p () const override { return false; } |
| 441 |
|
| 442 |
rtx expand (function_expander &e) const override |
| 443 |
{ |
| 444 |
switch (e.op_info->op) |
| 445 |
{ |
| 446 |
case OP_TYPE_vvm: |
| 447 |
return e.use_exact_insn (code_for_pred_adc (e.vector_mode ())); |
| 448 |
case OP_TYPE_vxm: |
| 449 |
return e.use_exact_insn (code_for_pred_adc_scalar (e.vector_mode ())); |
| 450 |
default: |
| 451 |
gcc_unreachable (); |
| 452 |
} |
| 453 |
} |
| 454 |
}; |
| 455 |
|
| 456 |
/* Implements vsbc. */ |
| 457 |
class vsbc : public function_base |
| 458 |
{ |
| 459 |
public: |
| 460 |
bool apply_mask_policy_p () const override { return false; } |
| 461 |
bool use_mask_predication_p () const override { return false; } |
| 462 |
|
| 463 |
rtx expand (function_expander &e) const override |
| 464 |
{ |
| 465 |
switch (e.op_info->op) |
| 466 |
{ |
| 467 |
case OP_TYPE_vvm: |
| 468 |
return e.use_exact_insn (code_for_pred_sbc (e.vector_mode ())); |
| 469 |
case OP_TYPE_vxm: |
| 470 |
return e.use_exact_insn (code_for_pred_sbc_scalar (e.vector_mode ())); |
| 471 |
default: |
| 472 |
gcc_unreachable (); |
| 473 |
} |
| 474 |
} |
| 475 |
}; |
| 476 |
|
| 477 |
/* Implements vmadc. */ |
| 478 |
class vmadc : public function_base |
| 479 |
{ |
| 480 |
public: |
| 481 |
bool apply_tail_policy_p () const override { return false; } |
| 482 |
bool apply_mask_policy_p () const override { return false; } |
| 483 |
bool use_mask_predication_p () const override { return false; } |
| 484 |
bool has_merge_operand_p () const override { return false; } |
| 485 |
|
| 486 |
rtx expand (function_expander &e) const override |
| 487 |
{ |
| 488 |
switch (e.op_info->op) |
| 489 |
{ |
| 490 |
case OP_TYPE_vvm: |
| 491 |
return e.use_exact_insn (code_for_pred_madc (e.vector_mode ())); |
| 492 |
case OP_TYPE_vxm: |
| 493 |
return e.use_exact_insn (code_for_pred_madc_scalar (e.vector_mode ())); |
| 494 |
case OP_TYPE_vv: |
| 495 |
return e.use_exact_insn ( |
| 496 |
code_for_pred_madc_overflow (e.vector_mode ())); |
| 497 |
case OP_TYPE_vx: |
| 498 |
return e.use_exact_insn ( |
| 499 |
code_for_pred_madc_overflow_scalar (e.vector_mode ())); |
| 500 |
default: |
| 501 |
gcc_unreachable (); |
| 502 |
} |
| 503 |
} |
| 504 |
}; |
| 505 |
|
| 506 |
/* Implements vmsbc. */ |
| 507 |
class vmsbc : public function_base |
| 508 |
{ |
| 509 |
public: |
| 510 |
bool apply_tail_policy_p () const override { return false; } |
| 511 |
bool apply_mask_policy_p () const override { return false; } |
| 512 |
bool use_mask_predication_p () const override { return false; } |
| 513 |
bool has_merge_operand_p () const override { return false; } |
| 514 |
|
| 515 |
rtx expand (function_expander &e) const override |
| 516 |
{ |
| 517 |
switch (e.op_info->op) |
| 518 |
{ |
| 519 |
case OP_TYPE_vvm: |
| 520 |
return e.use_exact_insn (code_for_pred_msbc (e.vector_mode ())); |
| 521 |
case OP_TYPE_vxm: |
| 522 |
return e.use_exact_insn (code_for_pred_msbc_scalar (e.vector_mode ())); |
| 523 |
case OP_TYPE_vv: |
| 524 |
return e.use_exact_insn ( |
| 525 |
code_for_pred_msbc_overflow (e.vector_mode ())); |
| 526 |
case OP_TYPE_vx: |
| 527 |
return e.use_exact_insn ( |
| 528 |
code_for_pred_msbc_overflow_scalar (e.vector_mode ())); |
| 529 |
default: |
| 530 |
gcc_unreachable (); |
| 531 |
} |
| 532 |
} |
| 533 |
}; |
| 534 |
|
| 535 |
/* Implements vnsrl/vnsra. */ |
| 536 |
template<rtx_code CODE> |
| 537 |
class vnshift : public function_base |
| 538 |
{ |
| 539 |
public: |
| 540 |
rtx expand (function_expander &e) const override |
| 541 |
{ |
| 542 |
switch (e.op_info->op) |
| 543 |
{ |
| 544 |
case OP_TYPE_wx: |
| 545 |
return e.use_exact_insn ( |
| 546 |
code_for_pred_narrow_scalar (CODE, e.vector_mode ())); |
| 547 |
case OP_TYPE_wv: |
| 548 |
return e.use_exact_insn (code_for_pred_narrow (CODE, e.vector_mode ())); |
| 549 |
default: |
| 550 |
gcc_unreachable (); |
| 551 |
} |
| 552 |
} |
| 553 |
}; |
| 554 |
|
| 555 |
/* Implements vncvt. */ |
| 556 |
class vncvt_x : public function_base |
| 557 |
{ |
| 558 |
public: |
| 559 |
rtx expand (function_expander &e) const override |
| 560 |
{ |
| 561 |
return e.use_exact_insn (code_for_pred_trunc (e.vector_mode ())); |
| 562 |
} |
| 563 |
}; |
| 564 |
|
| 565 |
/* Implements vmerge/vfmerge. */ |
| 566 |
class vmerge : public function_base |
| 567 |
{ |
| 568 |
public: |
| 569 |
bool apply_mask_policy_p () const override { return false; } |
| 570 |
bool use_mask_predication_p () const override { return false; } |
| 571 |
rtx expand (function_expander &e) const override |
| 572 |
{ |
| 573 |
switch (e.op_info->op) |
| 574 |
{ |
| 575 |
case OP_TYPE_vvm: |
| 576 |
return e.use_exact_insn (code_for_pred_merge (e.vector_mode ())); |
| 577 |
case OP_TYPE_vxm: |
| 578 |
case OP_TYPE_vfm: |
| 579 |
return e.use_exact_insn (code_for_pred_merge_scalar (e.vector_mode ())); |
| 580 |
default: |
| 581 |
gcc_unreachable (); |
| 582 |
} |
| 583 |
} |
| 584 |
}; |
| 585 |
|
| 586 |
/* Implements vmv.v.x/vmv.v.v/vfmv.v.f. */ |
| 587 |
class vmv_v : public function_base |
| 588 |
{ |
| 589 |
public: |
| 590 |
rtx expand (function_expander &e) const override |
| 591 |
{ |
| 592 |
switch (e.op_info->op) |
| 593 |
{ |
| 594 |
case OP_TYPE_v: |
| 595 |
return e.use_exact_insn (code_for_pred_mov (e.vector_mode ())); |
| 596 |
case OP_TYPE_x: |
| 597 |
case OP_TYPE_f: |
| 598 |
return e.use_exact_insn (code_for_pred_broadcast (e.vector_mode ())); |
| 599 |
default: |
| 600 |
gcc_unreachable (); |
| 601 |
} |
| 602 |
} |
| 603 |
}; |
| 604 |
|
| 605 |
/* Implements vaadd/vasub/vsmul/vssra/vssrl. */ |
| 606 |
template<int UNSPEC> |
| 607 |
class sat_op : public function_base |
| 608 |
{ |
| 609 |
public: |
| 610 |
bool has_rounding_mode_operand_p () const override { return true; } |
| 611 |
|
| 612 |
bool may_require_vxrm_p () const override { return true; } |
| 613 |
|
| 614 |
rtx expand (function_expander &e) const override |
| 615 |
{ |
| 616 |
switch (e.op_info->op) |
| 617 |
{ |
| 618 |
case OP_TYPE_vx: |
| 619 |
return e.use_exact_insn ( |
| 620 |
code_for_pred_scalar (UNSPEC, e.vector_mode ())); |
| 621 |
case OP_TYPE_vv: |
| 622 |
return e.use_exact_insn (code_for_pred (UNSPEC, e.vector_mode ())); |
| 623 |
default: |
| 624 |
gcc_unreachable (); |
| 625 |
} |
| 626 |
} |
| 627 |
}; |
| 628 |
|
| 629 |
/* Implements vnclip/vnclipu. */ |
| 630 |
template<int UNSPEC> |
| 631 |
class vnclip : public function_base |
| 632 |
{ |
| 633 |
public: |
| 634 |
bool has_rounding_mode_operand_p () const override { return true; } |
| 635 |
|
| 636 |
bool may_require_vxrm_p () const override { return true; } |
| 637 |
|
| 638 |
rtx expand (function_expander &e) const override |
| 639 |
{ |
| 640 |
switch (e.op_info->op) |
| 641 |
{ |
| 642 |
case OP_TYPE_wx: |
| 643 |
return e.use_exact_insn ( |
| 644 |
code_for_pred_narrow_clip_scalar (UNSPEC, e.vector_mode ())); |
| 645 |
case OP_TYPE_wv: |
| 646 |
return e.use_exact_insn ( |
| 647 |
code_for_pred_narrow_clip (UNSPEC, e.vector_mode ())); |
| 648 |
default: |
| 649 |
gcc_unreachable (); |
| 650 |
} |
| 651 |
} |
| 652 |
}; |
| 653 |
|
| 654 |
/* Implements vmseq/vmsne/vmslt/vmsgt/vmsle/vmsge. */ |
| 655 |
template<rtx_code CODE> |
| 656 |
class icmp : public function_base |
| 657 |
{ |
| 658 |
public: |
| 659 |
rtx expand (function_expander &e) const override |
| 660 |
{ |
| 661 |
switch (e.op_info->op) |
| 662 |
{ |
| 663 |
case OP_TYPE_vx: { |
| 664 |
if (CODE == GE || CODE == GEU) |
| 665 |
return e.use_compare_insn (CODE, code_for_pred_ge_scalar ( |
| 666 |
e.vector_mode ())); |
| 667 |
else |
| 668 |
return e.use_compare_insn (CODE, code_for_pred_cmp_scalar ( |
| 669 |
e.vector_mode ())); |
| 670 |
} |
| 671 |
case OP_TYPE_vv: { |
| 672 |
if (CODE == LT || CODE == LTU || CODE == GE || CODE == GEU) |
| 673 |
return e.use_compare_insn (CODE, |
| 674 |
code_for_pred_ltge (e.vector_mode ())); |
| 675 |
else |
| 676 |
return e.use_compare_insn (CODE, |
| 677 |
code_for_pred_cmp (e.vector_mode ())); |
| 678 |
} |
| 679 |
default: |
| 680 |
gcc_unreachable (); |
| 681 |
} |
| 682 |
} |
| 683 |
}; |
| 684 |
|
| 685 |
/* Implements vmacc/vnmsac/vmadd/vnmsub. */ |
| 686 |
class vmacc : public function_base |
| 687 |
{ |
| 688 |
public: |
| 689 |
bool has_merge_operand_p () const override { return false; } |
| 690 |
|
| 691 |
rtx expand (function_expander &e) const override |
| 692 |
{ |
| 693 |
if (e.op_info->op == OP_TYPE_vx) |
| 694 |
return e.use_ternop_insn (true, code_for_pred_mul_plus_scalar ( |
| 695 |
e.vector_mode ())); |
| 696 |
if (e.op_info->op == OP_TYPE_vv) |
| 697 |
return e.use_ternop_insn (true, |
| 698 |
code_for_pred_mul_plus (e.vector_mode ())); |
| 699 |
gcc_unreachable (); |
| 700 |
} |
| 701 |
}; |
| 702 |
|
| 703 |
class vnmsac : public function_base |
| 704 |
{ |
| 705 |
public: |
| 706 |
bool has_merge_operand_p () const override { return false; } |
| 707 |
|
| 708 |
rtx expand (function_expander &e) const override |
| 709 |
{ |
| 710 |
if (e.op_info->op == OP_TYPE_vx) |
| 711 |
return e.use_ternop_insn (true, code_for_pred_minus_mul_scalar ( |
| 712 |
e.vector_mode ())); |
| 713 |
if (e.op_info->op == OP_TYPE_vv) |
| 714 |
return e.use_ternop_insn (true, |
| 715 |
code_for_pred_minus_mul (e.vector_mode ())); |
| 716 |
gcc_unreachable (); |
| 717 |
} |
| 718 |
}; |
| 719 |
|
| 720 |
class vmadd : public function_base |
| 721 |
{ |
| 722 |
public: |
| 723 |
bool has_merge_operand_p () const override { return false; } |
| 724 |
|
| 725 |
rtx expand (function_expander &e) const override |
| 726 |
{ |
| 727 |
if (e.op_info->op == OP_TYPE_vx) |
| 728 |
return e.use_ternop_insn (false, code_for_pred_mul_plus_scalar ( |
| 729 |
e.vector_mode ())); |
| 730 |
if (e.op_info->op == OP_TYPE_vv) |
| 731 |
return e.use_ternop_insn (false, |
| 732 |
code_for_pred_mul_plus (e.vector_mode ())); |
| 733 |
gcc_unreachable (); |
| 734 |
} |
| 735 |
}; |
| 736 |
|
| 737 |
class vnmsub : public function_base |
| 738 |
{ |
| 739 |
public: |
| 740 |
bool has_merge_operand_p () const override { return false; } |
| 741 |
|
| 742 |
rtx expand (function_expander &e) const override |
| 743 |
{ |
| 744 |
if (e.op_info->op == OP_TYPE_vx) |
| 745 |
return e.use_ternop_insn (false, code_for_pred_minus_mul_scalar ( |
| 746 |
e.vector_mode ())); |
| 747 |
if (e.op_info->op == OP_TYPE_vv) |
| 748 |
return e.use_ternop_insn (false, |
| 749 |
code_for_pred_minus_mul (e.vector_mode ())); |
| 750 |
gcc_unreachable (); |
| 751 |
} |
| 752 |
}; |
| 753 |
|
| 754 |
/* Implements vwmacc<su><su>. */ |
| 755 |
class vwmacc : public function_base |
| 756 |
{ |
| 757 |
public: |
| 758 |
bool has_merge_operand_p () const override { return false; } |
| 759 |
|
| 760 |
rtx expand (function_expander &e) const override |
| 761 |
{ |
| 762 |
if (e.op_info->op == OP_TYPE_vx) |
| 763 |
return e.use_widen_ternop_insn ( |
| 764 |
code_for_pred_widen_mul_plus_scalar (SIGN_EXTEND, e.vector_mode ())); |
| 765 |
if (e.op_info->op == OP_TYPE_vv) |
| 766 |
return e.use_widen_ternop_insn ( |
| 767 |
code_for_pred_widen_mul_plus (SIGN_EXTEND, e.vector_mode ())); |
| 768 |
gcc_unreachable (); |
| 769 |
} |
| 770 |
}; |
| 771 |
|
| 772 |
class vwmaccu : public function_base |
| 773 |
{ |
| 774 |
public: |
| 775 |
bool has_merge_operand_p () const override { return false; } |
| 776 |
|
| 777 |
rtx expand (function_expander &e) const override |
| 778 |
{ |
| 779 |
if (e.op_info->op == OP_TYPE_vx) |
| 780 |
return e.use_widen_ternop_insn ( |
| 781 |
code_for_pred_widen_mul_plus_scalar (ZERO_EXTEND, e.vector_mode ())); |
| 782 |
if (e.op_info->op == OP_TYPE_vv) |
| 783 |
return e.use_widen_ternop_insn ( |
| 784 |
code_for_pred_widen_mul_plus (ZERO_EXTEND, e.vector_mode ())); |
| 785 |
gcc_unreachable (); |
| 786 |
} |
| 787 |
}; |
| 788 |
|
| 789 |
class vwmaccsu : public function_base |
| 790 |
{ |
| 791 |
public: |
| 792 |
bool has_merge_operand_p () const override { return false; } |
| 793 |
|
| 794 |
rtx expand (function_expander &e) const override |
| 795 |
{ |
| 796 |
if (e.op_info->op == OP_TYPE_vx) |
| 797 |
return e.use_widen_ternop_insn ( |
| 798 |
code_for_pred_widen_mul_plussu_scalar (e.vector_mode ())); |
| 799 |
if (e.op_info->op == OP_TYPE_vv) |
| 800 |
return e.use_widen_ternop_insn ( |
| 801 |
code_for_pred_widen_mul_plussu (e.vector_mode ())); |
| 802 |
gcc_unreachable (); |
| 803 |
} |
| 804 |
}; |
| 805 |
|
| 806 |
class vwmaccus : public function_base |
| 807 |
{ |
| 808 |
public: |
| 809 |
bool has_merge_operand_p () const override { return false; } |
| 810 |
|
| 811 |
rtx expand (function_expander &e) const override |
| 812 |
{ |
| 813 |
return e.use_widen_ternop_insn ( |
| 814 |
code_for_pred_widen_mul_plusus_scalar (e.vector_mode ())); |
| 815 |
} |
| 816 |
}; |
| 817 |
|
| 818 |
/* Implements vmand/vmnand/vmandn/vmxor/vmor/vmnor/vmorn/vmxnor */ |
| 819 |
template<rtx_code CODE> |
| 820 |
class mask_logic : public function_base |
| 821 |
{ |
| 822 |
public: |
| 823 |
bool apply_tail_policy_p () const override { return false; } |
| 824 |
bool apply_mask_policy_p () const override { return false; } |
| 825 |
|
| 826 |
rtx expand (function_expander &e) const override |
| 827 |
{ |
| 828 |
return e.use_exact_insn (code_for_pred (CODE, e.vector_mode ())); |
| 829 |
} |
| 830 |
}; |
| 831 |
template<rtx_code CODE> |
| 832 |
class mask_nlogic : public function_base |
| 833 |
{ |
| 834 |
public: |
| 835 |
bool apply_tail_policy_p () const override { return false; } |
| 836 |
bool apply_mask_policy_p () const override { return false; } |
| 837 |
|
| 838 |
rtx expand (function_expander &e) const override |
| 839 |
{ |
| 840 |
return e.use_exact_insn (code_for_pred_n (CODE, e.vector_mode ())); |
| 841 |
} |
| 842 |
}; |
| 843 |
template<rtx_code CODE> |
| 844 |
class mask_notlogic : public function_base |
| 845 |
{ |
| 846 |
public: |
| 847 |
bool apply_tail_policy_p () const override { return false; } |
| 848 |
bool apply_mask_policy_p () const override { return false; } |
| 849 |
|
| 850 |
rtx expand (function_expander &e) const override |
| 851 |
{ |
| 852 |
return e.use_exact_insn (code_for_pred_not (CODE, e.vector_mode ())); |
| 853 |
} |
| 854 |
}; |
| 855 |
|
| 856 |
/* Implements vmmv. */ |
| 857 |
class vmmv : public function_base |
| 858 |
{ |
| 859 |
public: |
| 860 |
bool apply_tail_policy_p () const override { return false; } |
| 861 |
bool apply_mask_policy_p () const override { return false; } |
| 862 |
|
| 863 |
rtx expand (function_expander &e) const override |
| 864 |
{ |
| 865 |
return e.use_exact_insn (code_for_pred_mov (e.vector_mode ())); |
| 866 |
} |
| 867 |
}; |
| 868 |
|
| 869 |
/* Implements vmclr. */ |
| 870 |
class vmclr : public function_base |
| 871 |
{ |
| 872 |
public: |
| 873 |
bool can_be_overloaded_p (enum predication_type_index) const override |
| 874 |
{ |
| 875 |
return false; |
| 876 |
} |
| 877 |
|
| 878 |
rtx expand (function_expander &e) const override |
| 879 |
{ |
| 880 |
machine_mode mode = TYPE_MODE (TREE_TYPE (e.exp)); |
| 881 |
e.add_all_one_mask_operand (mode); |
| 882 |
e.add_vundef_operand (mode); |
| 883 |
e.add_input_operand (mode, CONST0_RTX (mode)); |
| 884 |
e.add_input_operand (call_expr_nargs (e.exp) - 1); |
| 885 |
e.add_input_operand (Pmode, get_avl_type_rtx (avl_type::NONVLMAX)); |
| 886 |
return e.generate_insn (code_for_pred_mov (e.vector_mode ())); |
| 887 |
} |
| 888 |
}; |
| 889 |
|
| 890 |
/* Implements vmset. */ |
| 891 |
class vmset : public function_base |
| 892 |
{ |
| 893 |
public: |
| 894 |
bool can_be_overloaded_p (enum predication_type_index) const override |
| 895 |
{ |
| 896 |
return false; |
| 897 |
} |
| 898 |
|
| 899 |
rtx expand (function_expander &e) const override |
| 900 |
{ |
| 901 |
machine_mode mode = TYPE_MODE (TREE_TYPE (e.exp)); |
| 902 |
e.add_all_one_mask_operand (mode); |
| 903 |
e.add_vundef_operand (mode); |
| 904 |
e.add_input_operand (mode, CONSTM1_RTX (mode)); |
| 905 |
e.add_input_operand (call_expr_nargs (e.exp) - 1); |
| 906 |
e.add_input_operand (Pmode, get_avl_type_rtx (avl_type::NONVLMAX)); |
| 907 |
return e.generate_insn (code_for_pred_mov (e.vector_mode ())); |
| 908 |
} |
| 909 |
}; |
| 910 |
|
| 911 |
/* Implements vmnot. */ |
| 912 |
class vmnot : public function_base |
| 913 |
{ |
| 914 |
public: |
| 915 |
bool apply_tail_policy_p () const override { return false; } |
| 916 |
bool apply_mask_policy_p () const override { return false; } |
| 917 |
|
| 918 |
rtx expand (function_expander &e) const override |
| 919 |
{ |
| 920 |
return e.use_exact_insn (code_for_pred_not (e.vector_mode ())); |
| 921 |
} |
| 922 |
}; |
| 923 |
|
| 924 |
/* Implements vcpop. */ |
| 925 |
class vcpop : public function_base |
| 926 |
{ |
| 927 |
public: |
| 928 |
bool apply_tail_policy_p () const override { return false; } |
| 929 |
bool apply_mask_policy_p () const override { return false; } |
| 930 |
bool has_merge_operand_p () const override { return false; } |
| 931 |
|
| 932 |
rtx expand (function_expander &e) const override |
| 933 |
{ |
| 934 |
return e.use_exact_insn (code_for_pred_popcount (e.vector_mode (), Pmode)); |
| 935 |
} |
| 936 |
}; |
| 937 |
|
| 938 |
/* Implements vfirst. */ |
| 939 |
class vfirst : public function_base |
| 940 |
{ |
| 941 |
public: |
| 942 |
bool apply_tail_policy_p () const override { return false; } |
| 943 |
bool apply_mask_policy_p () const override { return false; } |
| 944 |
bool has_merge_operand_p () const override { return false; } |
| 945 |
|
| 946 |
rtx expand (function_expander &e) const override |
| 947 |
{ |
| 948 |
return e.use_exact_insn (code_for_pred_ffs (e.vector_mode (), Pmode)); |
| 949 |
} |
| 950 |
}; |
| 951 |
|
| 952 |
/* Implements vmsbf/vmsif/vmsof. */ |
| 953 |
template<int UNSPEC> |
| 954 |
class mask_misc : public function_base |
| 955 |
{ |
| 956 |
public: |
| 957 |
bool apply_tail_policy_p () const override { return false; } |
| 958 |
|
| 959 |
rtx expand (function_expander &e) const override |
| 960 |
{ |
| 961 |
return e.use_exact_insn (code_for_pred (UNSPEC, e.vector_mode ())); |
| 962 |
} |
| 963 |
}; |
| 964 |
|
| 965 |
/* Implements viota. */ |
| 966 |
class viota : public function_base |
| 967 |
{ |
| 968 |
public: |
| 969 |
bool can_be_overloaded_p (enum predication_type_index pred) const override |
| 970 |
{ |
| 971 |
return pred == PRED_TYPE_tu || pred == PRED_TYPE_tum |
| 972 |
|| pred == PRED_TYPE_tumu || pred == PRED_TYPE_mu; |
| 973 |
} |
| 974 |
|
| 975 |
rtx expand (function_expander &e) const override |
| 976 |
{ |
| 977 |
return e.use_exact_insn (code_for_pred_iota (e.vector_mode ())); |
| 978 |
} |
| 979 |
}; |
| 980 |
|
| 981 |
/* Implements vid. */ |
| 982 |
class vid : public function_base |
| 983 |
{ |
| 984 |
public: |
| 985 |
bool can_be_overloaded_p (enum predication_type_index pred) const override |
| 986 |
{ |
| 987 |
return pred == PRED_TYPE_tu || pred == PRED_TYPE_tum |
| 988 |
|| pred == PRED_TYPE_tumu || pred == PRED_TYPE_mu; |
| 989 |
} |
| 990 |
|
| 991 |
rtx expand (function_expander &e) const override |
| 992 |
{ |
| 993 |
return e.use_exact_insn (code_for_pred_series (e.vector_mode ())); |
| 994 |
} |
| 995 |
}; |
| 996 |
|
| 997 |
/* Implements vfrsub/vfrdiv. */ |
| 998 |
template<rtx_code CODE, enum frm_op_type FRM_OP = NO_FRM> |
| 999 |
class reverse_binop : public function_base |
| 1000 |
{ |
| 1001 |
public: |
| 1002 |
bool has_rounding_mode_operand_p () const override |
| 1003 |
{ |
| 1004 |
return FRM_OP == HAS_FRM; |
| 1005 |
} |
| 1006 |
|
| 1007 |
bool may_require_frm_p () const override { return true; } |
| 1008 |
|
| 1009 |
rtx expand (function_expander &e) const override |
| 1010 |
{ |
| 1011 |
return e.use_exact_insn ( |
| 1012 |
code_for_pred_reverse_scalar (CODE, e.vector_mode ())); |
| 1013 |
} |
| 1014 |
}; |
| 1015 |
|
| 1016 |
template<enum frm_op_type FRM_OP = NO_FRM> |
| 1017 |
class vfmacc : public function_base |
| 1018 |
{ |
| 1019 |
public: |
| 1020 |
bool has_rounding_mode_operand_p () const override |
| 1021 |
{ |
| 1022 |
return FRM_OP == HAS_FRM; |
| 1023 |
} |
| 1024 |
|
| 1025 |
bool may_require_frm_p () const override { return true; } |
| 1026 |
|
| 1027 |
bool has_merge_operand_p () const override { return false; } |
| 1028 |
|
| 1029 |
rtx expand (function_expander &e) const override |
| 1030 |
{ |
| 1031 |
if (e.op_info->op == OP_TYPE_vf) |
| 1032 |
return e.use_ternop_insn (true, |
| 1033 |
code_for_pred_mul_scalar (PLUS, |
| 1034 |
e.vector_mode ())); |
| 1035 |
if (e.op_info->op == OP_TYPE_vv) |
| 1036 |
return e.use_ternop_insn (true, |
| 1037 |
code_for_pred_mul (PLUS, e.vector_mode ())); |
| 1038 |
gcc_unreachable (); |
| 1039 |
} |
| 1040 |
}; |
| 1041 |
|
| 1042 |
template<enum frm_op_type FRM_OP = NO_FRM> |
| 1043 |
class vfnmsac : public function_base |
| 1044 |
{ |
| 1045 |
public: |
| 1046 |
bool has_rounding_mode_operand_p () const override |
| 1047 |
{ |
| 1048 |
return FRM_OP == HAS_FRM; |
| 1049 |
} |
| 1050 |
|
| 1051 |
bool may_require_frm_p () const override { return true; } |
| 1052 |
|
| 1053 |
bool has_merge_operand_p () const override { return false; } |
| 1054 |
|
| 1055 |
rtx expand (function_expander &e) const override |
| 1056 |
{ |
| 1057 |
if (e.op_info->op == OP_TYPE_vf) |
| 1058 |
return e.use_ternop_insn ( |
| 1059 |
true, code_for_pred_mul_neg_scalar (PLUS, e.vector_mode ())); |
| 1060 |
if (e.op_info->op == OP_TYPE_vv) |
| 1061 |
return e.use_ternop_insn (true, |
| 1062 |
code_for_pred_mul_neg (PLUS, e.vector_mode ())); |
| 1063 |
gcc_unreachable (); |
| 1064 |
} |
| 1065 |
}; |
| 1066 |
|
| 1067 |
template<enum frm_op_type FRM_OP = NO_FRM> |
| 1068 |
class vfmadd : public function_base |
| 1069 |
{ |
| 1070 |
public: |
| 1071 |
bool has_rounding_mode_operand_p () const override |
| 1072 |
{ |
| 1073 |
return FRM_OP == HAS_FRM; |
| 1074 |
} |
| 1075 |
|
| 1076 |
bool may_require_frm_p () const override { return true; } |
| 1077 |
|
| 1078 |
bool has_merge_operand_p () const override { return false; } |
| 1079 |
|
| 1080 |
rtx expand (function_expander &e) const override |
| 1081 |
{ |
| 1082 |
if (e.op_info->op == OP_TYPE_vf) |
| 1083 |
return e.use_ternop_insn (false, |
| 1084 |
code_for_pred_mul_scalar (PLUS, |
| 1085 |
e.vector_mode ())); |
| 1086 |
if (e.op_info->op == OP_TYPE_vv) |
| 1087 |
return e.use_ternop_insn (false, |
| 1088 |
code_for_pred_mul (PLUS, e.vector_mode ())); |
| 1089 |
gcc_unreachable (); |
| 1090 |
} |
| 1091 |
}; |
| 1092 |
|
| 1093 |
template<enum frm_op_type FRM_OP = NO_FRM> |
| 1094 |
class vfnmsub : public function_base |
| 1095 |
{ |
| 1096 |
public: |
| 1097 |
bool has_rounding_mode_operand_p () const override |
| 1098 |
{ |
| 1099 |
return FRM_OP == HAS_FRM; |
| 1100 |
} |
| 1101 |
|
| 1102 |
bool may_require_frm_p () const override { return true; } |
| 1103 |
|
| 1104 |
bool has_merge_operand_p () const override { return false; } |
| 1105 |
|
| 1106 |
rtx expand (function_expander &e) const override |
| 1107 |
{ |
| 1108 |
if (e.op_info->op == OP_TYPE_vf) |
| 1109 |
return e.use_ternop_insn ( |
| 1110 |
false, code_for_pred_mul_neg_scalar (PLUS, e.vector_mode ())); |
| 1111 |
if (e.op_info->op == OP_TYPE_vv) |
| 1112 |
return e.use_ternop_insn (false, |
| 1113 |
code_for_pred_mul_neg (PLUS, e.vector_mode ())); |
| 1114 |
gcc_unreachable (); |
| 1115 |
} |
| 1116 |
}; |
| 1117 |
|
| 1118 |
template<enum frm_op_type FRM_OP = NO_FRM> |
| 1119 |
class vfnmacc : public function_base |
| 1120 |
{ |
| 1121 |
public: |
| 1122 |
bool has_rounding_mode_operand_p () const override |
| 1123 |
{ |
| 1124 |
return FRM_OP == HAS_FRM; |
| 1125 |
} |
| 1126 |
|
| 1127 |
bool may_require_frm_p () const override { return true; } |
| 1128 |
|
| 1129 |
bool has_merge_operand_p () const override { return false; } |
| 1130 |
|
| 1131 |
rtx expand (function_expander &e) const override |
| 1132 |
{ |
| 1133 |
if (e.op_info->op == OP_TYPE_vf) |
| 1134 |
return e.use_ternop_insn ( |
| 1135 |
true, code_for_pred_mul_neg_scalar (MINUS, e.vector_mode ())); |
| 1136 |
if (e.op_info->op == OP_TYPE_vv) |
| 1137 |
return e.use_ternop_insn (true, |
| 1138 |
code_for_pred_mul_neg (MINUS, e.vector_mode ())); |
| 1139 |
gcc_unreachable (); |
| 1140 |
} |
| 1141 |
}; |
| 1142 |
|
| 1143 |
template<enum frm_op_type FRM_OP = NO_FRM> |
| 1144 |
class vfmsac : public function_base |
| 1145 |
{ |
| 1146 |
public: |
| 1147 |
bool has_rounding_mode_operand_p () const override |
| 1148 |
{ |
| 1149 |
return FRM_OP == HAS_FRM; |
| 1150 |
} |
| 1151 |
|
| 1152 |
bool may_require_frm_p () const override { return true; } |
| 1153 |
|
| 1154 |
bool has_merge_operand_p () const override { return false; } |
| 1155 |
|
| 1156 |
rtx expand (function_expander &e) const override |
| 1157 |
{ |
| 1158 |
if (e.op_info->op == OP_TYPE_vf) |
| 1159 |
return e.use_ternop_insn (true, |
| 1160 |
code_for_pred_mul_scalar (MINUS, |
| 1161 |
e.vector_mode ())); |
| 1162 |
if (e.op_info->op == OP_TYPE_vv) |
| 1163 |
return e.use_ternop_insn (true, |
| 1164 |
code_for_pred_mul (MINUS, e.vector_mode ())); |
| 1165 |
gcc_unreachable (); |
| 1166 |
} |
| 1167 |
}; |
| 1168 |
|
| 1169 |
template<enum frm_op_type FRM_OP = NO_FRM> |
| 1170 |
class vfnmadd : public function_base |
| 1171 |
{ |
| 1172 |
public: |
| 1173 |
bool has_rounding_mode_operand_p () const override |
| 1174 |
{ |
| 1175 |
return FRM_OP == HAS_FRM; |
| 1176 |
} |
| 1177 |
|
| 1178 |
bool may_require_frm_p () const override { return true; } |
| 1179 |
|
| 1180 |
bool has_merge_operand_p () const override { return false; } |
| 1181 |
|
| 1182 |
rtx expand (function_expander &e) const override |
| 1183 |
{ |
| 1184 |
if (e.op_info->op == OP_TYPE_vf) |
| 1185 |
return e.use_ternop_insn ( |
| 1186 |
false, code_for_pred_mul_neg_scalar (MINUS, e.vector_mode ())); |
| 1187 |
if (e.op_info->op == OP_TYPE_vv) |
| 1188 |
return e.use_ternop_insn (false, |
| 1189 |
code_for_pred_mul_neg (MINUS, e.vector_mode ())); |
| 1190 |
gcc_unreachable (); |
| 1191 |
} |
| 1192 |
}; |
| 1193 |
|
| 1194 |
template<enum frm_op_type FRM_OP = NO_FRM> |
| 1195 |
class vfmsub : public function_base |
| 1196 |
{ |
| 1197 |
public: |
| 1198 |
bool has_rounding_mode_operand_p () const override |
| 1199 |
{ |
| 1200 |
return FRM_OP == HAS_FRM; |
| 1201 |
} |
| 1202 |
|
| 1203 |
bool may_require_frm_p () const override { return true; } |
| 1204 |
|
| 1205 |
bool has_merge_operand_p () const override { return false; } |
| 1206 |
|
| 1207 |
rtx expand (function_expander &e) const override |
| 1208 |
{ |
| 1209 |
if (e.op_info->op == OP_TYPE_vf) |
| 1210 |
return e.use_ternop_insn (false, |
| 1211 |
code_for_pred_mul_scalar (MINUS, |
| 1212 |
e.vector_mode ())); |
| 1213 |
if (e.op_info->op == OP_TYPE_vv) |
| 1214 |
return e.use_ternop_insn (false, |
| 1215 |
code_for_pred_mul (MINUS, e.vector_mode ())); |
| 1216 |
gcc_unreachable (); |
| 1217 |
} |
| 1218 |
}; |
| 1219 |
|
| 1220 |
template<enum frm_op_type FRM_OP = NO_FRM> |
| 1221 |
class vfwmacc : public function_base |
| 1222 |
{ |
| 1223 |
public: |
| 1224 |
bool has_rounding_mode_operand_p () const override |
| 1225 |
{ |
| 1226 |
return FRM_OP == HAS_FRM; |
| 1227 |
} |
| 1228 |
|
| 1229 |
bool may_require_frm_p () const override { return true; } |
| 1230 |
|
| 1231 |
bool has_merge_operand_p () const override { return false; } |
| 1232 |
|
| 1233 |
rtx expand (function_expander &e) const override |
| 1234 |
{ |
| 1235 |
if (e.op_info->op == OP_TYPE_vf) |
| 1236 |
return e.use_widen_ternop_insn ( |
| 1237 |
code_for_pred_widen_mul_scalar (PLUS, e.vector_mode ())); |
| 1238 |
if (e.op_info->op == OP_TYPE_vv) |
| 1239 |
return e.use_widen_ternop_insn ( |
| 1240 |
code_for_pred_widen_mul (PLUS, e.vector_mode ())); |
| 1241 |
gcc_unreachable (); |
| 1242 |
} |
| 1243 |
}; |
| 1244 |
|
| 1245 |
template<enum frm_op_type FRM_OP = NO_FRM> |
| 1246 |
class vfwnmacc : public function_base |
| 1247 |
{ |
| 1248 |
public: |
| 1249 |
bool has_rounding_mode_operand_p () const override |
| 1250 |
{ |
| 1251 |
return FRM_OP == HAS_FRM; |
| 1252 |
} |
| 1253 |
|
| 1254 |
bool may_require_frm_p () const override { return true; } |
| 1255 |
|
| 1256 |
bool has_merge_operand_p () const override { return false; } |
| 1257 |
|
| 1258 |
rtx expand (function_expander &e) const override |
| 1259 |
{ |
| 1260 |
if (e.op_info->op == OP_TYPE_vf) |
| 1261 |
return e.use_widen_ternop_insn ( |
| 1262 |
code_for_pred_widen_mul_neg_scalar (MINUS, e.vector_mode ())); |
| 1263 |
if (e.op_info->op == OP_TYPE_vv) |
| 1264 |
return e.use_widen_ternop_insn ( |
| 1265 |
code_for_pred_widen_mul_neg (MINUS, e.vector_mode ())); |
| 1266 |
gcc_unreachable (); |
| 1267 |
} |
| 1268 |
}; |
| 1269 |
|
| 1270 |
template<enum frm_op_type FRM_OP = NO_FRM> |
| 1271 |
class vfwmsac : public function_base |
| 1272 |
{ |
| 1273 |
public: |
| 1274 |
bool has_rounding_mode_operand_p () const override |
| 1275 |
{ |
| 1276 |
return FRM_OP == HAS_FRM; |
| 1277 |
} |
| 1278 |
|
| 1279 |
bool may_require_frm_p () const override { return true; } |
| 1280 |
|
| 1281 |
bool has_merge_operand_p () const override { return false; } |
| 1282 |
|
| 1283 |
rtx expand (function_expander &e) const override |
| 1284 |
{ |
| 1285 |
if (e.op_info->op == OP_TYPE_vf) |
| 1286 |
return e.use_widen_ternop_insn ( |
| 1287 |
code_for_pred_widen_mul_scalar (MINUS, e.vector_mode ())); |
| 1288 |
if (e.op_info->op == OP_TYPE_vv) |
| 1289 |
return e.use_widen_ternop_insn ( |
| 1290 |
code_for_pred_widen_mul (MINUS, e.vector_mode ())); |
| 1291 |
gcc_unreachable (); |
| 1292 |
} |
| 1293 |
}; |
| 1294 |
|
| 1295 |
template<enum frm_op_type FRM_OP = NO_FRM> |
| 1296 |
class vfwnmsac : public function_base |
| 1297 |
{ |
| 1298 |
public: |
| 1299 |
bool has_rounding_mode_operand_p () const override |
| 1300 |
{ |
| 1301 |
return FRM_OP == HAS_FRM; |
| 1302 |
} |
| 1303 |
|
| 1304 |
bool may_require_frm_p () const override { return true; } |
| 1305 |
|
| 1306 |
bool has_merge_operand_p () const override { return false; } |
| 1307 |
|
| 1308 |
rtx expand (function_expander &e) const override |
| 1309 |
{ |
| 1310 |
if (e.op_info->op == OP_TYPE_vf) |
| 1311 |
return e.use_widen_ternop_insn ( |
| 1312 |
code_for_pred_widen_mul_neg_scalar (PLUS, e.vector_mode ())); |
| 1313 |
if (e.op_info->op == OP_TYPE_vv) |
| 1314 |
return e.use_widen_ternop_insn ( |
| 1315 |
code_for_pred_widen_mul_neg (PLUS, e.vector_mode ())); |
| 1316 |
gcc_unreachable (); |
| 1317 |
} |
| 1318 |
}; |
| 1319 |
|
| 1320 |
/* Implements vfsqrt7/vfrec7/vfclass/vfsgnj/vfsgnjx. */ |
| 1321 |
template<int UNSPEC, enum frm_op_type FRM_OP = NO_FRM> |
| 1322 |
class float_misc : public function_base |
| 1323 |
{ |
| 1324 |
public: |
| 1325 |
bool has_rounding_mode_operand_p () const override |
| 1326 |
{ |
| 1327 |
return FRM_OP == HAS_FRM; |
| 1328 |
} |
| 1329 |
|
| 1330 |
bool may_require_frm_p () const override { return true; } |
| 1331 |
|
| 1332 |
rtx expand (function_expander &e) const override |
| 1333 |
{ |
| 1334 |
if (e.op_info->op == OP_TYPE_vf) |
| 1335 |
return e.use_exact_insn (code_for_pred_scalar (UNSPEC, e.vector_mode ())); |
| 1336 |
if (e.op_info->op == OP_TYPE_vv || e.op_info->op == OP_TYPE_v) |
| 1337 |
return e.use_exact_insn (code_for_pred (UNSPEC, e.vector_mode ())); |
| 1338 |
gcc_unreachable (); |
| 1339 |
} |
| 1340 |
}; |
| 1341 |
|
| 1342 |
/* Implements vfsgnjn. */ |
| 1343 |
class vfsgnjn : public function_base |
| 1344 |
{ |
| 1345 |
public: |
| 1346 |
rtx expand (function_expander &e) const override |
| 1347 |
{ |
| 1348 |
if (e.op_info->op == OP_TYPE_vf) |
| 1349 |
return e.use_exact_insn (code_for_pred_ncopysign_scalar (e.vector_mode ())); |
| 1350 |
if (e.op_info->op == OP_TYPE_vv) |
| 1351 |
return e.use_exact_insn (code_for_pred_ncopysign (e.vector_mode ())); |
| 1352 |
gcc_unreachable (); |
| 1353 |
} |
| 1354 |
}; |
| 1355 |
|
| 1356 |
/* Implements vmfeq/vmfne/vmflt/vmfgt/vmfle/vmfge. */ |
| 1357 |
template<rtx_code CODE> |
| 1358 |
class fcmp : public function_base |
| 1359 |
{ |
| 1360 |
public: |
| 1361 |
rtx expand (function_expander &e) const override |
| 1362 |
{ |
| 1363 |
switch (e.op_info->op) |
| 1364 |
{ |
| 1365 |
case OP_TYPE_vf: { |
| 1366 |
return e.use_compare_insn (CODE, code_for_pred_cmp_scalar ( |
| 1367 |
e.vector_mode ())); |
| 1368 |
} |
| 1369 |
case OP_TYPE_vv: { |
| 1370 |
return e.use_compare_insn (CODE, |
| 1371 |
code_for_pred_cmp (e.vector_mode ())); |
| 1372 |
} |
| 1373 |
default: |
| 1374 |
gcc_unreachable (); |
| 1375 |
} |
| 1376 |
} |
| 1377 |
}; |
| 1378 |
|
| 1379 |
/* Implements vfclass. */ |
| 1380 |
class vfclass : public function_base |
| 1381 |
{ |
| 1382 |
public: |
| 1383 |
rtx expand (function_expander &e) const override |
| 1384 |
{ |
| 1385 |
return e.use_exact_insn (code_for_pred_class (e.arg_mode (0))); |
| 1386 |
} |
| 1387 |
}; |
| 1388 |
|
| 1389 |
/* Implements vfcvt.x. */ |
| 1390 |
template<int UNSPEC, enum frm_op_type FRM_OP = NO_FRM> |
| 1391 |
class vfcvt_x : public function_base |
| 1392 |
{ |
| 1393 |
public: |
| 1394 |
bool has_rounding_mode_operand_p () const override |
| 1395 |
{ |
| 1396 |
return FRM_OP == HAS_FRM; |
| 1397 |
} |
| 1398 |
|
| 1399 |
bool may_require_frm_p () const override { return true; } |
| 1400 |
|
| 1401 |
rtx expand (function_expander &e) const override |
| 1402 |
{ |
| 1403 |
return e.use_exact_insn (code_for_pred_fcvt_x_f (UNSPEC, e.arg_mode (0))); |
| 1404 |
} |
| 1405 |
}; |
| 1406 |
|
| 1407 |
/* Implements vfcvt.rtz.x. */ |
| 1408 |
template<rtx_code CODE> |
| 1409 |
class vfcvt_rtz_x : public function_base |
| 1410 |
{ |
| 1411 |
public: |
| 1412 |
rtx expand (function_expander &e) const override |
| 1413 |
{ |
| 1414 |
return e.use_exact_insn (code_for_pred (CODE, e.arg_mode (0))); |
| 1415 |
} |
| 1416 |
}; |
| 1417 |
|
| 1418 |
template<enum frm_op_type FRM_OP = NO_FRM> |
| 1419 |
class vfcvt_f : public function_base |
| 1420 |
{ |
| 1421 |
public: |
| 1422 |
bool has_rounding_mode_operand_p () const override |
| 1423 |
{ |
| 1424 |
return FRM_OP == HAS_FRM; |
| 1425 |
} |
| 1426 |
|
| 1427 |
bool may_require_frm_p () const override { return true; } |
| 1428 |
|
| 1429 |
rtx expand (function_expander &e) const override |
| 1430 |
{ |
| 1431 |
if (e.op_info->op == OP_TYPE_x_v) |
| 1432 |
return e.use_exact_insn (code_for_pred (FLOAT, e.vector_mode ())); |
| 1433 |
if (e.op_info->op == OP_TYPE_xu_v) |
| 1434 |
return e.use_exact_insn ( |
| 1435 |
code_for_pred (UNSIGNED_FLOAT, e.vector_mode ())); |
| 1436 |
gcc_unreachable (); |
| 1437 |
} |
| 1438 |
}; |
| 1439 |
|
| 1440 |
/* Implements vfwcvt.x. */ |
| 1441 |
template<int UNSPEC, enum frm_op_type FRM_OP = NO_FRM> |
| 1442 |
class vfwcvt_x : public function_base |
| 1443 |
{ |
| 1444 |
public: |
| 1445 |
bool has_rounding_mode_operand_p () const override |
| 1446 |
{ |
| 1447 |
return FRM_OP == HAS_FRM; |
| 1448 |
} |
| 1449 |
|
| 1450 |
bool may_require_frm_p () const override { return true; } |
| 1451 |
|
| 1452 |
rtx expand (function_expander &e) const override |
| 1453 |
{ |
| 1454 |
return e.use_exact_insn ( |
| 1455 |
code_for_pred_widen_fcvt_x_f (UNSPEC, e.vector_mode ())); |
| 1456 |
} |
| 1457 |
}; |
| 1458 |
|
| 1459 |
/* Implements vfwcvt.rtz.x. */ |
| 1460 |
template<rtx_code CODE> |
| 1461 |
class vfwcvt_rtz_x : public function_base |
| 1462 |
{ |
| 1463 |
public: |
| 1464 |
rtx expand (function_expander &e) const override |
| 1465 |
{ |
| 1466 |
return e.use_exact_insn (code_for_pred_widen (CODE, e.vector_mode ())); |
| 1467 |
} |
| 1468 |
}; |
| 1469 |
|
| 1470 |
class vfwcvt_f : public function_base |
| 1471 |
{ |
| 1472 |
public: |
| 1473 |
rtx expand (function_expander &e) const override |
| 1474 |
{ |
| 1475 |
if (e.op_info->op == OP_TYPE_f_v) |
| 1476 |
return e.use_exact_insn (code_for_pred_extend (e.vector_mode ())); |
| 1477 |
if (e.op_info->op == OP_TYPE_x_v) |
| 1478 |
return e.use_exact_insn (code_for_pred_widen (FLOAT, e.vector_mode ())); |
| 1479 |
if (e.op_info->op == OP_TYPE_xu_v) |
| 1480 |
return e.use_exact_insn ( |
| 1481 |
code_for_pred_widen (UNSIGNED_FLOAT, e.vector_mode ())); |
| 1482 |
gcc_unreachable (); |
| 1483 |
} |
| 1484 |
}; |
| 1485 |
|
| 1486 |
/* Implements vfncvt.x. */ |
| 1487 |
template<int UNSPEC, enum frm_op_type FRM_OP = NO_FRM> |
| 1488 |
class vfncvt_x : public function_base |
| 1489 |
{ |
| 1490 |
public: |
| 1491 |
bool has_rounding_mode_operand_p () const override |
| 1492 |
{ |
| 1493 |
return FRM_OP == HAS_FRM; |
| 1494 |
} |
| 1495 |
|
| 1496 |
bool may_require_frm_p () const override { return true; } |
| 1497 |
|
| 1498 |
rtx expand (function_expander &e) const override |
| 1499 |
{ |
| 1500 |
return e.use_exact_insn ( |
| 1501 |
code_for_pred_narrow_fcvt_x_f (UNSPEC, e.arg_mode (0))); |
| 1502 |
} |
| 1503 |
}; |
| 1504 |
|
| 1505 |
/* Implements vfncvt.rtz.x. */ |
| 1506 |
template<rtx_code CODE> |
| 1507 |
class vfncvt_rtz_x : public function_base |
| 1508 |
{ |
| 1509 |
public: |
| 1510 |
rtx expand (function_expander &e) const override |
| 1511 |
{ |
| 1512 |
return e.use_exact_insn (code_for_pred_narrow (CODE, e.vector_mode ())); |
| 1513 |
} |
| 1514 |
}; |
| 1515 |
|
| 1516 |
template<enum frm_op_type FRM_OP = NO_FRM> |
| 1517 |
class vfncvt_f : public function_base |
| 1518 |
{ |
| 1519 |
public: |
| 1520 |
bool has_rounding_mode_operand_p () const override |
| 1521 |
{ |
| 1522 |
return FRM_OP == HAS_FRM; |
| 1523 |
} |
| 1524 |
|
| 1525 |
bool may_require_frm_p () const override { return true; } |
| 1526 |
|
| 1527 |
rtx expand (function_expander &e) const override |
| 1528 |
{ |
| 1529 |
if (e.op_info->op == OP_TYPE_f_w) |
| 1530 |
return e.use_exact_insn (code_for_pred_trunc (e.vector_mode ())); |
| 1531 |
if (e.op_info->op == OP_TYPE_x_w) |
| 1532 |
return e.use_exact_insn (code_for_pred_narrow (FLOAT, e.arg_mode (0))); |
| 1533 |
if (e.op_info->op == OP_TYPE_xu_w) |
| 1534 |
return e.use_exact_insn ( |
| 1535 |
code_for_pred_narrow (UNSIGNED_FLOAT, e.arg_mode (0))); |
| 1536 |
gcc_unreachable (); |
| 1537 |
} |
| 1538 |
}; |
| 1539 |
|
| 1540 |
class vfncvt_rod_f : public function_base |
| 1541 |
{ |
| 1542 |
public: |
| 1543 |
rtx expand (function_expander &e) const override |
| 1544 |
{ |
| 1545 |
return e.use_exact_insn (code_for_pred_rod_trunc (e.vector_mode ())); |
| 1546 |
} |
| 1547 |
}; |
| 1548 |
|
| 1549 |
/* Implements reduction instructions. */ |
| 1550 |
template<unsigned UNSPEC> |
| 1551 |
class reducop : public function_base |
| 1552 |
{ |
| 1553 |
public: |
| 1554 |
bool apply_mask_policy_p () const override { return false; } |
| 1555 |
|
| 1556 |
rtx expand (function_expander &e) const override |
| 1557 |
{ |
| 1558 |
return e.use_exact_insn (code_for_pred (UNSPEC, e.vector_mode ())); |
| 1559 |
} |
| 1560 |
}; |
| 1561 |
|
| 1562 |
/* Implements floating-point reduction instructions. */ |
| 1563 |
template<unsigned UNSPEC, enum frm_op_type FRM_OP = NO_FRM> |
| 1564 |
class freducop : public function_base |
| 1565 |
{ |
| 1566 |
public: |
| 1567 |
bool has_rounding_mode_operand_p () const override |
| 1568 |
{ |
| 1569 |
return FRM_OP == HAS_FRM; |
| 1570 |
} |
| 1571 |
|
| 1572 |
bool may_require_frm_p () const override { return true; } |
| 1573 |
|
| 1574 |
bool apply_mask_policy_p () const override { return false; } |
| 1575 |
|
| 1576 |
rtx expand (function_expander &e) const override |
| 1577 |
{ |
| 1578 |
return e.use_exact_insn (code_for_pred (UNSPEC, e.vector_mode ())); |
| 1579 |
} |
| 1580 |
}; |
| 1581 |
|
| 1582 |
/* Implements vmv/vfmv instructions. */ |
| 1583 |
class vmv : public function_base |
| 1584 |
{ |
| 1585 |
public: |
| 1586 |
bool apply_vl_p () const override { return false; } |
| 1587 |
bool apply_tail_policy_p () const override { return false; } |
| 1588 |
bool apply_mask_policy_p () const override { return false; } |
| 1589 |
bool use_mask_predication_p () const override { return false; } |
| 1590 |
bool has_merge_operand_p () const override { return false; } |
| 1591 |
|
| 1592 |
rtx expand (function_expander &e) const override |
| 1593 |
{ |
| 1594 |
return e.use_exact_insn (code_for_pred_extract_first (e.vector_mode ())); |
| 1595 |
} |
| 1596 |
}; |
| 1597 |
|
| 1598 |
/* Implements vmv.s.x/vfmv.s.f. */ |
| 1599 |
class vmv_s : public function_base |
| 1600 |
{ |
| 1601 |
public: |
| 1602 |
rtx expand (function_expander &e) const override |
| 1603 |
{ |
| 1604 |
return e.use_scalar_move_insn (code_for_pred_broadcast (e.vector_mode ())); |
| 1605 |
} |
| 1606 |
}; |
| 1607 |
|
| 1608 |
template<int UNSPEC> |
| 1609 |
class slideop : public function_base |
| 1610 |
{ |
| 1611 |
public: |
| 1612 |
bool has_merge_operand_p () const override |
| 1613 |
{ |
| 1614 |
if (UNSPEC == UNSPEC_VSLIDEUP) |
| 1615 |
return false; |
| 1616 |
return true; |
| 1617 |
} |
| 1618 |
|
| 1619 |
rtx expand (function_expander &e) const override |
| 1620 |
{ |
| 1621 |
return e.use_exact_insn (code_for_pred_slide (UNSPEC, e.vector_mode ())); |
| 1622 |
} |
| 1623 |
}; |
| 1624 |
|
| 1625 |
class vrgather : public function_base |
| 1626 |
{ |
| 1627 |
public: |
| 1628 |
rtx expand (function_expander &e) const override |
| 1629 |
{ |
| 1630 |
switch (e.op_info->op) |
| 1631 |
{ |
| 1632 |
case OP_TYPE_vx: |
| 1633 |
return e.use_exact_insn ( |
| 1634 |
code_for_pred_gather_scalar (e.vector_mode ())); |
| 1635 |
case OP_TYPE_vv: |
| 1636 |
return e.use_exact_insn (code_for_pred_gather (e.vector_mode ())); |
| 1637 |
default: |
| 1638 |
gcc_unreachable (); |
| 1639 |
} |
| 1640 |
} |
| 1641 |
}; |
| 1642 |
|
| 1643 |
class vrgatherei16 : public function_base |
| 1644 |
{ |
| 1645 |
public: |
| 1646 |
rtx expand (function_expander &e) const override |
| 1647 |
{ |
| 1648 |
return e.use_exact_insn (code_for_pred_gatherei16 (e.vector_mode ())); |
| 1649 |
} |
| 1650 |
}; |
| 1651 |
|
| 1652 |
class vcompress : public function_base |
| 1653 |
{ |
| 1654 |
public: |
| 1655 |
bool apply_mask_policy_p () const override { return false; } |
| 1656 |
bool use_mask_predication_p () const override { return false; } |
| 1657 |
rtx expand (function_expander &e) const override |
| 1658 |
{ |
| 1659 |
return e.use_exact_insn (code_for_pred_compress (e.vector_mode ())); |
| 1660 |
} |
| 1661 |
}; |
| 1662 |
|
| 1663 |
class vundefined : public function_base |
| 1664 |
{ |
| 1665 |
public: |
| 1666 |
bool apply_vl_p () const override |
| 1667 |
{ |
| 1668 |
return false; |
| 1669 |
} |
| 1670 |
|
| 1671 |
rtx expand (function_expander &e) const override |
| 1672 |
{ |
| 1673 |
return e.generate_insn (code_for_vundefined (e.vector_mode ())); |
| 1674 |
} |
| 1675 |
}; |
| 1676 |
|
| 1677 |
class vreinterpret : public function_base |
| 1678 |
{ |
| 1679 |
public: |
| 1680 |
bool apply_vl_p () const override |
| 1681 |
{ |
| 1682 |
return false; |
| 1683 |
} |
| 1684 |
|
| 1685 |
rtx expand (function_expander &e) const override |
| 1686 |
{ |
| 1687 |
e.add_input_operand (0); |
| 1688 |
return e.generate_insn (code_for_vreinterpret (e.ret_mode ())); |
| 1689 |
} |
| 1690 |
}; |
| 1691 |
|
| 1692 |
class vlmul_ext : public function_base |
| 1693 |
{ |
| 1694 |
public: |
| 1695 |
bool apply_vl_p () const override |
| 1696 |
{ |
| 1697 |
return false; |
| 1698 |
} |
| 1699 |
|
| 1700 |
rtx expand (function_expander &e) const override |
| 1701 |
{ |
| 1702 |
if (!e.target) |
| 1703 |
return NULL_RTX; |
| 1704 |
tree arg = CALL_EXPR_ARG (e.exp, 0); |
| 1705 |
rtx src = expand_normal (arg); |
| 1706 |
emit_move_insn (gen_lowpart (e.vector_mode (), e.target), src); |
| 1707 |
return e.target; |
| 1708 |
} |
| 1709 |
}; |
| 1710 |
|
| 1711 |
class vlmul_trunc : public function_base |
| 1712 |
{ |
| 1713 |
public: |
| 1714 |
bool apply_vl_p () const override { return false; } |
| 1715 |
|
| 1716 |
rtx expand (function_expander &e) const override |
| 1717 |
{ |
| 1718 |
if (!e.target) |
| 1719 |
return NULL_RTX; |
| 1720 |
rtx src = expand_normal (CALL_EXPR_ARG (e.exp, 0)); |
| 1721 |
emit_move_insn (e.target, gen_lowpart (GET_MODE (e.target), src)); |
| 1722 |
return e.target; |
| 1723 |
} |
| 1724 |
}; |
| 1725 |
|
| 1726 |
class vset : public function_base |
| 1727 |
{ |
| 1728 |
public: |
| 1729 |
bool apply_vl_p () const override { return false; } |
| 1730 |
|
| 1731 |
gimple *fold (gimple_folder &f) const override |
| 1732 |
{ |
| 1733 |
tree rhs_tuple = gimple_call_arg (f.call, 0); |
| 1734 |
/* LMUL > 1 non-tuple vector types are not structure, |
| 1735 |
we can't use __val[index] to set the subpart. */ |
| 1736 |
if (!riscv_v_ext_tuple_mode_p (TYPE_MODE (TREE_TYPE (rhs_tuple)))) |
| 1737 |
return NULL; |
| 1738 |
tree index = gimple_call_arg (f.call, 1); |
| 1739 |
tree rhs_vector = gimple_call_arg (f.call, 2); |
| 1740 |
|
| 1741 |
/* Replace the call with two statements: a copy of the full tuple |
| 1742 |
to the call result, followed by an update of the individual vector. |
| 1743 |
|
| 1744 |
The fold routines expect the replacement statement to have the |
| 1745 |
same lhs as the original call, so return the copy statement |
| 1746 |
rather than the field update. */ |
| 1747 |
gassign *copy = gimple_build_assign (f.lhs, rhs_tuple); |
| 1748 |
|
| 1749 |
/* Get a reference to the individual vector. */ |
| 1750 |
tree field = tuple_type_field (TREE_TYPE (f.lhs)); |
| 1751 |
tree lhs_array |
| 1752 |
= build3 (COMPONENT_REF, TREE_TYPE (field), unshare_expr (f.lhs), |
| 1753 |
field, NULL_TREE); |
| 1754 |
tree lhs_vector = build4 (ARRAY_REF, TREE_TYPE (rhs_vector), lhs_array, |
| 1755 |
index, NULL_TREE, NULL_TREE); |
| 1756 |
gassign *update = gimple_build_assign (lhs_vector, rhs_vector); |
| 1757 |
gsi_insert_after (f.gsi, update, GSI_SAME_STMT); |
| 1758 |
|
| 1759 |
return copy; |
| 1760 |
} |
| 1761 |
|
| 1762 |
rtx expand (function_expander &e) const override |
| 1763 |
{ |
| 1764 |
if (!e.target) |
| 1765 |
return NULL_RTX; |
| 1766 |
rtx dest = expand_normal (CALL_EXPR_ARG (e.exp, 0)); |
| 1767 |
gcc_assert (riscv_v_ext_vector_mode_p (GET_MODE (dest))); |
| 1768 |
rtx index = expand_normal (CALL_EXPR_ARG (e.exp, 1)); |
| 1769 |
rtx src = expand_normal (CALL_EXPR_ARG (e.exp, 2)); |
| 1770 |
poly_int64 offset = INTVAL (index) * GET_MODE_SIZE (GET_MODE (src)); |
| 1771 |
emit_move_insn (e.target, dest); |
| 1772 |
rtx subreg = simplify_gen_subreg (GET_MODE (src), e.target, |
| 1773 |
GET_MODE (e.target), offset); |
| 1774 |
emit_move_insn (subreg, src); |
| 1775 |
return e.target; |
| 1776 |
} |
| 1777 |
}; |
| 1778 |
|
| 1779 |
class vget : public function_base |
| 1780 |
{ |
| 1781 |
public: |
| 1782 |
bool apply_vl_p () const override { return false; } |
| 1783 |
|
| 1784 |
gimple *fold (gimple_folder &f) const override |
| 1785 |
{ |
| 1786 |
/* Fold into a normal gimple component access. */ |
| 1787 |
tree rhs_tuple = gimple_call_arg (f.call, 0); |
| 1788 |
/* LMUL > 1 non-tuple vector types are not structure, |
| 1789 |
we can't use __val[index] to get the subpart. */ |
| 1790 |
if (!riscv_v_ext_tuple_mode_p (TYPE_MODE (TREE_TYPE (rhs_tuple)))) |
| 1791 |
return NULL; |
| 1792 |
tree index = gimple_call_arg (f.call, 1); |
| 1793 |
tree field = tuple_type_field (TREE_TYPE (rhs_tuple)); |
| 1794 |
tree rhs_array |
| 1795 |
= build3 (COMPONENT_REF, TREE_TYPE (field), rhs_tuple, field, NULL_TREE); |
| 1796 |
tree rhs_vector = build4 (ARRAY_REF, TREE_TYPE (f.lhs), rhs_array, index, |
| 1797 |
NULL_TREE, NULL_TREE); |
| 1798 |
return gimple_build_assign (f.lhs, rhs_vector); |
| 1799 |
} |
| 1800 |
|
| 1801 |
rtx expand (function_expander &e) const override |
| 1802 |
{ |
| 1803 |
if (!e.target) |
| 1804 |
return NULL_RTX; |
| 1805 |
rtx src = expand_normal (CALL_EXPR_ARG (e.exp, 0)); |
| 1806 |
gcc_assert (riscv_v_ext_vector_mode_p (GET_MODE (src))); |
| 1807 |
rtx index = expand_normal (CALL_EXPR_ARG (e.exp, 1)); |
| 1808 |
poly_int64 offset = INTVAL (index) * GET_MODE_SIZE (GET_MODE (e.target)); |
| 1809 |
rtx subreg |
| 1810 |
= simplify_gen_subreg (GET_MODE (e.target), src, GET_MODE (src), offset); |
| 1811 |
return subreg; |
| 1812 |
} |
| 1813 |
}; |
| 1814 |
|
| 1815 |
class vcreate : public function_base |
| 1816 |
{ |
| 1817 |
public: |
| 1818 |
gimple *fold (gimple_folder &f) const override |
| 1819 |
{ |
| 1820 |
unsigned int nargs = gimple_call_num_args (f.call); |
| 1821 |
tree lhs_type = TREE_TYPE (f.lhs); |
| 1822 |
/* LMUL > 1 non-tuple vector types are not structure, |
| 1823 |
we can't use __val[index] to set the subpart. */ |
| 1824 |
if (!riscv_v_ext_tuple_mode_p (TYPE_MODE (lhs_type))) |
| 1825 |
return NULL; |
| 1826 |
|
| 1827 |
/* Replace the call with a clobber of the result (to prevent it from |
| 1828 |
becoming upwards exposed) followed by stores into each individual |
| 1829 |
vector of tuple. |
| 1830 |
|
| 1831 |
The fold routines expect the replacement statement to have the |
| 1832 |
same lhs as the original call, so return the clobber statement |
| 1833 |
rather than the final vector store. */ |
| 1834 |
gassign *clobber = gimple_build_assign (f.lhs, build_clobber (lhs_type)); |
| 1835 |
|
| 1836 |
for (unsigned int i = nargs; i-- > 0; ) |
| 1837 |
{ |
| 1838 |
tree rhs_vector = gimple_call_arg (f.call, i); |
| 1839 |
tree field = tuple_type_field (TREE_TYPE (f.lhs)); |
| 1840 |
tree lhs_array = build3 (COMPONENT_REF, TREE_TYPE (field), |
| 1841 |
unshare_expr (f.lhs), field, NULL_TREE); |
| 1842 |
tree lhs_vector = build4 (ARRAY_REF, TREE_TYPE (rhs_vector), |
| 1843 |
lhs_array, size_int (i), |
| 1844 |
NULL_TREE, NULL_TREE); |
| 1845 |
gassign *assign = gimple_build_assign (lhs_vector, rhs_vector); |
| 1846 |
gsi_insert_after (f.gsi, assign, GSI_SAME_STMT); |
| 1847 |
} |
| 1848 |
return clobber; |
| 1849 |
} |
| 1850 |
|
| 1851 |
rtx expand (function_expander &e) const override |
| 1852 |
{ |
| 1853 |
if (!e.target) |
| 1854 |
return NULL_RTX; |
| 1855 |
gcc_assert (riscv_v_ext_vector_mode_p (GET_MODE (e.target))); |
| 1856 |
unsigned int nargs = call_expr_nargs (e.exp); |
| 1857 |
for (unsigned int i = 0; i < nargs; i++) |
| 1858 |
{ |
| 1859 |
rtx src = expand_normal (CALL_EXPR_ARG (e.exp, i)); |
| 1860 |
poly_int64 offset = i * GET_MODE_SIZE (GET_MODE (src)); |
| 1861 |
rtx subreg = simplify_gen_subreg (GET_MODE (src), e.target, |
| 1862 |
GET_MODE (e.target), offset); |
| 1863 |
emit_move_insn (subreg, src); |
| 1864 |
} |
| 1865 |
|
| 1866 |
return e.target; |
| 1867 |
} |
| 1868 |
}; |
| 1869 |
|
| 1870 |
class read_vl : public function_base |
| 1871 |
{ |
| 1872 |
public: |
| 1873 |
unsigned int call_properties (const function_instance &) const override |
| 1874 |
{ |
| 1875 |
return CP_READ_CSR; |
| 1876 |
} |
| 1877 |
|
| 1878 |
rtx expand (function_expander &e) const override |
| 1879 |
{ |
| 1880 |
emit_insn (gen_read_vl (Pmode, e.target)); |
| 1881 |
return e.target; |
| 1882 |
} |
| 1883 |
}; |
| 1884 |
|
| 1885 |
class vleff : public function_base |
| 1886 |
{ |
| 1887 |
public: |
| 1888 |
unsigned int call_properties (const function_instance &) const override |
| 1889 |
{ |
| 1890 |
return CP_READ_MEMORY | CP_WRITE_CSR; |
| 1891 |
} |
| 1892 |
|
| 1893 |
bool can_be_overloaded_p (enum predication_type_index pred) const override |
| 1894 |
{ |
| 1895 |
return pred != PRED_TYPE_none; |
| 1896 |
} |
| 1897 |
|
| 1898 |
rtx expand (function_expander &e) const override |
| 1899 |
{ |
| 1900 |
return e.use_fof_load_insn (); |
| 1901 |
} |
| 1902 |
}; |
| 1903 |
|
| 1904 |
/* Implements vlenb. */ |
| 1905 |
class vlenb : public function_base |
| 1906 |
{ |
| 1907 |
public: |
| 1908 |
bool apply_vl_p () const override { return false; } |
| 1909 |
|
| 1910 |
rtx expand (function_expander &e) const override |
| 1911 |
{ |
| 1912 |
machine_mode mode = GET_MODE (e.target); |
| 1913 |
rtx vlenb = gen_int_mode (BYTES_PER_RISCV_VECTOR, mode); |
| 1914 |
emit_move_insn (e.target, vlenb); |
| 1915 |
return e.target; |
| 1916 |
} |
| 1917 |
}; |
| 1918 |
|
| 1919 |
/* Implements vlseg.v. */ |
| 1920 |
class vlseg : public function_base |
| 1921 |
{ |
| 1922 |
public: |
| 1923 |
unsigned int call_properties (const function_instance &) const override |
| 1924 |
{ |
| 1925 |
return CP_READ_MEMORY; |
| 1926 |
} |
| 1927 |
|
| 1928 |
bool can_be_overloaded_p (enum predication_type_index pred) const override |
| 1929 |
{ |
| 1930 |
return pred != PRED_TYPE_none; |
| 1931 |
} |
| 1932 |
|
| 1933 |
rtx expand (function_expander &e) const override |
| 1934 |
{ |
| 1935 |
return e.use_exact_insn ( |
| 1936 |
code_for_pred_unit_strided_load (e.vector_mode ())); |
| 1937 |
} |
| 1938 |
}; |
| 1939 |
|
| 1940 |
/* Implements vsseg.v. */ |
| 1941 |
class vsseg : public function_base |
| 1942 |
{ |
| 1943 |
public: |
| 1944 |
bool apply_tail_policy_p () const override { return false; } |
| 1945 |
bool apply_mask_policy_p () const override { return false; } |
| 1946 |
|
| 1947 |
unsigned int call_properties (const function_instance &) const override |
| 1948 |
{ |
| 1949 |
return CP_WRITE_MEMORY; |
| 1950 |
} |
| 1951 |
|
| 1952 |
bool can_be_overloaded_p (enum predication_type_index) const override |
| 1953 |
{ |
| 1954 |
return true; |
| 1955 |
} |
| 1956 |
|
| 1957 |
rtx expand (function_expander &e) const override |
| 1958 |
{ |
| 1959 |
return e.use_exact_insn ( |
| 1960 |
code_for_pred_unit_strided_store (e.vector_mode ())); |
| 1961 |
} |
| 1962 |
}; |
| 1963 |
|
| 1964 |
/* Implements vlsseg.v. */ |
| 1965 |
class vlsseg : public function_base |
| 1966 |
{ |
| 1967 |
public: |
| 1968 |
unsigned int call_properties (const function_instance &) const override |
| 1969 |
{ |
| 1970 |
return CP_READ_MEMORY; |
| 1971 |
} |
| 1972 |
|
| 1973 |
bool can_be_overloaded_p (enum predication_type_index pred) const override |
| 1974 |
{ |
| 1975 |
return pred != PRED_TYPE_none; |
| 1976 |
} |
| 1977 |
|
| 1978 |
rtx expand (function_expander &e) const override |
| 1979 |
{ |
| 1980 |
return e.use_exact_insn ( |
| 1981 |
code_for_pred_strided_load (e.vector_mode ())); |
| 1982 |
} |
| 1983 |
}; |
| 1984 |
|
| 1985 |
/* Implements vssseg.v. */ |
| 1986 |
class vssseg : public function_base |
| 1987 |
{ |
| 1988 |
public: |
| 1989 |
bool apply_tail_policy_p () const override { return false; } |
| 1990 |
bool apply_mask_policy_p () const override { return false; } |
| 1991 |
|
| 1992 |
unsigned int call_properties (const function_instance &) const override |
| 1993 |
{ |
| 1994 |
return CP_WRITE_MEMORY; |
| 1995 |
} |
| 1996 |
|
| 1997 |
bool can_be_overloaded_p (enum predication_type_index) const override |
| 1998 |
{ |
| 1999 |
return true; |
| 2000 |
} |
| 2001 |
|
| 2002 |
rtx expand (function_expander &e) const override |
| 2003 |
{ |
| 2004 |
return e.use_exact_insn ( |
| 2005 |
code_for_pred_strided_store (e.vector_mode ())); |
| 2006 |
} |
| 2007 |
}; |
| 2008 |
|
| 2009 |
template<int UNSPEC> |
| 2010 |
class seg_indexed_load : public function_base |
| 2011 |
{ |
| 2012 |
public: |
| 2013 |
unsigned int call_properties (const function_instance &) const override |
| 2014 |
{ |
| 2015 |
return CP_READ_MEMORY; |
| 2016 |
} |
| 2017 |
|
| 2018 |
bool can_be_overloaded_p (enum predication_type_index) const override |
| 2019 |
{ |
| 2020 |
return true; |
| 2021 |
} |
| 2022 |
|
| 2023 |
rtx expand (function_expander &e) const override |
| 2024 |
{ |
| 2025 |
return e.use_exact_insn ( |
| 2026 |
code_for_pred_indexed_load (UNSPEC, e.vector_mode (), e.index_mode ())); |
| 2027 |
} |
| 2028 |
}; |
| 2029 |
|
| 2030 |
template<int UNSPEC> |
| 2031 |
class seg_indexed_store : public function_base |
| 2032 |
{ |
| 2033 |
public: |
| 2034 |
bool apply_tail_policy_p () const override { return false; } |
| 2035 |
bool apply_mask_policy_p () const override { return false; } |
| 2036 |
|
| 2037 |
unsigned int call_properties (const function_instance &) const override |
| 2038 |
{ |
| 2039 |
return CP_WRITE_MEMORY; |
| 2040 |
} |
| 2041 |
|
| 2042 |
bool can_be_overloaded_p (enum predication_type_index) const override |
| 2043 |
{ |
| 2044 |
return true; |
| 2045 |
} |
| 2046 |
|
| 2047 |
rtx expand (function_expander &e) const override |
| 2048 |
{ |
| 2049 |
return e.use_exact_insn ( |
| 2050 |
code_for_pred_indexed_store (UNSPEC, e.vector_mode (), e.index_mode ())); |
| 2051 |
} |
| 2052 |
}; |
| 2053 |
|
| 2054 |
/* Implements vlsegff.v. */ |
| 2055 |
class vlsegff : public function_base |
| 2056 |
{ |
| 2057 |
public: |
| 2058 |
unsigned int call_properties (const function_instance &) const override |
| 2059 |
{ |
| 2060 |
return CP_READ_MEMORY | CP_WRITE_CSR; |
| 2061 |
} |
| 2062 |
|
| 2063 |
bool can_be_overloaded_p (enum predication_type_index pred) const override |
| 2064 |
{ |
| 2065 |
return pred != PRED_TYPE_none; |
| 2066 |
} |
| 2067 |
|
| 2068 |
rtx expand (function_expander &e) const override |
| 2069 |
{ |
| 2070 |
return e.use_fof_load_insn (); |
| 2071 |
} |
| 2072 |
}; |
| 2073 |
|
| 2074 |
/* Implements |
| 2075 |
* th.vl(b/h/w)[u].v/th.vs(b/h/w)[u].v/th.vls(b/h/w)[u].v/th.vss(b/h/w)[u].v/ |
| 2076 |
* th.vlx(b/h/w)[u].v/th.vs[u]x(b/h/w).v |
| 2077 |
* codegen. */ |
| 2078 |
template<bool STORE_P, lst_type LST_TYPE, int UNSPEC> |
| 2079 |
class th_loadstore_width : public function_base |
| 2080 |
{ |
| 2081 |
public: |
| 2082 |
bool apply_tail_policy_p () const override { return !STORE_P; } |
| 2083 |
bool apply_mask_policy_p () const override { return !STORE_P; } |
| 2084 |
|
| 2085 |
unsigned int call_properties (const function_instance &) const override |
| 2086 |
{ |
| 2087 |
if (STORE_P) |
| 2088 |
return CP_WRITE_MEMORY; |
| 2089 |
else |
| 2090 |
return CP_READ_MEMORY; |
| 2091 |
} |
| 2092 |
|
| 2093 |
bool can_be_overloaded_p (enum predication_type_index pred) const override |
| 2094 |
{ |
| 2095 |
if (STORE_P || LST_TYPE == LST_INDEXED) |
| 2096 |
return true; |
| 2097 |
return pred != PRED_TYPE_none; |
| 2098 |
} |
| 2099 |
|
| 2100 |
rtx expand (function_expander &e) const override |
| 2101 |
{ |
| 2102 |
gcc_assert (TARGET_XTHEADVECTOR); |
| 2103 |
if (LST_TYPE == LST_INDEXED) |
| 2104 |
{ |
| 2105 |
if (STORE_P) |
| 2106 |
return e.use_exact_insn ( |
| 2107 |
code_for_pred_indexed_store_width (UNSPEC, UNSPEC, |
| 2108 |
e.vector_mode ())); |
| 2109 |
else |
| 2110 |
return e.use_exact_insn ( |
| 2111 |
code_for_pred_indexed_load_width (UNSPEC, e.vector_mode ())); |
| 2112 |
} |
| 2113 |
else if (LST_TYPE == LST_STRIDED) |
| 2114 |
{ |
| 2115 |
if (STORE_P) |
| 2116 |
return e.use_contiguous_store_insn ( |
| 2117 |
code_for_pred_strided_store_width (UNSPEC, e.vector_mode ())); |
| 2118 |
else |
| 2119 |
return e.use_contiguous_load_insn ( |
| 2120 |
code_for_pred_strided_load_width (UNSPEC, e.vector_mode ())); |
| 2121 |
} |
| 2122 |
else |
| 2123 |
{ |
| 2124 |
if (STORE_P) |
| 2125 |
return e.use_contiguous_store_insn ( |
| 2126 |
code_for_pred_store_width (UNSPEC, e.vector_mode ())); |
| 2127 |
else |
| 2128 |
return e.use_contiguous_load_insn ( |
| 2129 |
code_for_pred_mov_width (UNSPEC, e.vector_mode ())); |
| 2130 |
} |
| 2131 |
} |
| 2132 |
}; |
| 2133 |
|
| 2134 |
/* Implements vext.x.v. */ |
| 2135 |
class th_extract : public function_base |
| 2136 |
{ |
| 2137 |
public: |
| 2138 |
bool apply_vl_p () const override { return false; } |
| 2139 |
bool apply_tail_policy_p () const override { return false; } |
| 2140 |
bool apply_mask_policy_p () const override { return false; } |
| 2141 |
bool use_mask_predication_p () const override { return false; } |
| 2142 |
bool has_merge_operand_p () const override { return false; } |
| 2143 |
|
| 2144 |
rtx expand (function_expander &e) const override |
| 2145 |
{ |
| 2146 |
gcc_assert (TARGET_XTHEADVECTOR); |
| 2147 |
return e.use_exact_insn (code_for_pred_th_extract (e.vector_mode ())); |
| 2148 |
} |
| 2149 |
}; |
| 2150 |
|
| 2151 |
/* Below implements are vector crypto */ |
| 2152 |
/* Implements vandn.[vv,vx] */ |
| 2153 |
class vandn : public function_base |
| 2154 |
{ |
| 2155 |
public: |
| 2156 |
rtx expand (function_expander &e) const override |
| 2157 |
{ |
| 2158 |
switch (e.op_info->op) |
| 2159 |
{ |
| 2160 |
case OP_TYPE_vv: |
| 2161 |
return e.use_exact_insn (code_for_pred_vandn (e.vector_mode ())); |
| 2162 |
case OP_TYPE_vx: |
| 2163 |
return e.use_exact_insn (code_for_pred_vandn_scalar (e.vector_mode ())); |
| 2164 |
default: |
| 2165 |
gcc_unreachable (); |
| 2166 |
} |
| 2167 |
} |
| 2168 |
}; |
| 2169 |
|
| 2170 |
/* Implements vrol/vror/clz/ctz. */ |
| 2171 |
template<rtx_code CODE> |
| 2172 |
class bitmanip : public function_base |
| 2173 |
{ |
| 2174 |
public: |
| 2175 |
bool apply_tail_policy_p () const override |
| 2176 |
{ |
| 2177 |
return (CODE == CLZ || CODE == CTZ) ? false : true; |
| 2178 |
} |
| 2179 |
bool apply_mask_policy_p () const override |
| 2180 |
{ |
| 2181 |
return (CODE == CLZ || CODE == CTZ) ? false : true; |
| 2182 |
} |
| 2183 |
bool has_merge_operand_p () const override |
| 2184 |
{ |
| 2185 |
return (CODE == CLZ || CODE == CTZ) ? false : true; |
| 2186 |
} |
| 2187 |
|
| 2188 |
rtx expand (function_expander &e) const override |
| 2189 |
{ |
| 2190 |
switch (e.op_info->op) |
| 2191 |
{ |
| 2192 |
case OP_TYPE_v: |
| 2193 |
case OP_TYPE_vv: |
| 2194 |
return e.use_exact_insn (code_for_pred_v (CODE, e.vector_mode ())); |
| 2195 |
case OP_TYPE_vx: |
| 2196 |
return e.use_exact_insn (code_for_pred_v_scalar (CODE, e.vector_mode ())); |
| 2197 |
default: |
| 2198 |
gcc_unreachable (); |
| 2199 |
} |
| 2200 |
} |
| 2201 |
}; |
| 2202 |
|
| 2203 |
/* Implements vbrev/vbrev8/vrev8. */ |
| 2204 |
template<int UNSPEC> |
| 2205 |
class b_reverse : public function_base |
| 2206 |
{ |
| 2207 |
public: |
| 2208 |
rtx expand (function_expander &e) const override |
| 2209 |
{ |
| 2210 |
return e.use_exact_insn (code_for_pred_v (UNSPEC, e.vector_mode ())); |
| 2211 |
} |
| 2212 |
}; |
| 2213 |
|
| 2214 |
class vwsll : public function_base |
| 2215 |
{ |
| 2216 |
public: |
| 2217 |
rtx expand (function_expander &e) const override |
| 2218 |
{ |
| 2219 |
switch (e.op_info->op) |
| 2220 |
{ |
| 2221 |
case OP_TYPE_vv: |
| 2222 |
return e.use_exact_insn (code_for_pred_vwsll (e.vector_mode ())); |
| 2223 |
case OP_TYPE_vx: |
| 2224 |
return e.use_exact_insn (code_for_pred_vwsll_scalar (e.vector_mode ())); |
| 2225 |
default: |
| 2226 |
gcc_unreachable (); |
| 2227 |
} |
| 2228 |
} |
| 2229 |
}; |
| 2230 |
|
| 2231 |
/* Implements clmul */ |
| 2232 |
template<int UNSPEC> |
| 2233 |
class clmul : public function_base |
| 2234 |
{ |
| 2235 |
public: |
| 2236 |
rtx expand (function_expander &e) const override |
| 2237 |
{ |
| 2238 |
switch (e.op_info->op) |
| 2239 |
{ |
| 2240 |
case OP_TYPE_vv: |
| 2241 |
return e.use_exact_insn ( |
| 2242 |
code_for_pred_vclmul (UNSPEC, e.vector_mode ())); |
| 2243 |
case OP_TYPE_vx: |
| 2244 |
return e.use_exact_insn |
| 2245 |
(code_for_pred_vclmul_scalar (UNSPEC, e.vector_mode ())); |
| 2246 |
default: |
| 2247 |
gcc_unreachable (); |
| 2248 |
} |
| 2249 |
} |
| 2250 |
}; |
| 2251 |
|
| 2252 |
/* Implements vghsh/vsh2ms/vsha2c[hl]. */ |
| 2253 |
template<int UNSPEC> |
| 2254 |
class vg_nhab : public function_base |
| 2255 |
{ |
| 2256 |
public: |
| 2257 |
bool apply_mask_policy_p () const override { return false; } |
| 2258 |
bool use_mask_predication_p () const override { return false; } |
| 2259 |
bool has_merge_operand_p () const override { return false; } |
| 2260 |
|
| 2261 |
rtx expand (function_expander &e) const override |
| 2262 |
{ |
| 2263 |
return e.use_exact_insn (code_for_pred_v (UNSPEC, e.vector_mode ())); |
| 2264 |
} |
| 2265 |
}; |
| 2266 |
|
| 2267 |
/* Implements vgmul/vaes*. */ |
| 2268 |
template<int UNSPEC> |
| 2269 |
class crypto_vv : public function_base |
| 2270 |
{ |
| 2271 |
public: |
| 2272 |
bool apply_mask_policy_p () const override { return false; } |
| 2273 |
bool use_mask_predication_p () const override { return false; } |
| 2274 |
bool has_merge_operand_p () const override { return false; } |
| 2275 |
|
| 2276 |
rtx expand (function_expander &e) const override |
| 2277 |
{ |
| 2278 |
poly_uint64 nunits = 0U; |
| 2279 |
switch (e.op_info->op) |
| 2280 |
{ |
| 2281 |
case OP_TYPE_vv: |
| 2282 |
if (UNSPEC == UNSPEC_VGMUL) |
| 2283 |
return e.use_exact_insn |
| 2284 |
(code_for_pred_crypto_vv (UNSPEC, UNSPEC, e.vector_mode ())); |
| 2285 |
else |
| 2286 |
return e.use_exact_insn |
| 2287 |
(code_for_pred_crypto_vv (UNSPEC + 1, UNSPEC + 1, e.vector_mode ())); |
| 2288 |
case OP_TYPE_vs: |
| 2289 |
/* Calculate the ratio between arg0 and arg1*/ |
| 2290 |
gcc_assert (multiple_p (GET_MODE_BITSIZE (e.arg_mode (0)), |
| 2291 |
GET_MODE_BITSIZE (e.arg_mode (1)), &nunits)); |
| 2292 |
if (maybe_eq (nunits, 1U)) |
| 2293 |
return e.use_exact_insn (code_for_pred_crypto_vvx1_scalar |
| 2294 |
(UNSPEC + 2, UNSPEC + 2, e.vector_mode ())); |
| 2295 |
else if (maybe_eq (nunits, 2U)) |
| 2296 |
return e.use_exact_insn (code_for_pred_crypto_vvx2_scalar |
| 2297 |
(UNSPEC + 2, UNSPEC + 2, e.vector_mode ())); |
| 2298 |
else if (maybe_eq (nunits, 4U)) |
| 2299 |
return e.use_exact_insn (code_for_pred_crypto_vvx4_scalar |
| 2300 |
(UNSPEC + 2, UNSPEC + 2, e.vector_mode ())); |
| 2301 |
else if (maybe_eq (nunits, 8U)) |
| 2302 |
return e.use_exact_insn (code_for_pred_crypto_vvx8_scalar |
| 2303 |
(UNSPEC + 2, UNSPEC + 2, e.vector_mode ())); |
| 2304 |
else |
| 2305 |
return e.use_exact_insn (code_for_pred_crypto_vvx16_scalar |
| 2306 |
(UNSPEC + 2, UNSPEC + 2, e.vector_mode ())); |
| 2307 |
default: |
| 2308 |
gcc_unreachable (); |
| 2309 |
} |
| 2310 |
} |
| 2311 |
}; |
| 2312 |
|
| 2313 |
/* Implements vaeskf1/vsm4k. */ |
| 2314 |
template<int UNSPEC> |
| 2315 |
class crypto_vi : public function_base |
| 2316 |
{ |
| 2317 |
public: |
| 2318 |
bool apply_mask_policy_p () const override { return false; } |
| 2319 |
bool use_mask_predication_p () const override { return false; } |
| 2320 |
|
| 2321 |
rtx expand (function_expander &e) const override |
| 2322 |
{ |
| 2323 |
return e.use_exact_insn |
| 2324 |
(code_for_pred_crypto_vi_scalar (UNSPEC, e.vector_mode ())); |
| 2325 |
} |
| 2326 |
}; |
| 2327 |
|
| 2328 |
/* Implements vaeskf2/vsm3c. */ |
| 2329 |
template<int UNSPEC> |
| 2330 |
class vaeskf2_vsm3c : public function_base |
| 2331 |
{ |
| 2332 |
public: |
| 2333 |
bool apply_mask_policy_p () const override { return false; } |
| 2334 |
bool use_mask_predication_p () const override { return false; } |
| 2335 |
bool has_merge_operand_p () const override { return false; } |
| 2336 |
|
| 2337 |
rtx expand (function_expander &e) const override |
| 2338 |
{ |
| 2339 |
return e.use_exact_insn |
| 2340 |
(code_for_pred_vi_nomaskedoff_scalar (UNSPEC, e.vector_mode ())); |
| 2341 |
} |
| 2342 |
}; |
| 2343 |
|
| 2344 |
/* Implements vsm3me. */ |
| 2345 |
class vsm3me : public function_base |
| 2346 |
{ |
| 2347 |
public: |
| 2348 |
bool apply_mask_policy_p () const override { return false; } |
| 2349 |
bool use_mask_predication_p () const override { return false; } |
| 2350 |
|
| 2351 |
rtx expand (function_expander &e) const override |
| 2352 |
{ |
| 2353 |
return e.use_exact_insn (code_for_pred_vsm3me (e.vector_mode ())); |
| 2354 |
} |
| 2355 |
}; |
| 2356 |
|
| 2357 |
/* Implements vfncvtbf16_f. */ |
| 2358 |
template <enum frm_op_type FRM_OP = NO_FRM> |
| 2359 |
class vfncvtbf16_f : public function_base |
| 2360 |
{ |
| 2361 |
public: |
| 2362 |
bool has_rounding_mode_operand_p () const override |
| 2363 |
{ |
| 2364 |
return FRM_OP == HAS_FRM; |
| 2365 |
} |
| 2366 |
|
| 2367 |
bool may_require_frm_p () const override { return true; } |
| 2368 |
|
| 2369 |
rtx expand (function_expander &e) const override |
| 2370 |
{ |
| 2371 |
return e.use_exact_insn (code_for_pred_trunc_to_bf16 (e.vector_mode ())); |
| 2372 |
} |
| 2373 |
}; |
| 2374 |
|
| 2375 |
/* Implements vfwcvtbf16_f. */ |
| 2376 |
class vfwcvtbf16_f : public function_base |
| 2377 |
{ |
| 2378 |
public: |
| 2379 |
rtx expand (function_expander &e) const override |
| 2380 |
{ |
| 2381 |
return e.use_exact_insn (code_for_pred_extend_bf16_to (e.vector_mode ())); |
| 2382 |
} |
| 2383 |
}; |
| 2384 |
|
| 2385 |
/* Implements vfwmaccbf16. */ |
| 2386 |
template <enum frm_op_type FRM_OP = NO_FRM> |
| 2387 |
class vfwmaccbf16 : public function_base |
| 2388 |
{ |
| 2389 |
public: |
| 2390 |
bool has_rounding_mode_operand_p () const override |
| 2391 |
{ |
| 2392 |
return FRM_OP == HAS_FRM; |
| 2393 |
} |
| 2394 |
|
| 2395 |
bool may_require_frm_p () const override { return true; } |
| 2396 |
|
| 2397 |
bool has_merge_operand_p () const override { return false; } |
| 2398 |
|
| 2399 |
rtx expand (function_expander &e) const override |
| 2400 |
{ |
| 2401 |
if (e.op_info->op == OP_TYPE_vf) |
| 2402 |
return e.use_widen_ternop_insn ( |
| 2403 |
code_for_pred_widen_bf16_mul_scalar (e.vector_mode ())); |
| 2404 |
if (e.op_info->op == OP_TYPE_vv) |
| 2405 |
return e.use_widen_ternop_insn ( |
| 2406 |
code_for_pred_widen_bf16_mul (e.vector_mode ())); |
| 2407 |
gcc_unreachable (); |
| 2408 |
} |
| 2409 |
}; |
| 2410 |
|
| 2411 |
static CONSTEXPR const vsetvl<false> vsetvl_obj; |
| 2412 |
static CONSTEXPR const vsetvl<true> vsetvlmax_obj; |
| 2413 |
static CONSTEXPR const loadstore<false, LST_UNIT_STRIDE, false> vle_obj; |
| 2414 |
static CONSTEXPR const loadstore<true, LST_UNIT_STRIDE, false> vse_obj; |
| 2415 |
static CONSTEXPR const loadstore<false, LST_UNIT_STRIDE, false> vlm_obj; |
| 2416 |
static CONSTEXPR const loadstore<true, LST_UNIT_STRIDE, false> vsm_obj; |
| 2417 |
static CONSTEXPR const loadstore<false, LST_STRIDED, false> vlse_obj; |
| 2418 |
static CONSTEXPR const loadstore<true, LST_STRIDED, false> vsse_obj; |
| 2419 |
static CONSTEXPR const loadstore<false, LST_INDEXED, false> vluxei8_obj; |
| 2420 |
static CONSTEXPR const loadstore<false, LST_INDEXED, false> vluxei16_obj; |
| 2421 |
static CONSTEXPR const loadstore<false, LST_INDEXED, false> vluxei32_obj; |
| 2422 |
static CONSTEXPR const loadstore<false, LST_INDEXED, false> vluxei64_obj; |
| 2423 |
static CONSTEXPR const loadstore<false, LST_INDEXED, true> vloxei8_obj; |
| 2424 |
static CONSTEXPR const loadstore<false, LST_INDEXED, true> vloxei16_obj; |
| 2425 |
static CONSTEXPR const loadstore<false, LST_INDEXED, true> vloxei32_obj; |
| 2426 |
static CONSTEXPR const loadstore<false, LST_INDEXED, true> vloxei64_obj; |
| 2427 |
static CONSTEXPR const loadstore<true, LST_INDEXED, false> vsuxei8_obj; |
| 2428 |
static CONSTEXPR const loadstore<true, LST_INDEXED, false> vsuxei16_obj; |
| 2429 |
static CONSTEXPR const loadstore<true, LST_INDEXED, false> vsuxei32_obj; |
| 2430 |
static CONSTEXPR const loadstore<true, LST_INDEXED, false> vsuxei64_obj; |
| 2431 |
static CONSTEXPR const loadstore<true, LST_INDEXED, true> vsoxei8_obj; |
| 2432 |
static CONSTEXPR const loadstore<true, LST_INDEXED, true> vsoxei16_obj; |
| 2433 |
static CONSTEXPR const loadstore<true, LST_INDEXED, true> vsoxei32_obj; |
| 2434 |
static CONSTEXPR const loadstore<true, LST_INDEXED, true> vsoxei64_obj; |
| 2435 |
static CONSTEXPR const binop<PLUS> vadd_obj; |
| 2436 |
static CONSTEXPR const binop<MINUS> vsub_obj; |
| 2437 |
static CONSTEXPR const vrsub vrsub_obj; |
| 2438 |
static CONSTEXPR const binop<AND> vand_obj; |
| 2439 |
static CONSTEXPR const binop<IOR> vor_obj; |
| 2440 |
static CONSTEXPR const binop<XOR> vxor_obj; |
| 2441 |
static CONSTEXPR const binop<ASHIFT> vsll_obj; |
| 2442 |
static CONSTEXPR const binop<ASHIFTRT> vsra_obj; |
| 2443 |
static CONSTEXPR const binop<LSHIFTRT> vsrl_obj; |
| 2444 |
static CONSTEXPR const binop<SMIN> vmin_obj; |
| 2445 |
static CONSTEXPR const binop<SMAX> vmax_obj; |
| 2446 |
static CONSTEXPR const binop<UMIN> vminu_obj; |
| 2447 |
static CONSTEXPR const binop<UMAX> vmaxu_obj; |
| 2448 |
static CONSTEXPR const binop<MULT> vmul_obj; |
| 2449 |
static CONSTEXPR const vmulh<UNSPEC_VMULHS> vmulh_obj; |
| 2450 |
static CONSTEXPR const vmulh<UNSPEC_VMULHU> vmulhu_obj; |
| 2451 |
static CONSTEXPR const vmulh<UNSPEC_VMULHSU> vmulhsu_obj; |
| 2452 |
static CONSTEXPR const binop<DIV> vdiv_obj; |
| 2453 |
static CONSTEXPR const binop<MOD> vrem_obj; |
| 2454 |
static CONSTEXPR const binop<UDIV> vdivu_obj; |
| 2455 |
static CONSTEXPR const binop<UMOD> vremu_obj; |
| 2456 |
static CONSTEXPR const unop<NEG> vneg_obj; |
| 2457 |
static CONSTEXPR const unop<NOT> vnot_obj; |
| 2458 |
static CONSTEXPR const ext<SIGN_EXTEND> vsext_obj; |
| 2459 |
static CONSTEXPR const ext<ZERO_EXTEND> vzext_obj; |
| 2460 |
static CONSTEXPR const widen_binop<PLUS, SIGN_EXTEND>vwadd_obj; |
| 2461 |
static CONSTEXPR const widen_binop<MINUS, SIGN_EXTEND>vwsub_obj; |
| 2462 |
static CONSTEXPR const widen_binop<MULT, SIGN_EXTEND>vwmul_obj; |
| 2463 |
static CONSTEXPR const widen_binop<PLUS, ZERO_EXTEND>vwaddu_obj; |
| 2464 |
static CONSTEXPR const widen_binop<MINUS, ZERO_EXTEND>vwsubu_obj; |
| 2465 |
static CONSTEXPR const widen_binop<MULT, ZERO_EXTEND>vwmulu_obj; |
| 2466 |
static CONSTEXPR const vwmulsu vwmulsu_obj; |
| 2467 |
static CONSTEXPR const vwcvt<SIGN_EXTEND> vwcvt_x_obj; |
| 2468 |
static CONSTEXPR const vwcvt<ZERO_EXTEND> vwcvtu_x_obj; |
| 2469 |
static CONSTEXPR const vadc vadc_obj; |
| 2470 |
static CONSTEXPR const vsbc vsbc_obj; |
| 2471 |
static CONSTEXPR const vmadc vmadc_obj; |
| 2472 |
static CONSTEXPR const vmsbc vmsbc_obj; |
| 2473 |
static CONSTEXPR const vnshift<LSHIFTRT> vnsrl_obj; |
| 2474 |
static CONSTEXPR const vnshift<ASHIFTRT> vnsra_obj; |
| 2475 |
static CONSTEXPR const vncvt_x vncvt_x_obj; |
| 2476 |
static CONSTEXPR const vmerge vmerge_obj; |
| 2477 |
static CONSTEXPR const vmv_v vmv_v_obj; |
| 2478 |
static CONSTEXPR const icmp<EQ> vmseq_obj; |
| 2479 |
static CONSTEXPR const icmp<NE> vmsne_obj; |
| 2480 |
static CONSTEXPR const icmp<LT> vmslt_obj; |
| 2481 |
static CONSTEXPR const icmp<GT> vmsgt_obj; |
| 2482 |
static CONSTEXPR const icmp<LE> vmsle_obj; |
| 2483 |
static CONSTEXPR const icmp<GE> vmsge_obj; |
| 2484 |
static CONSTEXPR const icmp<LTU> vmsltu_obj; |
| 2485 |
static CONSTEXPR const icmp<GTU> vmsgtu_obj; |
| 2486 |
static CONSTEXPR const icmp<LEU> vmsleu_obj; |
| 2487 |
static CONSTEXPR const icmp<GEU> vmsgeu_obj; |
| 2488 |
static CONSTEXPR const vmacc vmacc_obj; |
| 2489 |
static CONSTEXPR const vnmsac vnmsac_obj; |
| 2490 |
static CONSTEXPR const vmadd vmadd_obj; |
| 2491 |
static CONSTEXPR const vnmsub vnmsub_obj; |
| 2492 |
static CONSTEXPR const vwmacc vwmacc_obj; |
| 2493 |
static CONSTEXPR const vwmaccu vwmaccu_obj; |
| 2494 |
static CONSTEXPR const vwmaccsu vwmaccsu_obj; |
| 2495 |
static CONSTEXPR const vwmaccus vwmaccus_obj; |
| 2496 |
static CONSTEXPR const binop<SS_PLUS> vsadd_obj; |
| 2497 |
static CONSTEXPR const binop<SS_MINUS> vssub_obj; |
| 2498 |
static CONSTEXPR const binop<US_PLUS> vsaddu_obj; |
| 2499 |
static CONSTEXPR const binop<US_MINUS> vssubu_obj; |
| 2500 |
static CONSTEXPR const sat_op<UNSPEC_VAADDU> vaaddu_obj; |
| 2501 |
static CONSTEXPR const sat_op<UNSPEC_VAADD> vaadd_obj; |
| 2502 |
static CONSTEXPR const sat_op<UNSPEC_VASUBU> vasubu_obj; |
| 2503 |
static CONSTEXPR const sat_op<UNSPEC_VASUB> vasub_obj; |
| 2504 |
static CONSTEXPR const sat_op<UNSPEC_VSMUL> vsmul_obj; |
| 2505 |
static CONSTEXPR const sat_op<UNSPEC_VSSRL> vssrl_obj; |
| 2506 |
static CONSTEXPR const sat_op<UNSPEC_VSSRA> vssra_obj; |
| 2507 |
static CONSTEXPR const vnclip<UNSPEC_VNCLIP> vnclip_obj; |
| 2508 |
static CONSTEXPR const vnclip<UNSPEC_VNCLIPU> vnclipu_obj; |
| 2509 |
static CONSTEXPR const mask_logic<AND> vmand_obj; |
| 2510 |
static CONSTEXPR const mask_nlogic<AND> vmnand_obj; |
| 2511 |
static CONSTEXPR const mask_notlogic<AND> vmandn_obj; |
| 2512 |
static CONSTEXPR const mask_logic<XOR> vmxor_obj; |
| 2513 |
static CONSTEXPR const mask_logic<IOR> vmor_obj; |
| 2514 |
static CONSTEXPR const mask_nlogic<IOR> vmnor_obj; |
| 2515 |
static CONSTEXPR const mask_notlogic<IOR> vmorn_obj; |
| 2516 |
static CONSTEXPR const mask_nlogic<XOR> vmxnor_obj; |
| 2517 |
static CONSTEXPR const vmmv vmmv_obj; |
| 2518 |
static CONSTEXPR const vmclr vmclr_obj; |
| 2519 |
static CONSTEXPR const vmset vmset_obj; |
| 2520 |
static CONSTEXPR const vmnot vmnot_obj; |
| 2521 |
static CONSTEXPR const vcpop vcpop_obj; |
| 2522 |
static CONSTEXPR const vfirst vfirst_obj; |
| 2523 |
static CONSTEXPR const mask_misc<UNSPEC_VMSBF> vmsbf_obj; |
| 2524 |
static CONSTEXPR const mask_misc<UNSPEC_VMSIF> vmsif_obj; |
| 2525 |
static CONSTEXPR const mask_misc<UNSPEC_VMSOF> vmsof_obj; |
| 2526 |
static CONSTEXPR const viota viota_obj; |
| 2527 |
static CONSTEXPR const vid vid_obj; |
| 2528 |
static CONSTEXPR const binop<PLUS, true> vfadd_obj; |
| 2529 |
static CONSTEXPR const binop<MINUS, true> vfsub_obj; |
| 2530 |
static CONSTEXPR const binop<PLUS, true, HAS_FRM> vfadd_frm_obj; |
| 2531 |
static CONSTEXPR const binop<MINUS, true, HAS_FRM> vfsub_frm_obj; |
| 2532 |
static CONSTEXPR const reverse_binop<MINUS> vfrsub_obj; |
| 2533 |
static CONSTEXPR const reverse_binop<MINUS, HAS_FRM> vfrsub_frm_obj; |
| 2534 |
static CONSTEXPR const widen_binop_fp<PLUS> vfwadd_obj; |
| 2535 |
static CONSTEXPR const widen_binop_fp<PLUS, HAS_FRM> vfwadd_frm_obj; |
| 2536 |
static CONSTEXPR const widen_binop_fp<MINUS> vfwsub_obj; |
| 2537 |
static CONSTEXPR const widen_binop_fp<MINUS, HAS_FRM> vfwsub_frm_obj; |
| 2538 |
static CONSTEXPR const binop<MULT, true> vfmul_obj; |
| 2539 |
static CONSTEXPR const binop<MULT, true, HAS_FRM> vfmul_frm_obj; |
| 2540 |
static CONSTEXPR const binop<DIV, true> vfdiv_obj; |
| 2541 |
static CONSTEXPR const binop<DIV, true, HAS_FRM> vfdiv_frm_obj; |
| 2542 |
static CONSTEXPR const reverse_binop<DIV> vfrdiv_obj; |
| 2543 |
static CONSTEXPR const reverse_binop<DIV, HAS_FRM> vfrdiv_frm_obj; |
| 2544 |
static CONSTEXPR const widen_binop_fp<MULT> vfwmul_obj; |
| 2545 |
static CONSTEXPR const widen_binop_fp<MULT, HAS_FRM> vfwmul_frm_obj; |
| 2546 |
static CONSTEXPR const vfmacc<NO_FRM> vfmacc_obj; |
| 2547 |
static CONSTEXPR const vfmacc<HAS_FRM> vfmacc_frm_obj; |
| 2548 |
static CONSTEXPR const vfnmsac<NO_FRM> vfnmsac_obj; |
| 2549 |
static CONSTEXPR const vfnmsac<HAS_FRM> vfnmsac_frm_obj; |
| 2550 |
static CONSTEXPR const vfmadd<NO_FRM> vfmadd_obj; |
| 2551 |
static CONSTEXPR const vfmadd<HAS_FRM> vfmadd_frm_obj; |
| 2552 |
static CONSTEXPR const vfnmsub<NO_FRM> vfnmsub_obj; |
| 2553 |
static CONSTEXPR const vfnmsub<HAS_FRM> vfnmsub_frm_obj; |
| 2554 |
static CONSTEXPR const vfnmacc<NO_FRM> vfnmacc_obj; |
| 2555 |
static CONSTEXPR const vfnmacc<HAS_FRM> vfnmacc_frm_obj; |
| 2556 |
static CONSTEXPR const vfmsac<NO_FRM> vfmsac_obj; |
| 2557 |
static CONSTEXPR const vfmsac<HAS_FRM> vfmsac_frm_obj; |
| 2558 |
static CONSTEXPR const vfnmadd<NO_FRM> vfnmadd_obj; |
| 2559 |
static CONSTEXPR const vfnmadd<HAS_FRM> vfnmadd_frm_obj; |
| 2560 |
static CONSTEXPR const vfmsub<NO_FRM> vfmsub_obj; |
| 2561 |
static CONSTEXPR const vfmsub<HAS_FRM> vfmsub_frm_obj; |
| 2562 |
static CONSTEXPR const vfwmacc<NO_FRM> vfwmacc_obj; |
| 2563 |
static CONSTEXPR const vfwmacc<HAS_FRM> vfwmacc_frm_obj; |
| 2564 |
static CONSTEXPR const vfwnmacc<NO_FRM> vfwnmacc_obj; |
| 2565 |
static CONSTEXPR const vfwnmacc<HAS_FRM> vfwnmacc_frm_obj; |
| 2566 |
static CONSTEXPR const vfwmsac<NO_FRM> vfwmsac_obj; |
| 2567 |
static CONSTEXPR const vfwmsac<HAS_FRM> vfwmsac_frm_obj; |
| 2568 |
static CONSTEXPR const vfwnmsac<NO_FRM> vfwnmsac_obj; |
| 2569 |
static CONSTEXPR const vfwnmsac<HAS_FRM> vfwnmsac_frm_obj; |
| 2570 |
static CONSTEXPR const unop<SQRT> vfsqrt_obj; |
| 2571 |
static CONSTEXPR const unop<SQRT, HAS_FRM> vfsqrt_frm_obj; |
| 2572 |
static CONSTEXPR const float_misc<UNSPEC_VFRSQRT7> vfrsqrt7_obj; |
| 2573 |
static CONSTEXPR const float_misc<UNSPEC_VFREC7> vfrec7_obj; |
| 2574 |
static CONSTEXPR const float_misc<UNSPEC_VFREC7, HAS_FRM> vfrec7_frm_obj; |
| 2575 |
static CONSTEXPR const binop<SMIN> vfmin_obj; |
| 2576 |
static CONSTEXPR const binop<SMAX> vfmax_obj; |
| 2577 |
static CONSTEXPR const float_misc<UNSPEC_VCOPYSIGN> vfsgnj_obj; |
| 2578 |
static CONSTEXPR const vfsgnjn vfsgnjn_obj; |
| 2579 |
static CONSTEXPR const float_misc<UNSPEC_VXORSIGN> vfsgnjx_obj; |
| 2580 |
static CONSTEXPR const unop<NEG> vfneg_obj; |
| 2581 |
static CONSTEXPR const unop<ABS> vfabs_obj; |
| 2582 |
static CONSTEXPR const fcmp<EQ> vmfeq_obj; |
| 2583 |
static CONSTEXPR const fcmp<NE> vmfne_obj; |
| 2584 |
static CONSTEXPR const fcmp<LT> vmflt_obj; |
| 2585 |
static CONSTEXPR const fcmp<GT> vmfgt_obj; |
| 2586 |
static CONSTEXPR const fcmp<LE> vmfle_obj; |
| 2587 |
static CONSTEXPR const fcmp<GE> vmfge_obj; |
| 2588 |
static CONSTEXPR const vfclass vfclass_obj; |
| 2589 |
static CONSTEXPR const vmerge vfmerge_obj; |
| 2590 |
static CONSTEXPR const vmv_v vfmv_v_obj; |
| 2591 |
static CONSTEXPR const vfcvt_x<UNSPEC_VFCVT> vfcvt_x_obj; |
| 2592 |
static CONSTEXPR const vfcvt_x<UNSPEC_VFCVT, HAS_FRM> vfcvt_x_frm_obj; |
| 2593 |
static CONSTEXPR const vfcvt_x<UNSPEC_UNSIGNED_VFCVT> vfcvt_xu_obj; |
| 2594 |
static CONSTEXPR const vfcvt_x<UNSPEC_UNSIGNED_VFCVT, HAS_FRM> vfcvt_xu_frm_obj; |
| 2595 |
static CONSTEXPR const vfcvt_rtz_x<FIX> vfcvt_rtz_x_obj; |
| 2596 |
static CONSTEXPR const vfcvt_rtz_x<UNSIGNED_FIX> vfcvt_rtz_xu_obj; |
| 2597 |
static CONSTEXPR const vfcvt_f<NO_FRM> vfcvt_f_obj; |
| 2598 |
static CONSTEXPR const vfcvt_f<HAS_FRM> vfcvt_f_frm_obj; |
| 2599 |
static CONSTEXPR const vfwcvt_x<UNSPEC_VFCVT> vfwcvt_x_obj; |
| 2600 |
static CONSTEXPR const vfwcvt_x<UNSPEC_VFCVT, HAS_FRM> vfwcvt_x_frm_obj; |
| 2601 |
static CONSTEXPR const vfwcvt_x<UNSPEC_UNSIGNED_VFCVT> vfwcvt_xu_obj; |
| 2602 |
static CONSTEXPR const vfwcvt_x<UNSPEC_UNSIGNED_VFCVT, HAS_FRM> vfwcvt_xu_frm_obj; |
| 2603 |
static CONSTEXPR const vfwcvt_rtz_x<FIX> vfwcvt_rtz_x_obj; |
| 2604 |
static CONSTEXPR const vfwcvt_rtz_x<UNSIGNED_FIX> vfwcvt_rtz_xu_obj; |
| 2605 |
static CONSTEXPR const vfwcvt_f vfwcvt_f_obj; |
| 2606 |
static CONSTEXPR const vfncvt_x<UNSPEC_VFCVT> vfncvt_x_obj; |
| 2607 |
static CONSTEXPR const vfncvt_x<UNSPEC_VFCVT, HAS_FRM> vfncvt_x_frm_obj; |
| 2608 |
static CONSTEXPR const vfncvt_x<UNSPEC_UNSIGNED_VFCVT> vfncvt_xu_obj; |
| 2609 |
static CONSTEXPR const vfncvt_x<UNSPEC_UNSIGNED_VFCVT, HAS_FRM> vfncvt_xu_frm_obj; |
| 2610 |
static CONSTEXPR const vfncvt_rtz_x<FIX> vfncvt_rtz_x_obj; |
| 2611 |
static CONSTEXPR const vfncvt_rtz_x<UNSIGNED_FIX> vfncvt_rtz_xu_obj; |
| 2612 |
static CONSTEXPR const vfncvt_f<NO_FRM> vfncvt_f_obj; |
| 2613 |
static CONSTEXPR const vfncvt_f<HAS_FRM> vfncvt_f_frm_obj; |
| 2614 |
static CONSTEXPR const vfncvt_rod_f vfncvt_rod_f_obj; |
| 2615 |
static CONSTEXPR const reducop<UNSPEC_REDUC_SUM> vredsum_obj; |
| 2616 |
static CONSTEXPR const reducop<UNSPEC_REDUC_MAXU> vredmaxu_obj; |
| 2617 |
static CONSTEXPR const reducop<UNSPEC_REDUC_MAX> vredmax_obj; |
| 2618 |
static CONSTEXPR const reducop<UNSPEC_REDUC_MINU> vredminu_obj; |
| 2619 |
static CONSTEXPR const reducop<UNSPEC_REDUC_MIN> vredmin_obj; |
| 2620 |
static CONSTEXPR const reducop<UNSPEC_REDUC_AND> vredand_obj; |
| 2621 |
static CONSTEXPR const reducop<UNSPEC_REDUC_OR> vredor_obj; |
| 2622 |
static CONSTEXPR const reducop<UNSPEC_REDUC_XOR> vredxor_obj; |
| 2623 |
static CONSTEXPR const reducop<UNSPEC_WREDUC_SUM> vwredsum_obj; |
| 2624 |
static CONSTEXPR const reducop<UNSPEC_WREDUC_SUMU> vwredsumu_obj; |
| 2625 |
static CONSTEXPR const freducop<UNSPEC_REDUC_SUM_UNORDERED> vfredusum_obj; |
| 2626 |
static CONSTEXPR const freducop<UNSPEC_REDUC_SUM_UNORDERED, HAS_FRM> vfredusum_frm_obj; |
| 2627 |
static CONSTEXPR const freducop<UNSPEC_REDUC_SUM_ORDERED> vfredosum_obj; |
| 2628 |
static CONSTEXPR const freducop<UNSPEC_REDUC_SUM_ORDERED, HAS_FRM> vfredosum_frm_obj; |
| 2629 |
static CONSTEXPR const reducop<UNSPEC_REDUC_MAX> vfredmax_obj; |
| 2630 |
static CONSTEXPR const reducop<UNSPEC_REDUC_MIN> vfredmin_obj; |
| 2631 |
static CONSTEXPR const freducop<UNSPEC_WREDUC_SUM_UNORDERED> vfwredusum_obj; |
| 2632 |
static CONSTEXPR const freducop<UNSPEC_WREDUC_SUM_UNORDERED, HAS_FRM> vfwredusum_frm_obj; |
| 2633 |
static CONSTEXPR const freducop<UNSPEC_WREDUC_SUM_ORDERED> vfwredosum_obj; |
| 2634 |
static CONSTEXPR const freducop<UNSPEC_WREDUC_SUM_ORDERED, HAS_FRM> vfwredosum_frm_obj; |
| 2635 |
static CONSTEXPR const vmv vmv_x_obj; |
| 2636 |
static CONSTEXPR const vmv_s vmv_s_obj; |
| 2637 |
static CONSTEXPR const vmv vfmv_f_obj; |
| 2638 |
static CONSTEXPR const vmv_s vfmv_s_obj; |
| 2639 |
static CONSTEXPR const slideop<UNSPEC_VSLIDEUP> vslideup_obj; |
| 2640 |
static CONSTEXPR const slideop<UNSPEC_VSLIDEDOWN> vslidedown_obj; |
| 2641 |
static CONSTEXPR const slideop<UNSPEC_VSLIDE1UP> vslide1up_obj; |
| 2642 |
static CONSTEXPR const slideop<UNSPEC_VSLIDE1DOWN> vslide1down_obj; |
| 2643 |
static CONSTEXPR const slideop<UNSPEC_VFSLIDE1UP> vfslide1up_obj; |
| 2644 |
static CONSTEXPR const slideop<UNSPEC_VFSLIDE1DOWN> vfslide1down_obj; |
| 2645 |
static CONSTEXPR const vrgather vrgather_obj; |
| 2646 |
static CONSTEXPR const vrgatherei16 vrgatherei16_obj; |
| 2647 |
static CONSTEXPR const vcompress vcompress_obj; |
| 2648 |
static CONSTEXPR const vundefined vundefined_obj; |
| 2649 |
static CONSTEXPR const vreinterpret vreinterpret_obj; |
| 2650 |
static CONSTEXPR const vlmul_ext vlmul_ext_obj; |
| 2651 |
static CONSTEXPR const vlmul_trunc vlmul_trunc_obj; |
| 2652 |
static CONSTEXPR const vset vset_obj; |
| 2653 |
static CONSTEXPR const vget vget_obj; |
| 2654 |
static CONSTEXPR const vcreate vcreate_obj; |
| 2655 |
static CONSTEXPR const read_vl read_vl_obj; |
| 2656 |
static CONSTEXPR const vleff vleff_obj; |
| 2657 |
static CONSTEXPR const vlenb vlenb_obj; |
| 2658 |
static CONSTEXPR const vlseg vlseg_obj; |
| 2659 |
static CONSTEXPR const vsseg vsseg_obj; |
| 2660 |
static CONSTEXPR const vlsseg vlsseg_obj; |
| 2661 |
static CONSTEXPR const vssseg vssseg_obj; |
| 2662 |
static CONSTEXPR const seg_indexed_load<UNSPEC_UNORDERED> vluxseg_obj; |
| 2663 |
static CONSTEXPR const seg_indexed_load<UNSPEC_ORDERED> vloxseg_obj; |
| 2664 |
static CONSTEXPR const seg_indexed_store<UNSPEC_UNORDERED> vsuxseg_obj; |
| 2665 |
static CONSTEXPR const seg_indexed_store<UNSPEC_ORDERED> vsoxseg_obj; |
| 2666 |
static CONSTEXPR const vlsegff vlsegff_obj; |
| 2667 |
static CONSTEXPR const th_loadstore_width<false, LST_UNIT_STRIDE, UNSPEC_TH_VLB> vlb_obj; |
| 2668 |
static CONSTEXPR const th_loadstore_width<false, LST_UNIT_STRIDE, UNSPEC_TH_VLBU> vlbu_obj; |
| 2669 |
static CONSTEXPR const th_loadstore_width<false, LST_UNIT_STRIDE, UNSPEC_TH_VLH> vlh_obj; |
| 2670 |
static CONSTEXPR const th_loadstore_width<false, LST_UNIT_STRIDE, UNSPEC_TH_VLHU> vlhu_obj; |
| 2671 |
static CONSTEXPR const th_loadstore_width<false, LST_UNIT_STRIDE, UNSPEC_TH_VLW> vlw_obj; |
| 2672 |
static CONSTEXPR const th_loadstore_width<false, LST_UNIT_STRIDE, UNSPEC_TH_VLWU> vlwu_obj; |
| 2673 |
static CONSTEXPR const th_loadstore_width<true, LST_UNIT_STRIDE, UNSPEC_TH_VLB> vsb_obj; |
| 2674 |
static CONSTEXPR const th_loadstore_width<true, LST_UNIT_STRIDE, UNSPEC_TH_VLH> vsh_obj; |
| 2675 |
static CONSTEXPR const th_loadstore_width<true, LST_UNIT_STRIDE, UNSPEC_TH_VLW> vsw_obj; |
| 2676 |
static CONSTEXPR const th_loadstore_width<false, LST_STRIDED, UNSPEC_TH_VLSB> vlsb_obj; |
| 2677 |
static CONSTEXPR const th_loadstore_width<false, LST_STRIDED, UNSPEC_TH_VLSBU> vlsbu_obj; |
| 2678 |
static CONSTEXPR const th_loadstore_width<false, LST_STRIDED, UNSPEC_TH_VLSH> vlsh_obj; |
| 2679 |
static CONSTEXPR const th_loadstore_width<false, LST_STRIDED, UNSPEC_TH_VLSHU> vlshu_obj; |
| 2680 |
static CONSTEXPR const th_loadstore_width<false, LST_STRIDED, UNSPEC_TH_VLSW> vlsw_obj; |
| 2681 |
static CONSTEXPR const th_loadstore_width<false, LST_STRIDED, UNSPEC_TH_VLSWU> vlswu_obj; |
| 2682 |
static CONSTEXPR const th_loadstore_width<true, LST_STRIDED, UNSPEC_TH_VLSB> vssb_obj; |
| 2683 |
static CONSTEXPR const th_loadstore_width<true, LST_STRIDED, UNSPEC_TH_VLSH> vssh_obj; |
| 2684 |
static CONSTEXPR const th_loadstore_width<true, LST_STRIDED, UNSPEC_TH_VLSW> vssw_obj; |
| 2685 |
static CONSTEXPR const th_loadstore_width<false, LST_INDEXED, UNSPEC_TH_VLXB> vlxb_obj; |
| 2686 |
static CONSTEXPR const th_loadstore_width<false, LST_INDEXED, UNSPEC_TH_VLXBU> vlxbu_obj; |
| 2687 |
static CONSTEXPR const th_loadstore_width<false, LST_INDEXED, UNSPEC_TH_VLXH> vlxh_obj; |
| 2688 |
static CONSTEXPR const th_loadstore_width<false, LST_INDEXED, UNSPEC_TH_VLXHU> vlxhu_obj; |
| 2689 |
static CONSTEXPR const th_loadstore_width<false, LST_INDEXED, UNSPEC_TH_VLXW> vlxw_obj; |
| 2690 |
static CONSTEXPR const th_loadstore_width<false, LST_INDEXED, UNSPEC_TH_VLXWU> vlxwu_obj; |
| 2691 |
static CONSTEXPR const th_loadstore_width<true, LST_INDEXED, UNSPEC_TH_VLXB> vsxb_obj; |
| 2692 |
static CONSTEXPR const th_loadstore_width<true, LST_INDEXED, UNSPEC_TH_VLXH> vsxh_obj; |
| 2693 |
static CONSTEXPR const th_loadstore_width<true, LST_INDEXED, UNSPEC_TH_VLXW> vsxw_obj; |
| 2694 |
static CONSTEXPR const th_loadstore_width<true, LST_INDEXED, UNSPEC_TH_VSUXB> vsuxb_obj; |
| 2695 |
static CONSTEXPR const th_loadstore_width<true, LST_INDEXED, UNSPEC_TH_VSUXH> vsuxh_obj; |
| 2696 |
static CONSTEXPR const th_loadstore_width<true, LST_INDEXED, UNSPEC_TH_VSUXW> vsuxw_obj; |
| 2697 |
static CONSTEXPR const th_extract vext_x_v_obj; |
| 2698 |
|
| 2699 |
/* Crypto Vector */ |
| 2700 |
static CONSTEXPR const vandn vandn_obj; |
| 2701 |
static CONSTEXPR const bitmanip<ROTATE> vrol_obj; |
| 2702 |
static CONSTEXPR const bitmanip<ROTATERT> vror_obj; |
| 2703 |
static CONSTEXPR const b_reverse<UNSPEC_VBREV> vbrev_obj; |
| 2704 |
static CONSTEXPR const b_reverse<UNSPEC_VBREV8> vbrev8_obj; |
| 2705 |
static CONSTEXPR const b_reverse<UNSPEC_VREV8> vrev8_obj; |
| 2706 |
static CONSTEXPR const bitmanip<CLZ> vclz_obj; |
| 2707 |
static CONSTEXPR const bitmanip<CTZ> vctz_obj; |
| 2708 |
static CONSTEXPR const vwsll vwsll_obj; |
| 2709 |
static CONSTEXPR const clmul<UNSPEC_VCLMUL> vclmul_obj; |
| 2710 |
static CONSTEXPR const clmul<UNSPEC_VCLMULH> vclmulh_obj; |
| 2711 |
static CONSTEXPR const vg_nhab<UNSPEC_VGHSH> vghsh_obj; |
| 2712 |
static CONSTEXPR const crypto_vv<UNSPEC_VGMUL> vgmul_obj; |
| 2713 |
static CONSTEXPR const crypto_vv<UNSPEC_VAESEF> vaesef_obj; |
| 2714 |
static CONSTEXPR const crypto_vv<UNSPEC_VAESEM> vaesem_obj; |
| 2715 |
static CONSTEXPR const crypto_vv<UNSPEC_VAESDF> vaesdf_obj; |
| 2716 |
static CONSTEXPR const crypto_vv<UNSPEC_VAESDM> vaesdm_obj; |
| 2717 |
static CONSTEXPR const crypto_vv<UNSPEC_VAESZ> vaesz_obj; |
| 2718 |
static CONSTEXPR const crypto_vi<UNSPEC_VAESKF1> vaeskf1_obj; |
| 2719 |
static CONSTEXPR const vaeskf2_vsm3c<UNSPEC_VAESKF2> vaeskf2_obj; |
| 2720 |
static CONSTEXPR const vg_nhab<UNSPEC_VSHA2MS> vsha2ms_obj; |
| 2721 |
static CONSTEXPR const vg_nhab<UNSPEC_VSHA2CH> vsha2ch_obj; |
| 2722 |
static CONSTEXPR const vg_nhab<UNSPEC_VSHA2CL> vsha2cl_obj; |
| 2723 |
static CONSTEXPR const crypto_vi<UNSPEC_VSM4K> vsm4k_obj; |
| 2724 |
static CONSTEXPR const crypto_vv<UNSPEC_VSM4R> vsm4r_obj; |
| 2725 |
static CONSTEXPR const vsm3me vsm3me_obj; |
| 2726 |
static CONSTEXPR const vaeskf2_vsm3c<UNSPEC_VSM3C> vsm3c_obj; |
| 2727 |
|
| 2728 |
/* Zvfbfmin */ |
| 2729 |
static CONSTEXPR const vfncvtbf16_f<NO_FRM> vfncvtbf16_f_obj; |
| 2730 |
static CONSTEXPR const vfncvtbf16_f<HAS_FRM> vfncvtbf16_f_frm_obj; |
| 2731 |
static CONSTEXPR const vfwcvtbf16_f vfwcvtbf16_f_obj; |
| 2732 |
/* Zvfbfwma; */ |
| 2733 |
static CONSTEXPR const vfwmaccbf16<NO_FRM> vfwmaccbf16_obj; |
| 2734 |
static CONSTEXPR const vfwmaccbf16<HAS_FRM> vfwmaccbf16_frm_obj; |
| 2735 |
|
| 2736 |
/* Declare the function base NAME, pointing it to an instance |
| 2737 |
of class <NAME>_obj. */ |
| 2738 |
#define BASE(NAME) \ |
| 2739 |
namespace bases { const function_base *const NAME = &NAME##_obj; } |
| 2740 |
|
| 2741 |
BASE (vsetvl) |
| 2742 |
BASE (vsetvlmax) |
| 2743 |
BASE (vle) |
| 2744 |
BASE (vse) |
| 2745 |
BASE (vlm) |
| 2746 |
BASE (vsm) |
| 2747 |
BASE (vlse) |
| 2748 |
BASE (vsse) |
| 2749 |
BASE (vluxei8) |
| 2750 |
BASE (vluxei16) |
| 2751 |
BASE (vluxei32) |
| 2752 |
BASE (vluxei64) |
| 2753 |
BASE (vloxei8) |
| 2754 |
BASE (vloxei16) |
| 2755 |
BASE (vloxei32) |
| 2756 |
BASE (vloxei64) |
| 2757 |
BASE (vsuxei8) |
| 2758 |
BASE (vsuxei16) |
| 2759 |
BASE (vsuxei32) |
| 2760 |
BASE (vsuxei64) |
| 2761 |
BASE (vsoxei8) |
| 2762 |
BASE (vsoxei16) |
| 2763 |
BASE (vsoxei32) |
| 2764 |
BASE (vsoxei64) |
| 2765 |
BASE (vadd) |
| 2766 |
BASE (vsub) |
| 2767 |
BASE (vrsub) |
| 2768 |
BASE (vand) |
| 2769 |
BASE (vor) |
| 2770 |
BASE (vxor) |
| 2771 |
BASE (vsll) |
| 2772 |
BASE (vsra) |
| 2773 |
BASE (vsrl) |
| 2774 |
BASE (vmin) |
| 2775 |
BASE (vmax) |
| 2776 |
BASE (vminu) |
| 2777 |
BASE (vmaxu) |
| 2778 |
BASE (vmul) |
| 2779 |
BASE (vmulh) |
| 2780 |
BASE (vmulhu) |
| 2781 |
BASE (vmulhsu) |
| 2782 |
BASE (vdiv) |
| 2783 |
BASE (vrem) |
| 2784 |
BASE (vdivu) |
| 2785 |
BASE (vremu) |
| 2786 |
BASE (vneg) |
| 2787 |
BASE (vnot) |
| 2788 |
BASE (vsext) |
| 2789 |
BASE (vzext) |
| 2790 |
BASE (vwadd) |
| 2791 |
BASE (vwsub) |
| 2792 |
BASE (vwmul) |
| 2793 |
BASE (vwaddu) |
| 2794 |
BASE (vwsubu) |
| 2795 |
BASE (vwmulu) |
| 2796 |
BASE (vwmulsu) |
| 2797 |
BASE (vwcvt_x) |
| 2798 |
BASE (vwcvtu_x) |
| 2799 |
BASE (vadc) |
| 2800 |
BASE (vsbc) |
| 2801 |
BASE (vmadc) |
| 2802 |
BASE (vmsbc) |
| 2803 |
BASE (vnsrl) |
| 2804 |
BASE (vnsra) |
| 2805 |
BASE (vncvt_x) |
| 2806 |
BASE (vmerge) |
| 2807 |
BASE (vmv_v) |
| 2808 |
BASE (vmseq) |
| 2809 |
BASE (vmsne) |
| 2810 |
BASE (vmslt) |
| 2811 |
BASE (vmsgt) |
| 2812 |
BASE (vmsle) |
| 2813 |
BASE (vmsge) |
| 2814 |
BASE (vmsltu) |
| 2815 |
BASE (vmsgtu) |
| 2816 |
BASE (vmsleu) |
| 2817 |
BASE (vmsgeu) |
| 2818 |
BASE (vmacc) |
| 2819 |
BASE (vnmsac) |
| 2820 |
BASE (vmadd) |
| 2821 |
BASE (vnmsub) |
| 2822 |
BASE (vwmacc) |
| 2823 |
BASE (vwmaccu) |
| 2824 |
BASE (vwmaccsu) |
| 2825 |
BASE (vwmaccus) |
| 2826 |
BASE (vsadd) |
| 2827 |
BASE (vssub) |
| 2828 |
BASE (vsaddu) |
| 2829 |
BASE (vssubu) |
| 2830 |
BASE (vaadd) |
| 2831 |
BASE (vasub) |
| 2832 |
BASE (vaaddu) |
| 2833 |
BASE (vasubu) |
| 2834 |
BASE (vsmul) |
| 2835 |
BASE (vssra) |
| 2836 |
BASE (vssrl) |
| 2837 |
BASE (vnclip) |
| 2838 |
BASE (vnclipu) |
| 2839 |
BASE (vmand) |
| 2840 |
BASE (vmnand) |
| 2841 |
BASE (vmandn) |
| 2842 |
BASE (vmxor) |
| 2843 |
BASE (vmor) |
| 2844 |
BASE (vmnor) |
| 2845 |
BASE (vmorn) |
| 2846 |
BASE (vmxnor) |
| 2847 |
BASE (vmmv) |
| 2848 |
BASE (vmclr) |
| 2849 |
BASE (vmset) |
| 2850 |
BASE (vmnot) |
| 2851 |
BASE (vcpop) |
| 2852 |
BASE (vfirst) |
| 2853 |
BASE (vmsbf) |
| 2854 |
BASE (vmsif) |
| 2855 |
BASE (vmsof) |
| 2856 |
BASE (viota) |
| 2857 |
BASE (vid) |
| 2858 |
BASE (vfadd) |
| 2859 |
BASE (vfadd_frm) |
| 2860 |
BASE (vfsub) |
| 2861 |
BASE (vfsub_frm) |
| 2862 |
BASE (vfrsub) |
| 2863 |
BASE (vfrsub_frm) |
| 2864 |
BASE (vfwadd) |
| 2865 |
BASE (vfwadd_frm) |
| 2866 |
BASE (vfwsub) |
| 2867 |
BASE (vfwsub_frm) |
| 2868 |
BASE (vfmul) |
| 2869 |
BASE (vfmul_frm) |
| 2870 |
BASE (vfdiv) |
| 2871 |
BASE (vfdiv_frm) |
| 2872 |
BASE (vfrdiv) |
| 2873 |
BASE (vfrdiv_frm) |
| 2874 |
BASE (vfwmul) |
| 2875 |
BASE (vfwmul_frm) |
| 2876 |
BASE (vfmacc) |
| 2877 |
BASE (vfmacc_frm) |
| 2878 |
BASE (vfnmsac) |
| 2879 |
BASE (vfnmsac_frm) |
| 2880 |
BASE (vfmadd) |
| 2881 |
BASE (vfmadd_frm) |
| 2882 |
BASE (vfnmsub) |
| 2883 |
BASE (vfnmsub_frm) |
| 2884 |
BASE (vfnmacc) |
| 2885 |
BASE (vfnmacc_frm) |
| 2886 |
BASE (vfmsac) |
| 2887 |
BASE (vfmsac_frm) |
| 2888 |
BASE (vfnmadd) |
| 2889 |
BASE (vfnmadd_frm) |
| 2890 |
BASE (vfmsub) |
| 2891 |
BASE (vfmsub_frm) |
| 2892 |
BASE (vfwmacc) |
| 2893 |
BASE (vfwmacc_frm) |
| 2894 |
BASE (vfwnmacc) |
| 2895 |
BASE (vfwnmacc_frm) |
| 2896 |
BASE (vfwmsac) |
| 2897 |
BASE (vfwmsac_frm) |
| 2898 |
BASE (vfwnmsac) |
| 2899 |
BASE (vfwnmsac_frm) |
| 2900 |
BASE (vfsqrt) |
| 2901 |
BASE (vfsqrt_frm) |
| 2902 |
BASE (vfrsqrt7) |
| 2903 |
BASE (vfrec7) |
| 2904 |
BASE (vfrec7_frm) |
| 2905 |
BASE (vfmin) |
| 2906 |
BASE (vfmax) |
| 2907 |
BASE (vfsgnj) |
| 2908 |
BASE (vfsgnjn) |
| 2909 |
BASE (vfsgnjx) |
| 2910 |
BASE (vfneg) |
| 2911 |
BASE (vfabs) |
| 2912 |
BASE (vmfeq) |
| 2913 |
BASE (vmfne) |
| 2914 |
BASE (vmflt) |
| 2915 |
BASE (vmfgt) |
| 2916 |
BASE (vmfle) |
| 2917 |
BASE (vmfge) |
| 2918 |
BASE (vfclass) |
| 2919 |
BASE (vfmerge) |
| 2920 |
BASE (vfmv_v) |
| 2921 |
BASE (vfcvt_x) |
| 2922 |
BASE (vfcvt_x_frm) |
| 2923 |
BASE (vfcvt_xu) |
| 2924 |
BASE (vfcvt_xu_frm) |
| 2925 |
BASE (vfcvt_rtz_x) |
| 2926 |
BASE (vfcvt_rtz_xu) |
| 2927 |
BASE (vfcvt_f) |
| 2928 |
BASE (vfcvt_f_frm) |
| 2929 |
BASE (vfwcvt_x) |
| 2930 |
BASE (vfwcvt_x_frm) |
| 2931 |
BASE (vfwcvt_xu) |
| 2932 |
BASE (vfwcvt_xu_frm) |
| 2933 |
BASE (vfwcvt_rtz_x) |
| 2934 |
BASE (vfwcvt_rtz_xu) |
| 2935 |
BASE (vfwcvt_f) |
| 2936 |
BASE (vfncvt_x) |
| 2937 |
BASE (vfncvt_x_frm) |
| 2938 |
BASE (vfncvt_xu) |
| 2939 |
BASE (vfncvt_xu_frm) |
| 2940 |
BASE (vfncvt_rtz_x) |
| 2941 |
BASE (vfncvt_rtz_xu) |
| 2942 |
BASE (vfncvt_f) |
| 2943 |
BASE (vfncvt_f_frm) |
| 2944 |
BASE (vfncvt_rod_f) |
| 2945 |
BASE (vredsum) |
| 2946 |
BASE (vredmaxu) |
| 2947 |
BASE (vredmax) |
| 2948 |
BASE (vredminu) |
| 2949 |
BASE (vredmin) |
| 2950 |
BASE (vredand) |
| 2951 |
BASE (vredor) |
| 2952 |
BASE (vredxor) |
| 2953 |
BASE (vwredsum) |
| 2954 |
BASE (vwredsumu) |
| 2955 |
BASE (vfredusum) |
| 2956 |
BASE (vfredusum_frm) |
| 2957 |
BASE (vfredosum) |
| 2958 |
BASE (vfredosum_frm) |
| 2959 |
BASE (vfredmax) |
| 2960 |
BASE (vfredmin) |
| 2961 |
BASE (vfwredosum) |
| 2962 |
BASE (vfwredosum_frm) |
| 2963 |
BASE (vfwredusum) |
| 2964 |
BASE (vfwredusum_frm) |
| 2965 |
BASE (vmv_x) |
| 2966 |
BASE (vmv_s) |
| 2967 |
BASE (vfmv_f) |
| 2968 |
BASE (vfmv_s) |
| 2969 |
BASE (vslideup) |
| 2970 |
BASE (vslidedown) |
| 2971 |
BASE (vslide1up) |
| 2972 |
BASE (vslide1down) |
| 2973 |
BASE (vfslide1up) |
| 2974 |
BASE (vfslide1down) |
| 2975 |
BASE (vrgather) |
| 2976 |
BASE (vrgatherei16) |
| 2977 |
BASE (vcompress) |
| 2978 |
BASE (vundefined) |
| 2979 |
BASE (vreinterpret) |
| 2980 |
BASE (vlmul_ext) |
| 2981 |
BASE (vlmul_trunc) |
| 2982 |
BASE (vset) |
| 2983 |
BASE (vget) |
| 2984 |
BASE (vcreate) |
| 2985 |
BASE (read_vl) |
| 2986 |
BASE (vleff) |
| 2987 |
BASE (vlenb) |
| 2988 |
BASE (vlseg) |
| 2989 |
BASE (vsseg) |
| 2990 |
BASE (vlsseg) |
| 2991 |
BASE (vssseg) |
| 2992 |
BASE (vluxseg) |
| 2993 |
BASE (vloxseg) |
| 2994 |
BASE (vsuxseg) |
| 2995 |
BASE (vsoxseg) |
| 2996 |
BASE (vlsegff) |
| 2997 |
BASE (vlb) |
| 2998 |
BASE (vlh) |
| 2999 |
BASE (vlw) |
| 3000 |
BASE (vlbu) |
| 3001 |
BASE (vlhu) |
| 3002 |
BASE (vlwu) |
| 3003 |
BASE (vsb) |
| 3004 |
BASE (vsh) |
| 3005 |
BASE (vsw) |
| 3006 |
BASE (vlsb) |
| 3007 |
BASE (vlsh) |
| 3008 |
BASE (vlsw) |
| 3009 |
BASE (vlsbu) |
| 3010 |
BASE (vlshu) |
| 3011 |
BASE (vlswu) |
| 3012 |
BASE (vssb) |
| 3013 |
BASE (vssh) |
| 3014 |
BASE (vssw) |
| 3015 |
BASE (vlxb) |
| 3016 |
BASE (vlxh) |
| 3017 |
BASE (vlxw) |
| 3018 |
BASE (vlxbu) |
| 3019 |
BASE (vlxhu) |
| 3020 |
BASE (vlxwu) |
| 3021 |
BASE (vsxb) |
| 3022 |
BASE (vsxh) |
| 3023 |
BASE (vsxw) |
| 3024 |
BASE (vsuxb) |
| 3025 |
BASE (vsuxh) |
| 3026 |
BASE (vsuxw) |
| 3027 |
BASE (vext_x_v) |
| 3028 |
/* Crypto vector */ |
| 3029 |
BASE (vandn) |
| 3030 |
BASE (vbrev) |
| 3031 |
BASE (vbrev8) |
| 3032 |
BASE (vrev8) |
| 3033 |
BASE (vclz) |
| 3034 |
BASE (vctz) |
| 3035 |
BASE (vrol) |
| 3036 |
BASE (vror) |
| 3037 |
BASE (vwsll) |
| 3038 |
BASE (vclmul) |
| 3039 |
BASE (vclmulh) |
| 3040 |
BASE (vghsh) |
| 3041 |
BASE (vgmul) |
| 3042 |
BASE (vaesef) |
| 3043 |
BASE (vaesem) |
| 3044 |
BASE (vaesdf) |
| 3045 |
BASE (vaesdm) |
| 3046 |
BASE (vaesz) |
| 3047 |
BASE (vaeskf1) |
| 3048 |
BASE (vaeskf2) |
| 3049 |
BASE (vsha2ms) |
| 3050 |
BASE (vsha2ch) |
| 3051 |
BASE (vsha2cl) |
| 3052 |
BASE (vsm4k) |
| 3053 |
BASE (vsm4r) |
| 3054 |
BASE (vsm3me) |
| 3055 |
BASE (vsm3c) |
| 3056 |
/* Zvfbfmin */ |
| 3057 |
BASE (vfncvtbf16_f) |
| 3058 |
BASE (vfncvtbf16_f_frm) |
| 3059 |
BASE (vfwcvtbf16_f) |
| 3060 |
/* Zvfbfwma */ |
| 3061 |
BASE (vfwmaccbf16) |
| 3062 |
BASE (vfwmaccbf16_frm) |
| 3063 |
} // end namespace riscv_vector |