diff options
author | Pan Li <pan2.li@intel.com> | 2023-06-27 11:11:46 +0800 |
---|---|---|
committer | Pan Li <pan2.li@intel.com> | 2023-06-29 12:13:04 +0800 |
commit | 4d1e97f5838b0b6c12d256883e24a8cb3258a134 (patch) | |
tree | 512c4aa8384f00e0a8b51b900aa1bcfca686e1d8 /gcc/ada/gcc-interface/decl.cc | |
parent | e510c3be13a8ccdf1fc1b27c2501c126d493f335 (diff) | |
download | gcc-4d1e97f5838b0b6c12d256883e24a8cb3258a134.zip gcc-4d1e97f5838b0b6c12d256883e24a8cb3258a134.tar.gz gcc-4d1e97f5838b0b6c12d256883e24a8cb3258a134.tar.bz2 |
RISC-V: Allow rounding mode control for RVV floating-point add
According to the doc as below, we need to support the rounding mode of
the RVV floating-point, both the static and dynamice frm.
https://github.com/riscv-non-isa/rvv-intrinsic-doc/pull/226
For tracking and development friendly, We will take some steps to support
all rounding modes for the RVV floating-point rounding modes.
1. Allow rounding mode control by one intrinsic (aka this patch), vfadd.
2. Support static rounding mode control by mode switch, like fixed-point.
3. Support dynamice round mode control by mode switch.
4. Support the rest floating-point instructions for frm.
Please *NOTE* this patch only allow the rounding mode control for the
vfadd intrinsic API, and the related frm will be coverred by step 2.
Signed-off-by: Pan Li <pan2.li@intel.com>
Co-Authored by: Juzhe-Zhong <juzhe.zhong@rivai.ai>
gcc/ChangeLog:
* config/riscv/riscv-protos.h (enum floating_point_rounding_mode):
Add macro for static frm min and max.
* config/riscv/riscv-vector-builtins-bases.cc
(class binop_frm): New class for floating-point with frm.
(BASE): Add vfadd for frm.
* config/riscv/riscv-vector-builtins-bases.h: Likewise.
* config/riscv/riscv-vector-builtins-functions.def
(vfadd_frm): Likewise.
* config/riscv/riscv-vector-builtins-shapes.cc
(struct alu_frm_def): New struct for alu with frm.
(SHAPE): Add alu with frm.
* config/riscv/riscv-vector-builtins-shapes.h: Likewise.
* config/riscv/riscv-vector-builtins.cc
(function_checker::report_out_of_range_and_not): New function
for report out of range and not val.
(function_checker::require_immediate_range_or): New function
for checking in range or one val.
* config/riscv/riscv-vector-builtins.h: Add function decl.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/base/float-point-frm-error.c: New test.
* gcc.target/riscv/rvv/base/float-point-frm.c: New test.
Diffstat (limited to 'gcc/ada/gcc-interface/decl.cc')
0 files changed, 0 insertions, 0 deletions