90d53a91fb
Implement IEEE Std 754-2008 NaN encoding wired to the state of the FCSR.NAN2008 bit. Make the interpretation of the quiet bit in NaN data as follows: * in the legacy mode originally defined by the MIPS architecture the value of 1 denotes an sNaN whereas the value of 0 denotes a qNaN, * in the 2008 mode introduced with revision 5 of the MIPS architecture the value of 0 denotes an sNaN whereas the value of 1 denotes a qNaN, following the definition of the preferred NaN encoding introduced with IEEE Std 754-2008. In the 2008 mode, following the requirement of the said standard, quiet an sNaN where needed by setting the quiet bit to 1 and leaving all the NaN payload bits unchanged. Update format conversion operations according to the rules set by IEEE Std 754-2008 and the MIPS architecture. Specifically: * propagate NaN payload bits through conversions between floating-point formats such that as much information as possible is preserved and specifically a conversion from a narrower format to a wider format and then back to the original format does not change a qNaN payload in any way, * conversions from a floating-point to an integer format where the source is a NaN, infinity or a value that would convert to an integer outside the range of the result format produce, under the default exception handling, the respective values defined by the MIPS architecture. In full FPU emulation set the FIR.HAS2008 bit to 1, however do not make any further FCSR bits writable. Signed-off-by: Maciej W. Rozycki <macro@imgtec.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Matthew Fortune <Matthew.Fortune@imgtec.com> Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/11477/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org> |
||
---|---|---|
.. | ||
cp1emu.c | ||
dp_2008class.c | ||
dp_add.c | ||
dp_cmp.c | ||
dp_div.c | ||
dp_fint.c | ||
dp_flong.c | ||
dp_fmax.c | ||
dp_fmin.c | ||
dp_fsp.c | ||
dp_maddf.c | ||
dp_msubf.c | ||
dp_mul.c | ||
dp_simple.c | ||
dp_sqrt.c | ||
dp_sub.c | ||
dp_tint.c | ||
dp_tlong.c | ||
dsemul.c | ||
ieee754.c | ||
ieee754.h | ||
ieee754d.c | ||
ieee754dp.c | ||
ieee754dp.h | ||
ieee754int.h | ||
ieee754sp.c | ||
ieee754sp.h | ||
Makefile | ||
me-debugfs.c | ||
sp_2008class.c | ||
sp_add.c | ||
sp_cmp.c | ||
sp_div.c | ||
sp_fdp.c | ||
sp_fint.c | ||
sp_flong.c | ||
sp_fmax.c | ||
sp_fmin.c | ||
sp_maddf.c | ||
sp_msubf.c | ||
sp_mul.c | ||
sp_simple.c | ||
sp_sqrt.c | ||
sp_sub.c | ||
sp_tint.c | ||
sp_tlong.c |