gcc/libgcc/soft-fp
Xiao Zeng 8c7cee80eb [RISC-V] Add support for _Bfloat16
1 At point <https://github.com/riscv/riscv-bfloat16>,
  BF16 has already been completed "post public review".

2 LLVM has also added support for RISCV BF16 in
  <https://reviews.llvm.org/D151313> and
  <https://reviews.llvm.org/D150929>.

3 According to the discussion <https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/367>,
  this use __bf16 and use DF16b in riscv_mangle_type like x86.

Below test are passed for this patch
    * The riscv fully regression test.

gcc/ChangeLog:

	* config/riscv/iterators.md: New mode iterator HFBF.
	* config/riscv/riscv-builtins.cc (riscv_init_builtin_types):
	Initialize data type _Bfloat16.
	* config/riscv/riscv-modes.def (FLOAT_MODE): New.
	(ADJUST_FLOAT_FORMAT): New.
	* config/riscv/riscv.cc (riscv_mangle_type): Support for BFmode.
	(riscv_scalar_mode_supported_p): Ditto.
	(riscv_libgcc_floating_mode_supported_p): Ditto.
	(riscv_init_libfuncs): Set the conversion method for BFmode and
	HFmode.
	(riscv_block_arith_comp_libfuncs_for_mode): Set the arithmetic
	and comparison libfuncs for the mode.
	* config/riscv/riscv.md (mode" ): Add BF.
	(movhf): Support for BFmode.
	(mov<mode>): Ditto.
	(*movhf_softfloat): Ditto.
	(*mov<mode>_softfloat): Ditto.

libgcc/ChangeLog:

	* config/riscv/sfp-machine.h (_FP_NANFRAC_B): New.
	(_FP_NANSIGN_B): Ditto.
	* config/riscv/t-softfp32: Add support for BF16 libfuncs.
	* config/riscv/t-softfp64: Ditto.
	* soft-fp/floatsibf.c: For si -> bf16.
	* soft-fp/floatunsibf.c: For unsi -> bf16.

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/bf16_arithmetic.c: New test.
	* gcc.target/riscv/bf16_call.c: New test.
	* gcc.target/riscv/bf16_comparison.c: New test.
	* gcc.target/riscv/bf16_float_libcall_convert.c: New test.
	* gcc.target/riscv/bf16_integer_libcall_convert.c: New test.

Co-authored-by: Jin Ma <jinma@linux.alibaba.com>
2024-05-06 15:39:12 -06:00
..
adddf3.c
addsf3.c
addtf3.c
bitint.h libgcc: Fix UB in FP_FROM_BITINT 2024-02-13 10:33:08 +01:00
bitintpow10.c
bitintpow10.h
brain.h
divdf3.c
divsf3.c
divtf3.c
double.h
eqdf2.c
eqhf2.c
eqsf2.c
eqtf2.c
extendbfsf2.c
extenddftf2.c
extended.h
extendhfdf2.c
extendhfsf2.c
extendhftf2.c
extendhfxf2.c
extendsfdf2.c
extendsftf2.c
extendxftf2.c
fixddbitint.c libgcc: Fix BIL_TYPE_SIZE == 32 support in _BitInt <-> dfp support 2024-02-10 12:50:52 +01:00
fixddti.c
fixdfbitint.c
fixdfdi.c
fixdfsi.c
fixdfti.c
fixhfdi.c
fixhfsi.c
fixhfti.c
fixsdbitint.c libgcc: Fix BIL_TYPE_SIZE == 32 support in _BitInt <-> dfp support 2024-02-10 12:50:52 +01:00
fixsdti.c
fixsfbitint.c
fixsfdi.c
fixsfsi.c
fixsfti.c
fixtdbitint.c libgcc: Fix BIL_TYPE_SIZE == 32 support in _BitInt <-> dfp support 2024-02-10 12:50:52 +01:00
fixtdti.c
fixtfbitint.c
fixtfdi.c
fixtfsi.c
fixtfti.c
fixunsddti.c
fixunsdfdi.c
fixunsdfsi.c
fixunsdfti.c
fixunshfdi.c
fixunshfsi.c
fixunshfti.c
fixunssdti.c
fixunssfdi.c
fixunssfsi.c
fixunssfti.c
fixunstdti.c
fixunstfdi.c
fixunstfsi.c
fixunstfti.c
fixxfbitint.c
floatbitintbf.c
floatbitintdd.c libgcc: Fix a bug in _BitInt -> dfp conversions 2024-02-10 12:51:39 +01:00
floatbitintdf.c
floatbitinthf.c
floatbitintsd.c libgcc: Fix a bug in _BitInt -> dfp conversions 2024-02-10 12:51:39 +01:00
floatbitintsf.c
floatbitinttd.c libgcc: Fix a bug in _BitInt -> dfp conversions 2024-02-10 12:51:39 +01:00
floatbitinttf.c
floatbitintxf.c
floatdibf.c
floatdidf.c
floatdihf.c
floatdisf.c
floatditf.c
floatsibf.c [RISC-V] Add support for _Bfloat16 2024-05-06 15:39:12 -06:00
floatsidf.c
floatsihf.c
floatsisf.c
floatsitf.c
floattibf.c
floattidd.c
floattidf.c
floattihf.c
floattisd.c
floattisf.c
floattitd.c
floattitf.c
floatundibf.c
floatundidf.c
floatundihf.c
floatundisf.c
floatunditf.c
floatunsibf.c [RISC-V] Add support for _Bfloat16 2024-05-06 15:39:12 -06:00
floatunsidf.c
floatunsihf.c
floatunsisf.c
floatunsitf.c
floatuntibf.c
floatuntidd.c
floatuntidf.c
floatuntihf.c
floatuntisd.c
floatuntisf.c
floatuntitd.c
floatuntitf.c
gedf2.c
gesf2.c
getf2.c
half.h
ledf2.c
lesf2.c
letf2.c
muldf3.c
mulsf3.c
multf3.c
negdf2.c
negsf2.c
negtf2.c
op-1.h
op-2.h
op-4.h
op-8.h
op-common.h
quad.h
README
single.h
soft-fp.h
subdf3.c
subsf3.c
subtf3.c
truncbfhf2.c
truncdfbf2.c
truncdfhf2.c
truncdfsf2.c
trunchfbf2.c
truncsfbf2.c
truncsfhf2.c
trunctfbf2.c
trunctfdf2.c
trunctfhf2.c
trunctfsf2.c
trunctfxf2.c
truncxfbf2.c
truncxfhf2.c
unorddf2.c
unordsf2.c
unordtf2.c

The files in this directory are part of the GNU C Library, not part of
GCC.  As described at <http://gcc.gnu.org/codingconventions.html>,
changes should be made to the GNU C Library and the changed files then
imported into GCC.