]> gcc.gnu.org Git - gcc.git/commit
RISC-V: Add Zfbfmin extension
authorXiao Zeng <zengxiao@eswincomputing.com>
Wed, 15 May 2024 05:56:42 +0000 (13:56 +0800)
committerXiao Zeng <zengxiao@eswincomputing.com>
Wed, 5 Jun 2024 01:20:21 +0000 (09:20 +0800)
commit4638e508aa814d4aa2e204c3ab041c6a56aad2bd
treecec767cf26227108d95a3fd17023c193ca13c4a0
parent904fbe96180d66b718ca9201fc5e1064e7eec26b
RISC-V: Add Zfbfmin extension

1 In the previous patch, the libcall for BF16 was implemented:
<https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=8c7cee80eb50792e57d514be1418c453ddd1073e>

2 Riscv provides Zfbfmin extension, which completes the "Scalar BF16 Converts":
<https://github.com/riscv/riscv-bfloat16/blob/main/doc/riscv-bfloat16-zfbfmin.adoc>

3 Implemented replacing libcall with Zfbfmin extension instruction.

4 Reused previous testcases in:
<https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=8c7cee80eb50792e57d514be1418c453ddd1073e>
gcc/ChangeLog:

* config/riscv/iterators.md: Add mode_iterator between
floating-point modes and BFmode.
* config/riscv/riscv.cc (riscv_output_move): Handle BFmode move
for zfbfmin.
* config/riscv/riscv.md (trunc<mode>bf2): New pattern for BFmode.
(extendbfsf2): Dotto.
(*movhf_hardfloat): Add BFmode.
(*mov<mode>_hardfloat): Dotto.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/zfbfmin-bf16_arithmetic.c: New test.
* gcc.target/riscv/zfbfmin-bf16_comparison.c: New test.
* gcc.target/riscv/zfbfmin-bf16_float_libcall_convert.c: New test.
* gcc.target/riscv/zfbfmin-bf16_integer_libcall_convert.c: New test.
gcc/config/riscv/iterators.md
gcc/config/riscv/riscv.cc
gcc/config/riscv/riscv.md
gcc/testsuite/gcc.target/riscv/zfbfmin-bf16_arithmetic.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/zfbfmin-bf16_comparison.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/zfbfmin-bf16_float_libcall_convert.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/zfbfmin-bf16_integer_libcall_convert.c [new file with mode: 0644]
This page took 0.063234 seconds and 5 git commands to generate.