glibc/sysdeps/ieee754/ldbl-128ibm
Joseph Myers 613c92b3b5 Fix ldbl-128ibm nearbyintl in non-default rounding modes (bug 19790).
The ldbl-128ibm implementation of nearbyintl uses logic that only
works in round-to-nearest mode.  This contrasts with rintl, which
works in all rounding modes.

Now, arguably nearbyintl could simply be aliased to rintl, given that
spurious "inexact" is generally allowed for ldbl-128ibm, even for the
underlying arithmetic operations.  But given that the only point of
nearbyintl is to avoid "inexact", this patch follows the more
conservative approach of adding conditionals to the rintl
implementation to make it suitable for use to implement nearbyintl,
then builds it for nearbyintl with USE_AS_NEARBYINTL defined.  The
test test-nearbyint-except-2 shows up issues when traps on "inexact"
are enabled, which turn out to be problems with the powerpc
fenv_private.h implementation (two functions that should disable
exception traps potentially failing to do so in some cases); this
patch duly fixes that as well (I don't see any other existing cases
where this would be user-visible; there isn't much use of *_NOEX,
*hold* etc. in libm that requires exceptions to be discarded and not
trapped on).

Tested for powerpc.

	[BZ #19790]
	* sysdeps/ieee754/ldbl-128ibm/s_rintl.c [USE_AS_NEARBYINTL]
	(rintl): Define as macro.
	[USE_AS_NEARBYINTL] (__rintl): Likewise.
	(__rintl) [USE_AS_NEARBYINTL]: Use SET_RESTORE_ROUND_NOEX instead
	of fesetround.  Ensure results are evaluated before end of scope.
	* sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c: Define
	USE_AS_NEARBYINTL and include s_rintl.c.
	* sysdeps/powerpc/fpu/fenv_private.h (libc_feholdsetround_ppc):
	Disable exception traps in new environment.
	(libc_feholdsetround_ppc_ctx): Likewise.
2016-03-09 00:30:59 +00:00
..
e_acoshl.c Fix ldbl-128ibm acoshl inaccuracy (bug 18019). 2015-02-25 00:01:15 +00:00
e_acosl.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
e_asinl.c Refactor code forcing underflow exceptions. 2015-09-23 22:42:30 +00:00
e_atan2l.c PowerPC floating point little-endian [3 of 15] 2013-10-04 10:32:36 +09:30
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 Fix ldbl-128ibm fmodl handling of equal arguments with low part zero (bug 19602). 2016-02-18 22:54:07 +00: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 Fix ldbl-128ibm ilogbl near powers of 2 (bug 18029). 2015-02-26 12:57:21 +00:00
e_j0l.c 2006-01-27 Dwayne Grant McConnell <decimal@us.ibm.com> 2006-01-28 00:15:15 +00:00
e_j1l.c 2006-01-27 Dwayne Grant McConnell <decimal@us.ibm.com> 2006-01-28 00:15:15 +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 2006-01-27 Dwayne Grant McConnell <decimal@us.ibm.com> 2006-01-28 00:15:15 +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 ldbl-128ibm logl inaccuracy near 1 (bug 19351). 2015-12-09 23:51:11 +00:00
e_powl.c Fix ldbl-128ibm powl overflow handling (bug 19674). 2016-02-19 01:07:40 +00:00
e_rem_pio2l.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
e_remainderl.c Fix ldbl-128ibm remainderl equality test for zero low part (bug 19677). 2016-03-08 00:27:21 +00:00
e_sinhl.c Fix ldbl-128ibm sinhl spurious overflows (bug 19350). 2015-12-09 22:37:08 +00:00
e_sqrtl.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +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 Fix ldbl-128ibm remainderl equality test for zero low part (bug 19677). 2016-03-08 00:27:21 +00:00
math_ldbl.h Fix ldbl-128ibm floorl for non-default rounding modes (bug 17899). 2016-02-18 21:31:10 +00:00
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 2006-01-27 Dwayne Grant McConnell <decimal@us.ibm.com> 2006-01-28 00:15:15 +00:00
s_ceill.c Fix ldbl-128ibm ceill for non-default rounding modes (bug 19592). 2016-02-18 21:40:39 +00:00
s_copysignl.c Remove IS_IN_libm 2014-11-24 11:41:47 +05:30
s_cosl.c PowerPC floating point little-endian [2 of 15] 2013-10-04 10:32:19 +09:30
s_erfl.c Remove unused variables 2016-01-27 09:30:16 +01:00
s_expm1l.c Clean up ldbl-128 / ldbl-128ibm expm1l dead code (bug 16415). 2015-09-16 16:42:46 +00:00
s_fabsl.c PowerPC floating point little-endian [2 of 15] 2013-10-04 10:32:19 +09:30
s_finitel.c Reduce number of constants in __finite* (bug 15384). 2015-09-17 16:47:14 +00:00
s_floorl.c Fix ldbl-128ibm floorl for non-default rounding modes (bug 17899). 2016-02-18 21:31:10 +00:00
s_fmal.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_fpclassifyl.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_frexpl.c FIx ldbl-128ibm frexpl for 32-bit systems (bug 16619, bug 16740). 2014-11-26 13:54:55 +00:00
s_isinfl.c Remove IS_IN_libm 2014-11-24 11:41:47 +05:30
s_isnanl.c Remove IS_IN_libm 2014-11-24 11:41:47 +05:30
s_issignalingl.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_llrintl.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_llroundl.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_log1pl.c Remove unused variables 2016-01-27 09:30:16 +01:00
s_logbl.c Work around powerpc32 integer 0 converting to -0 (bug 887, bug 19049, bug 19050). 2015-10-05 17:46:50 +00:00
s_lrintl.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_lroundl.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_modfl.c Remove IS_IN_libm 2014-11-24 11:41:47 +05:30
s_nearbyintl.c Fix ldbl-128ibm nearbyintl in non-default rounding modes (bug 19790). 2016-03-09 00:30:59 +00:00
s_nextafterl.c Fix ldbl-128ibm nextafterl, nexttowardl sign of zero result (bug 19678). 2016-02-19 17:19:53 +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 Fix ldbl-128ibm remainderl, remquol equality tests (bug 19603). 2016-02-19 00:55:46 +00:00
s_rintl.c Fix ldbl-128ibm nearbyintl in non-default rounding modes (bug 19790). 2016-03-09 00:30:59 +00:00
s_roundl.c Fix ldbl-128ibm roundl for non-default rounding modes (bug 19594). 2016-02-18 22:24:32 +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 PowerPC floating point little-endian [2 of 15] 2013-10-04 10:32:19 +09:30
s_tanhl.c Fix ldbl-128ibm tanhl inaccuracy for small arguments (bug 19349). 2015-12-09 21:20:18 +00:00
s_tanl.c PowerPC floating point little-endian [2 of 15] 2013-10-04 10:32:19 +09:30
s_truncl.c Fix ldbl-128ibm truncl for non-default rounding modes (bug 19593). 2016-02-18 21:52:07 +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_sincosl.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
test-fmodl-ldbl-128ibm.c Fix ldbl-128ibm remainderl equality test for zero low part (bug 19677). 2016-03-08 00:27:21 +00:00
test-fmodrem-ldbl-128ibm.c Fix ldbl-128ibm remainderl equality test for zero low part (bug 19677). 2016-03-08 00:27:21 +00:00
test-remainderl-ldbl-128ibm.c Fix ldbl-128ibm remainderl equality test for zero low part (bug 19677). 2016-03-08 00:27:21 +00:00
test-remquol-ldbl-128ibm.c Fix ldbl-128ibm remainderl equality test for zero low part (bug 19677). 2016-03-08 00:27:21 +00:00
tst-strtold-ldbl-128ibm.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
w_expl.c Fix ldbl-128ibm expl overflow in non-default rounding modes (bug 19078). 2015-10-06 17:37:49 +00:00
w_log1pl.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
w_scalblnl.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
x2y2m1l.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00