mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-30 08:40:07 +00:00
ace614b8a5
IEEE 754-2008 defines two ways in which tiny results can be detected, "before rounding" (based on the infinite-precision result) and "after rounding" (based on the result when rounded to normal precision as if the exponent range were unbounded). All binary operations on an architecture must use the same choice of how tininess is detected. soft-fp has so far implemented only before-rounding tininess detection. This patch adds support for after-rounding tininess detection. A new macro _FP_TININESS_AFTER_ROUNDING is added that sfp-machine.h must define (soft-fp is meant to be self-contained so the existing tininess.h files aren't used here, though the information going in sfp-machine.h has been taken from them). The soft-fp macros dealing with raising underflow exceptions then handle the cases where the choice matters specially, rounding a copy of the input to the appropriate precision to see if a value that's tiny before rounding isn't tiny after rounding. Tested for mips64 using GCC trunk (which now uses soft-fp on MIPS, so supporting exceptions and rounding modes for long double where not previously supported - this is the immediate motivation for doing this patch now) together with (a) a patch to sysdeps/mips/math-tests.h to enable exceptions / rounding modes tests for long double for GCC 4.9 and later, and (b) corresponding changes applied to libgcc's soft-fp and sfp-machine.h files. In the libgcc context this is also tested on x86_64 (also an after-rounding architecture) with testcases for __float128 that I intend to add to the GCC testsuite when updating soft-fp there. (To be clear: this patch does not fix any glibc bugs that were user-visible in past releases, since after-rounding architectures didn't use soft-fp in any affected case with support for floating-point exceptions - so there is no corresponding Bugzilla bug. Rather, it works together with the GCC changes to use soft-fp on MIPS to allow previously absent long double functionality to work properly, and allows soft-fp to be used in glibc on after-rounding architectures in cases where it couldn't previously be used.) * soft-fp/op-common.h (_FP_DECL): Mark exponent as possibly unused. (_FP_PACK_SEMIRAW): Determine tininess based on rounding shifted value if _FP_TININESS_AFTER_ROUNDING and unrounded value is in subnormal range. (_FP_PACK_CANONICAL): Determine tininess based on rounding to normal precision if _FP_TININESS_AFTER_ROUNDING and unrounded value has largest subnormal exponent. * soft-fp/soft-fp.h [FP_NO_EXCEPTIONS] (_FP_TININESS_AFTER_ROUNDING): Undefine and redefine to 0. * sysdeps/aarch64/soft-fp/sfp-machine.h (_FP_TININESS_AFTER_ROUNDING): New macro. * sysdeps/alpha/soft-fp/sfp-machine.h (_FP_TININESS_AFTER_ROUNDING): Likewise. * sysdeps/arm/soft-fp/sfp-machine.h (_FP_TININESS_AFTER_ROUNDING): Likewise. * sysdeps/mips/mips64/soft-fp/sfp-machine.h (_FP_TININESS_AFTER_ROUNDING): Likewise. * sysdeps/mips/soft-fp/sfp-machine.h (_FP_TININESS_AFTER_ROUNDING): Likewise. * sysdeps/powerpc/soft-fp/sfp-machine.h (_FP_TININESS_AFTER_ROUNDING): Likewise. * sysdeps/sh/soft-fp/sfp-machine.h (_FP_TININESS_AFTER_ROUNDING): Likewise. * sysdeps/sparc/sparc32/soft-fp/sfp-machine.h (_FP_TININESS_AFTER_ROUNDING): Likewise. * sysdeps/sparc/sparc64/soft-fp/sfp-machine.h (_FP_TININESS_AFTER_ROUNDING): Likewise. * sysdeps/tile/sfp-machine.h (_FP_TININESS_AFTER_ROUNDING): Likewise. |
||
---|---|---|
.. | ||
alphaev5 | ||
alphaev6 | ||
alphaev67 | ||
bits | ||
fpu | ||
nptl | ||
soft-fp | ||
__longjmp.S | ||
_mcount.S | ||
add_n.S | ||
addmul_1.S | ||
backtrace.c | ||
bb_init_func.S | ||
bsd-_setjmp.S | ||
bsd-setjmp.S | ||
bzero.S | ||
configure | ||
configure.ac | ||
crti.S | ||
crtn.S | ||
div_libc.h | ||
div.S | ||
divl.S | ||
divlu.S | ||
divq.S | ||
divqu.S | ||
dl-dtprocnum.h | ||
dl-machine.h | ||
dl-procinfo.c | ||
dl-procinfo.h | ||
dl-sysdep.h | ||
dl-tls.h | ||
dl-trampoline.S | ||
ffs.S | ||
ffsll.S | ||
gccframe.h | ||
hp-timing.h | ||
htonl.S | ||
htons.S | ||
Implies | ||
jmpbuf-offsets.h | ||
jmpbuf-unwind.h | ||
ldiv.S | ||
ldsodefs.h | ||
libc-tls.c | ||
lldiv.S | ||
lshift.S | ||
machine-gmon.h | ||
Makefile | ||
memchr.c | ||
memset.S | ||
memusage.h | ||
mul_1.S | ||
nscd-types.h | ||
preconfigure | ||
rawmemchr.S | ||
reml.S | ||
remlu.S | ||
remq.S | ||
remqu.S | ||
rshift.S | ||
setjmp.S | ||
shlib-versions | ||
sotruss-lib.c | ||
stackinfo.h | ||
start.S | ||
stpcpy.S | ||
stpncpy.S | ||
strcat.S | ||
strchr.S | ||
strcmp.S | ||
strcpy.S | ||
strlen.S | ||
strncat.S | ||
strncmp.S | ||
strncpy.S | ||
strrchr.S | ||
stxcpy.S | ||
stxncpy.S | ||
sub_n.S | ||
Subdirs | ||
submul_1.S | ||
tininess.h | ||
tls-macros.h | ||
tst-audit.h | ||
udiv_qrnnd.S | ||
Versions |