glibc/sysdeps/alpha
Joseph Myers ace614b8a5 soft-fp: support after-rounding tininess detection.
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.
2014-02-12 18:27:12 +00:00
..
alphaev5 Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
alphaev6 Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
alphaev67 Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
bits Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
fpu Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
nptl Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
soft-fp soft-fp: support after-rounding tininess detection. 2014-02-12 18:27:12 +00:00
Implies Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
Makefile Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
Subdirs Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
Versions Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
__longjmp.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
_mcount.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
add_n.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
addmul_1.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
backtrace.c Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
bb_init_func.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
bsd-_setjmp.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
bsd-setjmp.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
bzero.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
configure Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
configure.ac Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
crti.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
crtn.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
div.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
div_libc.h Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
divl.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
divlu.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
divq.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
divqu.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
dl-dtprocnum.h Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
dl-machine.h Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
dl-procinfo.c Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
dl-procinfo.h Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
dl-sysdep.h Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
dl-tls.h Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
dl-trampoline.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
ffs.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
ffsll.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
gccframe.h Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
hp-timing.h Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
htonl.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
htons.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
jmpbuf-offsets.h Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
jmpbuf-unwind.h Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
ldiv.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
ldsodefs.h Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
libc-tls.c Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
lldiv.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
lshift.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
machine-gmon.h Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
memchr.c Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
memset.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
memusage.h Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
mul_1.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
nscd-types.h Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
preconfigure Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
rawmemchr.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
reml.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
remlu.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
remq.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
remqu.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
rshift.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
setjmp.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
shlib-versions Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
sotruss-lib.c Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
stackinfo.h Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
start.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
stpcpy.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
stpncpy.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
strcat.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
strchr.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
strcmp.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
strcpy.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
strlen.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
strncat.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
strncmp.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
strncpy.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
strrchr.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
stxcpy.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
stxncpy.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
sub_n.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
submul_1.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
tininess.h Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
tls-macros.h Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
tst-audit.h Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00
udiv_qrnnd.S Relocate alpha from ports to libc 2014-02-12 07:00:06 -08:00