]> git.ipfire.org Git - thirdparty/gcc.git/commit
RISC-V: Add ZVFH extension to the -march= option
authorPan Li <pan2.li@intel.com>
Wed, 31 May 2023 06:49:32 +0000 (14:49 +0800)
committerPan Li <pan2.li@intel.com>
Wed, 31 May 2023 07:25:46 +0000 (15:25 +0800)
commit5a98afec536ccc8e4530575edc5cf3420a4416b3
treec0675ccefceb16076422586d9e7be904bebdc73a
parentfefa7db2c31fee449dd46dd6ed7f5a39fa884038
RISC-V: Add ZVFH extension to the -march= option

This patch would like to add new sub extension (aka ZVFH) to the -march= option.
To make it simple, only the sub extension itself is involved in this patch, and
the underlying FP16 related RVV intrinsic API depends on the TARGET_ZVFH.

The Zvfh extension depends on the Zve32f and Zfhmin extensions. You can locate
more information about ZVFH from below spec doc.

https://github.com/riscv/riscv-v-spec/blob/master/v-spec.adoc#185-zvfh-vector-extension-for-half-precision-floating-point

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

* common/config/riscv/riscv-common.cc:
(riscv_implied_info): Add zvfh item.
(riscv_ext_version_table): Ditto.
(riscv_ext_flag_table): Ditto.
* config/riscv/riscv-opts.h (MASK_ZVFH): New macro.
(TARGET_ZVFH): Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/arch-21.c: New test.
* gcc.target/riscv/predef-27.c: New test.
gcc/common/config/riscv/riscv-common.cc
gcc/config/riscv/riscv-opts.h
gcc/testsuite/gcc.target/riscv/arch-21.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/predef-27.c [new file with mode: 0644]