glibc/sysdeps/powerpc
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
..
bits Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fpu Update powerpc-fpu ULPs. 2014-01-08 07:55:08 -06:00
nofpu Regenerate powerpc-nofpu ulps (again). 2014-01-07 23:32:04 +00:00
power4 Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
power5+/fpu Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
power6 Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
power7/fpu Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
powerpc32 Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
powerpc64 Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
soft-fp soft-fp: support after-rounding tininess detection. 2014-02-12 18:27:12 +00:00
sys/platform Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
abort-instr.h Update. 2002-09-15 18:31:23 +00:00
configure rename configure.in to configure.ac 2013-10-30 17:32:08 +10:00
configure.ac rename configure.in to configure.ac 2013-10-30 17:32:08 +10:00
dl-procinfo.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
dl-procinfo.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
dl-tls.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
ffs.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fpu_control.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
gccframe.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
ifunc-sel.h Move sysdeps/powerpc/elf files 2012-03-28 09:25:31 +02:00
Implies PowerPC: unify math_ldbl.h implementations 2013-03-08 11:07:15 -03:00
jmpbuf-offsets.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
jmpbuf-unwind.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
ldsodefs.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
locale-defines.sym Optimized strcasecmp for Power7 2011-12-17 20:32:59 -05:00
longjmp.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
machine-gmon.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
Makefile abilist-pattern configurability 2014-02-04 09:48:47 -02:00
math-tests.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
memmove.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
memusage.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
mp_clz_tab.c Update. 2002-03-14 20:48:50 +00:00
novmx-longjmp.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
novmx-sigjmp.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
novmxsetjmp.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
preconfigure Add e500 port. 2013-10-18 21:04:22 +00:00
rtld-global-offsets.sym PowerPC: Define AT_HWCAP2 bits and AT_HWCAP2 handling for POWER8. 2013-06-28 16:52:49 -05:00
sched_cpucount.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
sigjmp.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
sotruss-lib.c PowerPC: sotruss-lib implementation 2014-01-15 12:14:06 -06:00
stackinfo.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
strcat.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
sysdep.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
test-arith.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
test-arithf.c Update. 1997-08-10 18:37:15 +00:00
test-gettimebase.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
tls-macros.h Split tls-macros.h in sysdeps directories. 2012-07-19 17:04:04 -03:00
tst-stack-align.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
Versions Update. 2004-02-14 05:16:57 +00:00