kernel-ark/arch/mips/math-emu
Maciej W. Rozycki 90d53a91fb MIPS: math-emu: Add IEEE Std 754-2008 NaN encoding emulation
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>
2016-01-20 00:39:20 +01:00
..
cp1emu.c MIPS: math-emu: Add support for the MIPS R6 MAX{, A} FPU instruction 2015-09-03 12:08:14 +02:00
dp_2008class.c MIPS: math-emu: Add support for the MIPS R6 CLASS FPU instruction 2015-09-03 12:08:14 +02:00
dp_add.c MIPS: math-emu: Reinstate sNaN quieting handlers 2015-04-08 01:09:31 +02:00
dp_cmp.c MIPS: math-emu: Remove redundant code from NaN comparison 2015-04-08 01:09:38 +02:00
dp_div.c MIPS: math-emu: Reinstate sNaN quieting handlers 2015-04-08 01:09:31 +02:00
dp_fint.c MIPS: math-emu: Cleanup coding style. 2014-05-23 15:11:15 +02:00
dp_flong.c MIPS: math-emu: Cleanup coding style. 2014-05-23 15:11:15 +02:00
dp_fmax.c MIPS: math-emu: Add support for the MIPS R6 MAX{, A} FPU instruction 2015-09-03 12:08:14 +02:00
dp_fmin.c MIPS: math-emu: Add support for the MIPS R6 MIN{, A} FPU instruction 2015-09-03 12:08:14 +02:00
dp_fsp.c MIPS: math-emu: Reinstate sNaN quieting handlers 2015-04-08 01:09:31 +02:00
dp_maddf.c MIPS: math-emu: Add support for the MIPS R6 MADDF FPU instruction 2015-09-03 12:08:13 +02:00
dp_msubf.c MIPS: math-emu: Add support for the MIPS R6 MSUBF FPU instruction 2015-09-03 12:08:13 +02:00
dp_mul.c MIPS: math-emu: Reinstate sNaN quieting handlers 2015-04-08 01:09:31 +02:00
dp_simple.c MIPS: math-emu: Add IEEE Std 754-2008 ABS.fmt and NEG.fmt emulation 2016-01-20 00:39:20 +01:00
dp_sqrt.c MIPS: math-emu: Reinstate sNaN quieting handlers 2015-04-08 01:09:31 +02:00
dp_sub.c MIPS: math-emu: Reinstate sNaN quieting handlers 2015-04-08 01:09:31 +02:00
dp_tint.c MIPS: math-emu: Add IEEE Std 754-2008 NaN encoding emulation 2016-01-20 00:39:20 +01:00
dp_tlong.c MIPS: math-emu: Add IEEE Std 754-2008 NaN encoding emulation 2016-01-20 00:39:20 +01:00
dsemul.c MIPS: math-emu: Remove unused handle_dsemul function declaration 2015-09-03 12:08:15 +02:00
ieee754.c MIPS: math-emu: Add IEEE Std 754-2008 NaN encoding emulation 2016-01-20 00:39:20 +01:00
ieee754.h MIPS: math-emu: Add IEEE Std 754-2008 NaN encoding emulation 2016-01-20 00:39:20 +01:00
ieee754d.c MIPS: math-emu: Cleanup coding style. 2014-05-23 15:11:15 +02:00
ieee754dp.c MIPS: math-emu: Add IEEE Std 754-2008 NaN encoding emulation 2016-01-20 00:39:20 +01:00
ieee754dp.h MIPS: math-emu: Make NaN classifiers static 2015-04-08 01:09:47 +02:00
ieee754int.h MIPS: math-emu: Add IEEE Std 754-2008 NaN encoding emulation 2016-01-20 00:39:20 +01:00
ieee754sp.c MIPS: math-emu: Add IEEE Std 754-2008 NaN encoding emulation 2016-01-20 00:39:20 +01:00
ieee754sp.h MIPS: math-emu: Make NaN classifiers static 2015-04-08 01:09:47 +02:00
Makefile MIPS: math-emu: Add support for the MIPS R6 MAX{, A} FPU instruction 2015-09-03 12:08:14 +02:00
me-debugfs.c MIPS: Declare mips_debugfs_dir in a header 2015-10-26 09:49:42 +01:00
sp_2008class.c MIPS: math-emu: Add support for the MIPS R6 CLASS FPU instruction 2015-09-03 12:08:14 +02:00
sp_add.c MIPS: math-emu: Reinstate sNaN quieting handlers 2015-04-08 01:09:31 +02:00
sp_cmp.c MIPS: math-emu: Remove redundant code from NaN comparison 2015-04-08 01:09:38 +02:00
sp_div.c MIPS: math-emu: Reinstate sNaN quieting handlers 2015-04-08 01:09:31 +02:00
sp_fdp.c MIPS: math-emu: Add IEEE Std 754-2008 NaN encoding emulation 2016-01-20 00:39:20 +01:00
sp_fint.c MIPS: math-emu: Cleanup coding style. 2014-05-23 15:11:15 +02:00
sp_flong.c MIPS: math-emu: Cleanup coding style. 2014-05-23 15:11:15 +02:00
sp_fmax.c MIPS: math-emu: Add support for the MIPS R6 MAX{, A} FPU instruction 2015-09-03 12:08:14 +02:00
sp_fmin.c MIPS: math-emu: Add support for the MIPS R6 MIN{, A} FPU instruction 2015-09-03 12:08:14 +02:00
sp_maddf.c MIPS: math-emu: Add support for the MIPS R6 MADDF FPU instruction 2015-09-03 12:08:13 +02:00
sp_msubf.c MIPS: math-emu: Add support for the MIPS R6 MSUBF FPU instruction 2015-09-03 12:08:13 +02:00
sp_mul.c MIPS: math-emu: Reinstate sNaN quieting handlers 2015-04-08 01:09:31 +02:00
sp_simple.c MIPS: math-emu: Add IEEE Std 754-2008 ABS.fmt and NEG.fmt emulation 2016-01-20 00:39:20 +01:00
sp_sqrt.c MIPS: math-emu: Reinstate sNaN quieting handlers 2015-04-08 01:09:31 +02:00
sp_sub.c MIPS: math-emu: Reinstate sNaN quieting handlers 2015-04-08 01:09:31 +02:00
sp_tint.c MIPS: math-emu: Add IEEE Std 754-2008 NaN encoding emulation 2016-01-20 00:39:20 +01:00
sp_tlong.c MIPS: math-emu: Add IEEE Std 754-2008 NaN encoding emulation 2016-01-20 00:39:20 +01:00