glibc/sysdeps/mips
Maciej W. Rozycki db4855bf0c MIPS: Wire FCSR.ABS2008 to FCSR.NAN2008
Revision 3.50 of the MIPS architecture defined FCSR ABS2008 and NAN2008
bits as optionally read/write [1][2].  No hardware implementation has
ever made use of this feature though.  For example the first processor
to implement these bits, the MIPS32r3 proAptiv core, has both bits
read-only, hardwired to 1 [3].  And as from revision 5.03 of the MIPS
architecture the bits are required to be read-only, preset by hardware
[4][5].  Additionally all hardware implementations in existence have the
bits hardwired both to the same value, either of `0' and `1'.

These bits may still be read/write or hardwired to opposite values in
simulated hardware implementations such as QEMU or the FPU emulator
included with the Linux kernel.  However to match real hardware
implementations the Linux kernel will set FCSR ABS2008 and NAN2008 bits
both to the same value where possible, reflecting the setting of the
EF_MIPS_NAN2008 ELF file header bit.

Therefore update the bit patterns in macro definitions we use for the
control word, in the 2008-NaN encoding mode, so that both bits have the
same value in a given bit pattern.  Additionally mark the FCSR ABS2008
bit as reserved, so that high-level calls to change the control word do
not affect the bit.

This covers the regular FPU configurations, only leaving exotic corner
cases with the value of FCSR control word initially set by the kernel
different to what our code thinks it is.  To address the remaining cases
the AT_FPUCW auxiliary vector entry would have to be implemented in the
Linux kernel, which currently is not.

References:

[1] "MIPS Architecture For Programmers, Volume I-A: Introduction to the
    MIPS32 Architecture", MIPS Technologies, Inc., Document Number:
    MD00082, Revision 3.50, September 20, 2012, Table 5.5 "FCSR Register
    Field Descriptions", p. 80

[2] "MIPS Architecture For Programmers, Volume I-A: Introduction to the
    MIPS64 Architecture", MIPS Technologies, Inc., Document Number:
    MD00083, Revision 3.50, September 20, 2012, Table 5.5 "FCSR Register
    Field Descriptions", p. 82

[3] "MIPS32 proAptiv Multiprocessing System Software User's Manual",
    MIPS Technologies, Inc., Document Number: MD00878, Revision 01.22,
    May 14, 2013, Table 12.10 "FCSR Bit Field Descriptions", p. 570

[4] "MIPS Architecture For Programmers, Volume I-A: Introduction to the
    MIPS32 Architecture", MIPS Technologies, Inc., Document Number:
    MD00082, Revision 5.03, Sept. 9, 2013, Table 5.7 "FCSR Register
    Field Descriptions", p. 82

[5] "MIPS Architecture For Programmers, Volume I-A: Introduction to the
    MIPS64 Architecture", MIPS Technologies, Inc., Document Number:
    MD00083, Revision 5.03, Sept. 9, 2013, Table 5.7 "FCSR Register
    Field Descriptions", p. 84

	* sysdeps/mips/fpu_control.h (_FPU_RESERVED): Include ABS2008.
	(_FPU_DEFAULT, _FPU_IEEE) [__mips_nan2008]: Set ABS2008.
2015-11-28 11:01:16 +00:00
..
bits Move bits/atomic.h to atomic-machine.h (bug 14912). 2015-09-11 20:00:19 +00:00
fpu Fix libm feupdateenv namespace (bug 17748). 2015-01-07 19:01:20 +00:00
ieee754 Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
include/sys Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
mips32 Regenerate MIPS libm-test-ulps. 2015-10-09 22:39:11 +00:00
mips64 Convert 231 sysdeps function definitions to prototype style. 2015-10-19 12:04:33 +00:00
nptl MIPS: Only use .set mips* assembler directives when necessary 2015-09-08 16:52:43 +01:00
sys MIPS: Only use .set mips* assembler directives when necessary 2015-09-08 16:52:43 +01:00
__longjmp.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
abort-instr.h Move mips from ports to libc. 2014-02-10 23:30:21 +00:00
add_n.S Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
addmul_1.S Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
atomic-machine.h Remove MIPS16 atomics using __sync_* (bug 17404). 2015-10-27 23:47:56 +00:00
backtrace.c Move mips from ports to libc. 2014-02-10 23:30:21 +00:00
bsd-_setjmp.S Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
bsd-setjmp.S Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
configure Require autoconf 2.69 2014-09-29 07:53:36 -07:00
configure.ac Move mips from ports to libc. 2014-02-10 23:30:21 +00:00
dl-dtprocnum.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
dl-machine-reject-phdr.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
dl-machine.h Fix MIPS -Wundef warnings for __mips_isa_rev. 2015-08-18 21:52:22 +00:00
dl-procinfo.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
dl-procinfo.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
dl-tls.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
dl-trampoline.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
fpregdef.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
fpu_control.h MIPS: Wire FCSR.ABS2008 to FCSR.NAN2008 2015-11-28 11:01:16 +00:00
gccframe.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
Implies Move mips from ports to libc. 2014-02-10 23:30:21 +00:00
jmpbuf-unwind.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
ldsodefs.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
libc-tls.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
linkmap.h Rename bits/linkmap.h to linkmap.h (bug 14912). 2015-09-04 19:44:27 +00:00
lshift.S Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
machine-gmon.h Fix MIPS -Wundef warnings for __mips_isa_rev. 2015-08-18 21:52:22 +00:00
Makefile Add support for MIPS O32 FPXX and .MIPS.abiflags 2014-12-31 21:09:21 +00:00
math_private.h Fix math_private.h multiple include guards. 2015-11-20 23:46:23 +00:00
math-tests.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
memcpy.S Make performance improvement to MIPS memcpy for small copies. 2015-10-16 14:32:49 -07:00
memset.S 2015-02-17 Steve Ellcey <sellcey@imgtec.com> 2015-02-17 13:38:49 -08:00
memusage.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
mul_1.S Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
preconfigure Put mips preconfigure code inside mips* case statement. 2014-09-09 10:58:00 -07:00
regdef.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
rshift.S Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
setjmp_aux.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
setjmp.S Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
sgidefs.h Fix MIPS _ABIO64 -Werror=undef build. 2015-02-16 22:25:02 +00:00
sotruss-lib.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
stackinfo.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
start.S Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
strcmp.S Fix MIPS _COMPILING_NEWLIB -Werror=undef build. 2015-02-16 22:18:53 +00:00
sub_n.S Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
submul_1.S Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
tininess.h Move mips from ports to libc. 2014-02-10 23:30:21 +00:00
tls-macros.h MIPS: Only use .set mips* assembler directives when necessary 2015-09-08 16:52:43 +01:00
tst-abi-fp32mod.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
tst-abi-fp64amod.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
tst-abi-fp64mod.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
tst-abi-fpxxmod.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
tst-abi-fpxxomod.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
tst-abi-interlink.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
tst-audit.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
tst-mode-switch-1.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
tst-mode-switch-2.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
tst-mode-switch-3.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00