glibc/sysdeps/ieee754
Stefan Liebler c4d17461e0 S/390: Do not raise inexact exception in lrint/lround. [BZ #19486]
I get some math test-failures on s390 for float/double/ldouble for
various lrint/lround functions like:
lrint (0x1p64): Exception "Inexact" set
lrint (-0x1p64): Exception "Inexact" set
lround (0x1p64): Exception "Inexact" set
lround (-0x1p64): Exception "Inexact" set
...

GCC emits "convert to fixed" instructions for casting floating point
values to integer values. These instructions raise invalid and inexact
exceptions if the floating point value exceeds the integer type ranges.

This patch enables the various FIX_DBL_LONG_CONVERT_OVERFLOW macros in
order to avoid a cast from floating point to integer type and raise the
invalid exception with feraiseexcept.
The ldbl-128 rint/round functions are now using the same logic.

ChangeLog:

	[BZ #19486]
	* sysdeps/s390/fix-fp-int-convert-overflow.h: New File.
	* sysdeps/generic/fix-fp-int-convert-overflow.h
	(FIX_LDBL_LONG_CONVERT_OVERFLOW,
	FIX_LDBL_LLONG_CONVERT_OVERFLOW): New define.
	* sysdeps/arm/fix-fp-int-convert-overflow.h: Likewise.
	* sysdeps/mips/mips32/fpu/fix-fp-int-convert-overflow.h:
	Likewise.
	* sysdeps/ieee754/ldbl-128/s_lrintl.c (__lrintl):
	Avoid conversions to long int where inexact exceptions
	could be raised.
	* sysdeps/ieee754/ldbl-128/s_lroundl.c (__lroundl):
	Likewise.
	* sysdeps/ieee754/ldbl-128/s_llrintl.c (__llrintl):
	Avoid conversions to long long int where inexact exceptions
	could be raised.
	* sysdeps/ieee754/ldbl-128/s_llroundl.c (__llroundl):
	Likewise.
2016-01-18 12:48:06 +01:00
..
bits Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
dbl-64 Call math_opt_barrier inside if 2016-01-15 05:23:20 -08:00
flt-32 Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
ldbl-64-128 Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
ldbl-96 Call math_opt_barrier inside if 2016-01-15 05:23:20 -08:00
ldbl-128 S/390: Do not raise inexact exception in lrint/lround. [BZ #19486] 2016-01-18 12:48:06 +01:00
ldbl-128ibm Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
ldbl-opt Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
ieee754.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
k_standard.c Add comment to CSTR macro in k_standard.c. 2015-02-27 01:12:19 +00:00
k_standardf.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
k_standardl.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
Makefile Avoid -Wno-write-strings for k_standard.c. 2015-02-26 22:50:54 +00:00
s_lib_version.c Remove trailing whitespace. 2013-06-05 20:44:03 +00:00
s_matherr.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_signgam.c Fix lgamma setting signgam for ISO C (bug 15421). 2015-11-20 22:49:59 +00:00