]> git.ipfire.org Git - thirdparty/gcc.git/commit
[PATCH v2] sh: Correct NaN signalling bit and propagation rules [PR111814]
authorJiaxun Yang <jiaxun.yang@flygoat.com>
Sat, 19 Apr 2025 14:07:58 +0000 (08:07 -0600)
committerJeff Law <jlaw@ventanamicro.com>
Sat, 19 Apr 2025 14:07:58 +0000 (08:07 -0600)
commit2a643f55f5acc05dcc7cee133647bf3193d5b563
treea5d50cd818a09759ac9ab1a1d46839e4a8d09cf9
parent6beb0a14aacd84ec49646237fc0f69c6765f956e
[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.
gcc/config/sh/sh-modes.def
gcc/testsuite/gcc.target/sh/pr111814.c [new file with mode: 0644]
libgcc/config/sh/sfp-machine.h