https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103406
--- Comment #11 from joseph at codesourcery dot com <joseph at codesourcery dot com> --- The sign of a NaN result is never specified in C except for fabs, copysign, negation, unary + (and assignment to the same format in the case where that's copy rather than convertFormat). The result should of course be NaN (of any sign), not 0. The reason soft-fp (and thus sfp-machine.h) has special support for choosing a NaN result based on NaN operands is because soft-fp is also used in the Linux kernel for emulating floating-point instructions, and in that context the aim is to follow the semantics of those instructions, which specifies things left unspecified in IEEE 754 and its C bindings. That isn't relevant at the level of C code or libgcc functions.