Hi all RISC-V folks: This patch completes the support for the bf16 data type in the riscv architecture.On this basis, there will be a series of patches in the future to strengthen support for BF16.
It is recommended to first review this patch from the testcases, where detailed explanations have been provided on the flow of data type conversion. The basis of this patch is: <https://gcc.gnu.org/pipermail/gcc-patches/2023-September/630858.html> Xiao Zeng (1): [RISCV] Add support for _Bfloat16 gcc/config/riscv/iterators.md | 2 + gcc/config/riscv/riscv-builtins.cc | 16 ++++ gcc/config/riscv/riscv-modes.def | 3 + gcc/config/riscv/riscv.cc | 64 ++++++++++----- gcc/config/riscv/riscv.md | 24 +++--- .../gcc.target/riscv/bf16_arithmetic.c | 42 ++++++++++ gcc/testsuite/gcc.target/riscv/bf16_call.c | 12 +++ .../gcc.target/riscv/bf16_comparison.c | 36 +++++++++ .../riscv/bf16_float_libcall_convert.c | 57 +++++++++++++ .../riscv/bf16_integer_libcall_convert.c | 81 +++++++++++++++++++ libgcc/config/riscv/sfp-machine.h | 3 + libgcc/config/riscv/t-softfp32 | 10 ++- libgcc/config/riscv/t-softfp64 | 3 +- libgcc/soft-fp/floatsibf.c | 45 +++++++++++ libgcc/soft-fp/floatunsibf.c | 45 +++++++++++ 15 files changed, 407 insertions(+), 36 deletions(-) create mode 100644 gcc/testsuite/gcc.target/riscv/bf16_arithmetic.c create mode 100644 gcc/testsuite/gcc.target/riscv/bf16_call.c create mode 100644 gcc/testsuite/gcc.target/riscv/bf16_comparison.c create mode 100644 gcc/testsuite/gcc.target/riscv/bf16_float_libcall_convert.c create mode 100644 gcc/testsuite/gcc.target/riscv/bf16_integer_libcall_convert.c create mode 100644 libgcc/soft-fp/floatsibf.c create mode 100644 libgcc/soft-fp/floatunsibf.c -- 2.17.1