Commit graph

4 commits

Author SHA1 Message Date
Jiaxun Yang
05c4e3ecb5 [PATCH v2] sh: libgcc: Implement fenv rouding and exceptions for soft-fp [PR118257]
Implement fenv rouding and exceptions for soft-fp, as per SuperH
arch specification.

No new tests required, as it's already covered by many torture tests
with fenv_exceptions.

	PR target/118257

libgcc/ChangeLog:

	* config/sh/sfp-machine.h (_FPU_GETCW): Implement with builtin.
	(_FPU_SETCW): Likewise.
	(FP_EX_ENABLE_SHIFT): Derive from arch spec.
	(FP_EX_CAUSE_SHIFT): Likewise.
	(FP_RND_MASK): Likewise.
	(FP_EX_INVALID): Likewise.
	(FP_EX_DIVZERO): Likewise.
	(FP_EX_ALL): Likewise.
	(FP_EX_OVERFLOW): Likewise.
	(FP_EX_UNDERFLOW): Likewise.
	(FP_EX_INEXACT): Likewise.
	(_FP_DECL_EX): Declear default FCSR value.
	(FP_RND_NEAREST): Derive from arch spec.
	(FP_RND_ZERO): Likewise.
	(FP_INIT_ROUNDMODE): Likewise.
	(FP_ROUNDMODE): Likewise.
	(FP_TRAPPING_EXCEPTIONS): Likewise.
	(FP_HANDLE_EXCEPTIONS): Implement with _FPU_SETCW.
2025-04-19 08:12:07 -06:00
Jiaxun Yang
2a643f55f5 [PATCH v2] sh: Correct NaN signalling bit and propagation rules [PR111814]
As per architecture, SuperH has a reversed NaN signalling bit
vs IEEE754-2008, it also has a NaN propgation rule similar to
MIPS style.

Use mips style float format and mode for all float types, and
correct sfp-machine header accordingly.

	PR target/111814

gcc/ChangeLog:

	* config/sh/sh-modes.def (RESET_FLOAT_FORMAT): Use mips format.
	(FLOAT_MODE): Use mips mode.

libgcc/ChangeLog:

	* config/sh/sfp-machine.h (_FP_NANFRAC_B): Reverse signaling bit.
	(_FP_NANFRAC_H): Likewise.
	(_FP_NANFRAC_S): Likewise.
	(_FP_NANFRAC_D): Likewise.
	(_FP_NANFRAC_Q): Likewise.
	(_FP_KEEPNANFRACP): Enable for target.
	(_FP_QNANNEGATEDP): Enable for target.
	(_FP_CHOOSENAN): Port from MIPS.

gcc/testsuite/ChangeLog:

	* gcc.target/sh/pr111814.c: New test.
2025-04-19 08:07:58 -06:00
Jakub Jelinek
6441eb6dc0 Update copyright years. 2025-01-02 11:59:57 +01:00
Sébastien Michelland
e95512e2d5 SH: Use softfp for sh-elf
libgcc/ChangeLog:

	PR target/29845
	* config.host (sh-*-elf*): Replace fdpbit with softfp.
	* config/sh/sfp-machine.h: New file.

Signed-off-by: Sébastien Michelland <sebastien.michelland@lcis.grenoble-inp.fr>
2024-10-10 09:29:33 +09:00