glibc/sysdeps/ieee754/ldbl-128
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
..
e_acoshl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
e_acosl.c Fix ldbl-128/ldbl-128ibm acosl inaccuracy (bug 18038, bug 18039). 2015-02-26 21:06:34 +00:00
e_asinl.c Refactor code forcing underflow exceptions. 2015-09-23 22:42:30 +00:00
e_atan2l.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
e_atanhl.c Refactor code forcing underflow exceptions. 2015-09-23 22:42:30 +00:00
e_coshl.c Fix cosh spurious underflows from expm1 (bug 16354), inaccurate results near 0 (bug 17061). 2014-06-23 20:20:10 +00:00
e_exp10l.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
e_expl.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
e_fmodl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
e_gammal_r.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
e_hypotl.c Fix hypot missing underflows (bug 18803). 2015-09-24 23:43:57 +00:00
e_ilogbl.c Finish ilogb changes 2012-04-18 14:31:43 +02:00
e_j0l.c Fix ldbl-128 j0l spurious underflows (bug 19156). 2015-10-21 16:40:20 +00:00
e_j1l.c Fix j1, jn missing errno setting on underflow (bug 18611). 2015-10-23 21:37:33 +00:00
e_jnl.c Fix j1, jn missing errno setting on underflow (bug 18611). 2015-10-23 21:37:33 +00:00
e_lgammal_r.c Fix ldbl-128 / ldbl-128ibm lgamma overflow handling (bug 16347, bug 19046). 2015-10-01 17:15:54 +00:00
e_log2l.c Convert 231 sysdeps function definitions to prototype style. 2015-10-19 12:04:33 +00:00
e_log10l.c Fix log10 (1) in round-downward mode (bug 16977). 2014-05-23 12:07:50 +00:00
e_logl.c Fix log (1) in round-downward mode (bug 16731). 2014-03-21 18:13:58 +00:00
e_powl.c Fix pow missing underflows (bug 18825). 2015-09-25 22:29:10 +00:00
e_rem_pio2l.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
e_remainderl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
e_sinhl.c Refactor code forcing underflow exceptions. 2015-09-23 22:42:30 +00:00
gamma_productl.c 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_cosl.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
k_sincosl.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
k_sinl.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
k_tanl.c Remove GCC version conditionals on -Wmaybe-uninitialized pragmas. 2015-10-27 23:42:20 +00:00
ldbl2mpn.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
lgamma_negl.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
lgamma_productl.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
Makefile * sysdeps/ieee754/ldbl-128/Makefile: New file. 2007-03-14 17:36:18 +00:00
math_ldbl.h
mpn2ldbl.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
printf_fphex.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_asinhl.c Refactor code forcing underflow exceptions. 2015-09-23 22:42:30 +00:00
s_atanl.c Refactor code forcing underflow exceptions. 2015-09-23 22:42:30 +00:00
s_cbrtl.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
s_ceill.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_copysignl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_cosl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_erfl.c Refactor code forcing underflow exceptions. 2015-09-23 22:42:30 +00:00
s_expm1l.c Refactor code forcing underflow exceptions. 2015-09-23 22:42:30 +00:00
s_fabsl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_finitel.c Reduce number of constants in __finite* (bug 15384). 2015-09-17 16:47:14 +00:00
s_floorl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_fma.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_fmal.c Call math_opt_barrier inside if 2016-01-15 05:23:20 -08:00
s_fpclassifyl.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_frexpl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_isinfl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_isnanl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_issignalingl.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_llrintl.c S/390: Do not raise inexact exception in lrint/lround. [BZ #19486] 2016-01-18 12:48:06 +01:00
s_llroundl.c S/390: Do not raise inexact exception in lrint/lround. [BZ #19486] 2016-01-18 12:48:06 +01:00
s_log1pl.c Fix ldbl-128 log1pl (-qNaN) spurious "invalid" exception (bug 19189). 2015-10-29 23:09:51 +00:00
s_logbl.c Optimize handling of denormals in logb/logbf/logbl 2012-05-26 13:53:22 +02:00
s_lrintl.c S/390: Do not raise inexact exception in lrint/lround. [BZ #19486] 2016-01-18 12:48:06 +01:00
s_lroundl.c S/390: Do not raise inexact exception in lrint/lround. [BZ #19486] 2016-01-18 12:48:06 +01:00
s_modfl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_nearbyintl.c Fix nearbyint scheduling of arithmetic past fesetenv (bug 15490). 2013-05-19 18:40:25 +00:00
s_nextafterl.c Make nextafter, nexttoward set errno (bug 6799). 2015-11-02 18:54:19 +00:00
s_nexttoward.c Make nextafter, nexttoward set errno (bug 6799). 2015-11-02 18:54:19 +00:00
s_nexttowardf.c Make nextafter, nexttoward set errno (bug 6799). 2015-11-02 18:54:19 +00:00
s_remquol.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_rintl.c Fix set-but-not-used warnings in ldbl-128 nearbyintl, rintl. 2012-11-20 14:26:07 +00:00
s_roundl.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_scalblnl.c [BZ #6803] Set errno for scalbln, scalbn 2014-06-20 07:48:20 +05:30
s_scalbnl.c Make scalbn set errno (bug 6803). 2015-09-16 21:11:00 +00:00
s_signbitl.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_sincosl.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_sinl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_tanhl.c Refactor code forcing underflow exceptions. 2015-09-23 22:42:30 +00:00
s_tanl.c Remove trailing whitespace. 2013-06-05 20:44:03 +00:00
s_truncl.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strtod_nan_ldouble.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strtold_l.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
t_expl.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
t_sincosl.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
w_expl.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
x2y2m1l.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00