]> gcc.gnu.org Git - gcc.git/commit
RISC-V: Support rounding mode for VFNMADD/VFNMACC autovec
authorPan Li <pan2.li@intel.com>
Fri, 25 Aug 2023 01:37:00 +0000 (09:37 +0800)
committerPan Li <pan2.li@intel.com>
Thu, 31 Aug 2023 15:31:56 +0000 (23:31 +0800)
commitaf0c625f6085567522cf55b2ced05f07ec7be67a
tree1d2abcfc2a5146319fdc306eecec6a5ead1f2116
parenta7cefeaead68e5d89f65ba3a558eddef9b0b0f75
RISC-V: Support rounding mode for VFNMADD/VFNMACC autovec

There will be a case like below for intrinsic and autovec combination.

vfadd RTZ   <- intrinisc static rounding
vfnmadd     <- autovec/autovec-opt

The autovec generated vfnmadd should take DYN mode, and the
frm must be restored before the vfnmadd insn. This patch
would like to fix this issue by:

* Add the frm operand to the autovec/autovec-opt pattern.
* Set the frm_mode attr to DYN.

Thus, the frm flow when combine autovec and intrinsic should be.

+------------
| frrm  a5
| ...
| fsrmi 4
| vfadd       <- intrinsic static rounding.
| ...
| fsrm  a5
| vfnmadd     <- autovec/autovec-opt
| ...
+------------

Signed-off-by: Pan Li <pan2.li@intel.com>
gcc/ChangeLog:

* config/riscv/autovec-opt.md: Add FRM_REGNUM to vfnmadd/vfnmacc.
* config/riscv/autovec.md: Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/base/float-point-frm-autovec-4.c: New test.
gcc/config/riscv/autovec-opt.md
gcc/config/riscv/autovec.md
gcc/testsuite/gcc.target/riscv/rvv/base/float-point-frm-autovec-4.c [new file with mode: 0644]
This page took 0.058907 seconds and 5 git commands to generate.