glibc/sysdeps/i386/fpu
Joseph Myers 5b0626b9c5 Fix x86 / x86_64 expl / expl10l wild results in directed rounding modes (bug 16356).
This patch fixes bug 16356, bad results from x86 / x86_64 expl /
exp10l in directed rounding modes, the most serious of the bugs shown
up by my patch expanding libm test coverage.  When I fixed bug 16293,
I thought it was only necessary to set round-to-nearest when using
frndint in expm1 functions, because in other cases the cancellation
error from having the resulting fractional part close to 1 or -1 would
not be significant.  However, in expl and exp10l, the way the final
fractional part gets computed (something more complicated than a
simple subtraction, because more precision is needed than you'd get
that way) can result in a value outside the range [-1, 1] when the
argument to frndint was very close to an integer and was rounded the
"wrong" way because of the rounding mode - and the f2xm1 instruction
has undefined results if its argument is outside [-1, 1], so resulting
in the large errors seen.  So this patch removes the USE_AS_EXPM1L
conditionals on the round-to-nearest settings, so all of expl, expm1l
and exp10l now get round-to-nearest used for frndint (meaning the
final fractional part can at most be slightly above 0.5 in
magnitude).  Associated tests of exp and exp10 are added and testing
of exp10 in directed rounding modes enabled.

Tested x86_64 and x86 and ulps updated accordingly.

	* sysdeps/i386/fpu/e_expl.S (IEEE754_EXPL): Also set
	round-to-nearest for [!USE_AS_EXPM1L].
	* sysdeps/x86_64/fpu/e_expl.S (IEEE754_EXPL): Likewise.
	* math/auto-libm-test-in: Do not expect cosh tests to fail.  Add
	more tests of exp and exp10.  Expect some exp10 tests to miss
	exceptions or fail in directed rounding modes.
	* math/auto-libm-test-out: Regenerated.
	* math/libm-test.inc (exp10_tonearest_test_data): New array.
	(exp10_test_tonearest): New function.
	(exp10_towardzero_test_data): New array.
	(exp10_test_towardzero): New function.
	(exp10_downward_test_data): New array.
	(exp10_test_downward): New function.
	(exp10_upward_test_data): New array.
	(exp10_test_upward): New function.
	(main): Call the new functions.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
2013-12-21 13:07:16 +00:00
..
Implies Use x86_64 fpu/bits/fenv.h for i386 and x86_64 2012-06-06 10:13:19 -07:00
Versions
doasin.c
e_acos.S Fix x86 acos near 1 (bug 13942). 2012-04-30 18:56:39 +00:00
e_acosf.S Fix acos (-1) in round-downwards mode on x86 (bug 14034). 2012-04-30 09:38:06 +00:00
e_acosh.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
e_acoshf.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
e_acoshl.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
e_acosl.c Fix x86 acos near 1 (bug 13942). 2012-04-30 18:56:39 +00:00
e_asin.S Fix x86 acos near 1 (bug 13942). 2012-04-30 18:56:39 +00:00
e_asinf.S
e_atan2.S
e_atan2f.S
e_atan2l.c
e_atanh.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
e_atanhf.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
e_atanhl.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
e_exp.S Optimize exp 2011-10-15 20:22:59 -04:00
e_exp2.S
e_exp2f.S
e_exp2l.S
e_exp10.S
e_exp10f.S
e_exp10l.S Fix exp10 inaccuracy and exceptions (bugs 13884, 13914). 2012-05-06 18:23:44 +00:00
e_expf.S Optimize exp 2011-10-15 20:22:59 -04:00
e_expl.S Fix x86 / x86_64 expl / expl10l wild results in directed rounding modes (bug 16356). 2013-12-21 13:07:16 +00:00
e_fmod.S
e_fmodf.S
e_fmodl.c
e_hypot.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
e_hypotf.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
e_ilogb.S Remove useless __ilogb*_finite aliases 2012-04-18 00:40:13 +02:00
e_ilogbf.S Remove useless __ilogb*_finite aliases 2012-04-18 00:40:13 +02:00
e_ilogbl.S Remove useless __ilogb*_finite aliases 2012-04-18 00:40:13 +02:00
e_log.S Get rid of ASM_TYPE_DIRECTIVE{,_PREFIX}. 2012-08-02 21:04:29 +02:00
e_log2.S Get rid of ASM_TYPE_DIRECTIVE{,_PREFIX}. 2012-08-02 21:04:29 +02:00
e_log2f.S Get rid of ASM_TYPE_DIRECTIVE{,_PREFIX}. 2012-08-02 21:04:29 +02:00
e_log2l.S Get rid of ASM_TYPE_DIRECTIVE{,_PREFIX}. 2012-08-02 21:04:29 +02:00
e_log10.S Get rid of ASM_TYPE_DIRECTIVE{,_PREFIX}. 2012-08-02 21:04:29 +02:00
e_log10f.S Get rid of ASM_TYPE_DIRECTIVE{,_PREFIX}. 2012-08-02 21:04:29 +02:00
e_log10l.S Get rid of ASM_TYPE_DIRECTIVE{,_PREFIX}. 2012-08-02 21:04:29 +02:00
e_logf.S Get rid of ASM_TYPE_DIRECTIVE{,_PREFIX}. 2012-08-02 21:04:29 +02:00
e_logl.S Get rid of ASM_TYPE_DIRECTIVE{,_PREFIX}. 2012-08-02 21:04:29 +02:00
e_pow.S Fix spurious "inexact" exceptions from x86 pow with NaN argument (bug 16167). 2013-11-16 12:45:11 +00:00
e_powf.S Fix spurious "inexact" exceptions from x86 pow with NaN argument (bug 16167). 2013-11-16 12:45:11 +00:00
e_powl.S Fix spurious "inexact" exceptions from x86 pow with NaN argument (bug 16167). 2013-11-16 12:45:11 +00:00
e_rem_pio2.c
e_remainder.S
e_remainderf.S
e_remainderl.S
e_scalb.S Get rid of ASM_TYPE_DIRECTIVE{,_PREFIX}. 2012-08-02 21:04:29 +02:00
e_scalbf.S Get rid of ASM_TYPE_DIRECTIVE{,_PREFIX}. 2012-08-02 21:04:29 +02:00
e_scalbl.S Get rid of ASM_TYPE_DIRECTIVE{,_PREFIX}. 2012-08-02 21:04:29 +02:00
e_sqrt.S Fix x86 sqrt rounding (bug 14032). 2013-11-29 16:31:16 +00:00
e_sqrtf.S
e_sqrtl.c
fclrexcpt.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
fedisblxcpt.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
feenablxcpt.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
fegetenv.c Remove bp-sym.h and BP_SYM uses from C code. 2013-02-14 13:12:02 +00:00
fegetexcept.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
fegetround.c Fix dbl-64 e_sqrt.c for non-default rounding modes (bug 16271). 2013-11-28 16:50:38 +00:00
feholdexcpt.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
fenv_private.h Set/restore rounding mode only when needed 2013-06-12 10:36:48 +05:30
fesetenv.c Remove bp-sym.h and BP_SYM uses from C code. 2013-02-14 13:12:02 +00:00
fesetround.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
feupdateenv.c Remove bp-sym.h and BP_SYM uses from C code. 2013-02-14 13:12:02 +00:00
fgetexcptflg.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
fraiseexcpt.c Fix typos. 2013-08-21 19:48:48 +02:00
fsetexcptflg.c Remove bp-sym.h and BP_SYM uses from C code. 2013-02-14 13:12:02 +00:00
ftestexcept.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
halfulp.c
k_rem_pio2l.c
libm-test-ulps Fix x86 / x86_64 expl / expl10l wild results in directed rounding modes (bug 16356). 2013-12-21 13:07:16 +00:00
math-tests.h Refer to two GCC PRs. 2013-04-03 14:13:44 +02:00
math_private.h Optimize private 387 fenv access; share code between i386 and x86_64. 2012-03-19 06:51:39 -07:00
mpatan.c
mpatan2.c
mpexp.c
mplog.c
mpsqrt.c
s_asinh.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_asinhf.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_asinhl.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_atan.S
s_atanf.S
s_atanl.c
s_cbrt.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_cbrtf.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_cbrtl.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_ceil.S
s_ceilf.S
s_ceill.S
s_copysign.S
s_copysignf.S
s_copysignl.S
s_expm1.S Fix x86/x86_64 expm1 inaccuracy near 0 in directed rounding modes (bug 16293). 2013-12-19 13:36:10 +00:00
s_expm1f.S Fix x86/x86_64 expm1 inaccuracy near 0 in directed rounding modes (bug 16293). 2013-12-19 13:36:10 +00:00
s_expm1l.S Fix x86/x86_64 expm1l inaccuracy and exceptions (bugs 13885, 13923). 2012-05-07 19:13:08 +00:00
s_fabs.S
s_fabsf.S
s_fabsl.S
s_fdim.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fdimf.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fdiml.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_finite.S
s_finitef.S
s_finitel.S
s_floor.S
s_floorf.S
s_floorl.S
s_fmax.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fmaxf.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fmaxl.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fmin.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fminf.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fminl.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fpclassifyl.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_frexp.S Remove remaining bounded-pointers support from i386 .S files. 2013-02-21 22:21:52 +00:00
s_frexpf.S Remove remaining bounded-pointers support from i386 .S files. 2013-02-21 22:21:52 +00:00
s_frexpl.S Remove remaining bounded-pointers support from i386 .S files. 2013-02-21 22:21:52 +00: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_llrint.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_llrintf.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_llrintl.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_log1p.S Remove __ELF__ conditionals 2012-02-07 00:41:11 +01:00
s_log1pf.S Remove __ELF__ conditionals 2012-02-07 00:41:11 +01:00
s_log1pl.S Remove __ELF__ conditionals 2012-02-07 00:41:11 +01:00
s_logb.S
s_logbf.S
s_logbl.c
s_lrint.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_lrintf.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_lrintl.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_nearbyint.S
s_nearbyintf.S
s_nearbyintl.S
s_nextafterl.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_nexttoward.c Fix nexttoward bugs (bugs 2550, 2570). 2012-05-01 15:37:43 +00:00
s_nexttowardf.c Fix nexttoward bugs (bugs 2550, 2570). 2012-05-01 15:37:43 +00:00
s_remquo.S Remove remaining bounded-pointers support from i386 .S files. 2013-02-21 22:21:52 +00:00
s_remquof.S Remove remaining bounded-pointers support from i386 .S files. 2013-02-21 22:21:52 +00:00
s_remquol.S Remove remaining bounded-pointers support from i386 .S files. 2013-02-21 22:21:52 +00:00
s_rint.S
s_rintf.S
s_rintl.c
s_scalbln.c
s_scalblnf.c
s_scalblnl.c
s_scalbn.S
s_scalbnf.S
s_scalbnl.S
s_significand.S
s_significandf.S
s_significandl.c
s_trunc.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_truncf.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_truncl.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
slowexp.c
slowpow.c
t_exp.c
w_sqrt.c Fix x86 sqrt rounding (bug 14032). 2013-11-29 16:31:16 +00:00