-
- Downloads
RISC-V: Refactor RVV frm_mode attr for rounding mode intrinsic
The frm_mode attr has some assumptions for each define insn as below. 1. The define insn has at least 9 operands. 2. The operands[9] must be frm reg. 3. The operands[9] must be const int. Actually, the frm operand can be operands[8], operands[9] or operands[10], and not all the define insn has frm operands. This patch would like to refactor frm and eliminate the above assumptions, as well as unblock the underlying rounding mode intrinsic API support. After refactor, the default frm will be none, and the selected insn type will be dyn. For the floating point which honors the frm, we will set the frm_mode attr explicitly in define_insn. Signed-off-by:Pan Li <pan2.li@intel.com> Co-Authored-by:
Kito Cheng <kito.cheng@sifive.com> gcc/ChangeLog: * config/riscv/riscv-protos.h (enum floating_point_rounding_mode): Add NONE, DYN_EXIT and DYN_CALL. (get_frm_mode): New declaration. * config/riscv/riscv-v.cc (get_frm_mode): New function to get frm mode. * config/riscv/riscv-vector-builtins.cc (function_expander::use_ternop_insn): Take care of frm reg. * config/riscv/riscv.cc (riscv_static_frm_mode_p): Migrate to FRM_XXX. (riscv_emit_frm_mode_set): Ditto. (riscv_emit_mode_set): Ditto. (riscv_frm_adjust_mode_after_call): Ditto. (riscv_frm_mode_needed): Ditto. (riscv_frm_mode_after): Ditto. (riscv_mode_entry): Ditto. (riscv_mode_exit): Ditto. * config/riscv/riscv.h (NUM_MODES_FOR_MODE_SWITCHING): Ditto. * config/riscv/vector.md (rne,rtz,rdn,rup,rmm,dyn,dyn_exit,dyn_call,none): Removed (symbol_ref): * config/riscv/vector.md: Set frm_mode attr explicitly.
Showing
- gcc/config/riscv/riscv-protos.h 4 additions, 0 deletionsgcc/config/riscv/riscv-protos.h
- gcc/config/riscv/riscv-v.cc 29 additions, 0 deletionsgcc/config/riscv/riscv-v.cc
- gcc/config/riscv/riscv-vector-builtins.cc 17 additions, 5 deletionsgcc/config/riscv/riscv-vector-builtins.cc
- gcc/config/riscv/riscv.cc 21 additions, 25 deletionsgcc/config/riscv/riscv.cc
- gcc/config/riscv/riscv.h 1 addition, 1 deletiongcc/config/riscv/riscv.h
- gcc/config/riscv/vector.md 114 additions, 58 deletionsgcc/config/riscv/vector.md
Loading
Please register or sign in to comment