glibc/soft-fp
Joseph Myers 454ac701e3 soft-fp: Add FP_DENORM_ZERO.
Continuing the addition of soft-fp features used in the Linux kernel,
this patch adds soft-fp support for FP_DENORM_ZERO (flushing input
subnormal operands to zero of the same sign).

There are some differences from the kernel version.  In the kernel,
the "inexact" exception is set when flushing to zero.  This does not
appear to match the documented semantics for either of the
architectures (alpha and sh) for which the kernel uses FP_DENORM_ZERO,
so this patch does not set "inexact" in this case.  More operations
now use raw or semi-raw unpacking for optimization than did in the
ten-year-old soft-fp version in the kernel, so checks of
FP_DENORM_ZERO are inserted in those operations.  They are also
inserted for comparisons (which already used raw unpacking in the old
version) as I believe that's the correct thing to do when input
subnormals are flushed to zero.  They are *not* inserted for _FP_NEG.
(If any processors do flush input subnormals to zero for negation, or
otherwise vary from the rules implemented when FP_DENORM_ZERO is set,
further macros for sfp-machine.h to control this may need to be
added.)

Although the addition for comparisons will cause FP_EX_DENORM to be
set in this case, it still won't be set for comparisons involving
subnormals when not flushed to zero.  It's quite possible that
accurate emulation of processors that have such an exception for
subnormal operands will require further changes relating to when
FP_EX_DENORM is set (in general, the support for things defined by
IEEE should be considered more reliable and mature than the support
for things outside the scope of IEEE floating point).

Although some processors also have a mode for abrupt underflow -
producing zeroes instead of output subnormals - there is no such mode
in the kernel's soft-fp, so no such mode is added to glibc's soft-fp
(although it could be if someone wanted to emulate such processor
support).

Tested for powerpc-nofpu that the disassembly of installed shared
libraries is unchanged by this patch.

	* soft-fp/soft-fp.h (FP_DENORM_ZERO): New macro.
	* soft-fp/op-common.h (_FP_UNPACK_CANONICAL): Check
	FP_DENORM_ZERO.
	(_FP_CHECK_FLUSH_ZERO): New macro.
	(_FP_ADD_INTERNAL): Call _FP_CHECK_FLUSH_ZERO.
	(_FP_CMP): Likewise.
	(_FP_CMP_EQ): Likewise.
	(_FP_TO_INT): Do not set inexact for subnormal arguments if
	FP_DENORM_ZERO.
	(FP_EXTEND): Call _FP_CHECK_FLUSH_ZERO.
	(FP_TRUNC): Likewise.
2014-10-09 01:09:22 +00:00
..
Banner
Makefile Consistently include Makeconfig after defining subdir. 2014-02-26 23:12:03 +00:00
adddf3.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
addsf3.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
addtf3.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
divdf3.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
divsf3.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
divtf3.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
double.h soft-fp: Refactor exception handling for comparisons. 2014-10-09 01:03:56 +00:00
eqdf2.c soft-fp: Refactor exception handling for comparisons. 2014-10-09 01:03:56 +00:00
eqsf2.c soft-fp: Refactor exception handling for comparisons. 2014-10-09 01:03:56 +00:00
eqtf2.c soft-fp: Refactor exception handling for comparisons. 2014-10-09 01:03:56 +00:00
extenddftf2.c soft-fp: Make extensions of subnormals from XFmode to TFmode signal underflow if traps enabled. 2014-10-09 01:00:41 +00:00
extended.h soft-fp: Refactor exception handling for comparisons. 2014-10-09 01:03:56 +00:00
extendsfdf2.c soft-fp: Make extensions of subnormals from XFmode to TFmode signal underflow if traps enabled. 2014-10-09 01:00:41 +00:00
extendsftf2.c soft-fp: Make extensions of subnormals from XFmode to TFmode signal underflow if traps enabled. 2014-10-09 01:00:41 +00:00
extendxftf2.c soft-fp: Make extensions of subnormals from XFmode to TFmode signal underflow if traps enabled. 2014-10-09 01:00:41 +00:00
fixdfdi.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fixdfsi.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fixdfti.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fixsfdi.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fixsfsi.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fixsfti.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fixtfdi.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fixtfsi.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fixtfti.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fixunsdfdi.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fixunsdfsi.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fixunsdfti.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fixunssfdi.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fixunssfsi.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fixunssfti.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fixunstfdi.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fixunstfsi.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fixunstfti.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
floatdidf.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
floatdisf.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
floatditf.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
floatsidf.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
floatsisf.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
floatsitf.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
floattidf.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
floattisf.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
floattitf.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
floatundidf.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
floatundisf.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
floatunditf.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
floatunsidf.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
floatunsisf.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
floatunsitf.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
floatuntidf.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
floatuntisf.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
floatuntitf.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fmadf4.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fmasf4.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fmatf4.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
gedf2.c soft-fp: Refactor exception handling for comparisons. 2014-10-09 01:03:56 +00:00
gesf2.c soft-fp: Refactor exception handling for comparisons. 2014-10-09 01:03:56 +00:00
getf2.c soft-fp: Refactor exception handling for comparisons. 2014-10-09 01:03:56 +00:00
ledf2.c soft-fp: Refactor exception handling for comparisons. 2014-10-09 01:03:56 +00:00
lesf2.c soft-fp: Refactor exception handling for comparisons. 2014-10-09 01:03:56 +00:00
letf2.c soft-fp: Refactor exception handling for comparisons. 2014-10-09 01:03:56 +00:00
muldf3.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
mulsf3.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
multf3.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
negdf2.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
negsf2.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
negtf2.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
op-1.h soft-fp: Fix comment formatting. 2014-09-17 22:20:45 +00:00
op-2.h soft-fp: Fix comment formatting. 2014-09-17 22:20:45 +00:00
op-4.h soft-fp: Fix comment formatting. 2014-09-17 22:20:45 +00:00
op-8.h soft-fp: Fix comment formatting. 2014-09-17 22:20:45 +00:00
op-common.h soft-fp: Add FP_DENORM_ZERO. 2014-10-09 01:09:22 +00:00
quad.h soft-fp: Refactor exception handling for comparisons. 2014-10-09 01:03:56 +00:00
single.h soft-fp: Refactor exception handling for comparisons. 2014-10-09 01:03:56 +00:00
soft-fp.h soft-fp: Add FP_DENORM_ZERO. 2014-10-09 01:09:22 +00:00
sqrtdf2.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
sqrtsf2.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
sqrttf2.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
subdf3.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
subsf3.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
subtf3.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
testit.c Remove trailing whitespace. 2013-06-05 20:44:03 +00:00
truncdfsf2.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
trunctfdf2.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
trunctfsf2.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
trunctfxf2.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
unorddf2.c soft-fp: Refactor exception handling for comparisons. 2014-10-09 01:03:56 +00:00
unordsf2.c soft-fp: Refactor exception handling for comparisons. 2014-10-09 01:03:56 +00:00
unordtf2.c soft-fp: Refactor exception handling for comparisons. 2014-10-09 01:03:56 +00:00