glibc/sysdeps/i386/fpu
Joseph Myers 6f0f237bf5 Avoid excess range in results from i386 exp, hypot, pow functions (bug 18980).
i386 exp, hypot and pow functions can return overflowing and
underflowing values with excess range and precision; ; Wilco
Dijkstra's patches to make isfinite etc. expand inline cause this
pre-existing issue to result in test failures.

This patch fixes those functions to avoid excess range and precision
in their return values.  Appropriate macros are added for the repeated
code sequences; in future I'll add more such macros and refactor
existing code forcing underflow (with or without also eliminating
excess range and precision from the return value) to use such macros.

Tested for x86.  If, after this patch, you still see x86 libm test
failures with excess range or precision, please file bugs in Bugzilla.

	[BZ #18980]
	* sysdeps/i386/fpu/i386-math-asm.h (DEFINE_FLT_MIN): New macro.
	(DEFINE_DBL_MIN): Likewise.
	(FLT_NARROW_EVAL_UFLOW_NONNEG_NAN): Likewise.
	(DBL_NARROW_EVAL_UFLOW_NONNEG_NAN): Likewise.
	(FLT_NARROW_EVAL_UFLOW_NONNEG): Likewise.
	(DBL_NARROW_EVAL_UFLOW_NONNEG): Likewise.
	* sysdeps/i386/fpu/e_exp.S: Include <i386-math-asm.h>.
	(dbl_min): Replace with use of DEFINE_DBL_MIN.
	(__ieee754_exp): Use DBL_NARROW_EVAL_UFLOW_NONNEG_NAN.
	(__exp_finite): Use DBL_NARROW_EVAL_UFLOW_NONNEG.
	* sysdeps/i386/fpu/e_exp10.S: Include <i386-math-asm.h>.
	(dbl_min): Replace with use of DEFINE_DBL_MIN.
	(__ieee754_exp10): Use DBL_NARROW_EVAL_UFLOW_NONNEG_NAN.
	* sysdeps/i386/fpu/e_exp10f.S: Include <i386-math-asm.h>.
	(flt_min): Replace with use of DEFINE_FLT_MIN.
	(__ieee754_exp10f): Use FLT_NARROW_EVAL_UFLOW_NONNEG_NAN.
	* sysdeps/i386/fpu/e_exp2.S: Include <i386-math-asm.h>.
	(dbl_min): Replace with use of DEFINE_DBL_MIN.
	(__ieee754_exp2): Use DBL_NARROW_EVAL_UFLOW_NONNEG_NAN.
	* sysdeps/i386/fpu/e_exp2f.S: Include <i386-math-asm.h>.
	(flt_min): Replace with use of DEFINE_FLT_MIN.
	(__ieee754_exp2f): Use FLT_NARROW_EVAL_UFLOW_NONNEG_NAN.
	* sysdeps/i386/fpu/e_expf.S: Include <i386-math-asm.h>.
	(flt_min): Replace with use of DEFINE_FLT_MIN.
	(__ieee754_expf): Use FLT_NARROW_EVAL_UFLOW_NONNEG_NAN.
	(__expf_finite): Use FLT_NARROW_EVAL_UFLOW_NONNEG.
	* sysdeps/i386/fpu/e_hypot.S: Include <i386-math-asm.h>.
	(__ieee754_hypot): Use DBL_NARROW_EVAL.
	* sysdeps/i386/fpu/e_hypotf.S: Include <i386-math-asm.h>.
	(__ieee754_hypotf): Use FLT_NARROW_EVAL.
	* sysdeps/i386/fpu/e_pow.S: Include <i386-math-asm.h>.
	(__ieee754_pow): Use DBL_NARROW_EVAL.
	* sysdeps/i386/fpu/e_powf.S: Include <i386-math-asm.h>.
	(__ieee754_powf): Use FLT_NARROW_EVAL.
	* sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.S
	(__ieee754_expf_sse2): Convert double-precision result to single
	precision.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
2015-09-18 21:53:22 +00:00
..
doasin.c
e_acos.S
e_acosf.S
e_acosh.S
e_acoshf.S
e_acoshl.S
e_acosl.c
e_asin.S
e_asinf.S
e_atan2.S
e_atan2f.S
e_atan2l.c
e_atanh.S
e_atanhf.S
e_atanhl.S
e_exp2.S Avoid excess range in results from i386 exp, hypot, pow functions (bug 18980). 2015-09-18 21:53:22 +00:00
e_exp2f.S Avoid excess range in results from i386 exp, hypot, pow functions (bug 18980). 2015-09-18 21:53:22 +00:00
e_exp2l.S Fix exp2 missing underflows (bug 16521). 2015-09-14 22:00:12 +00:00
e_exp10.S Avoid excess range in results from i386 exp, hypot, pow functions (bug 18980). 2015-09-18 21:53:22 +00:00
e_exp10f.S Avoid excess range in results from i386 exp, hypot, pow functions (bug 18980). 2015-09-18 21:53:22 +00:00
e_exp10l.S
e_exp.S Avoid excess range in results from i386 exp, hypot, pow functions (bug 18980). 2015-09-18 21:53:22 +00:00
e_expf.S Avoid excess range in results from i386 exp, hypot, pow functions (bug 18980). 2015-09-18 21:53:22 +00:00
e_expl.S Fix x86_64 / x86 expm1l (-min_subnorm) result sign (bug 18569). 2015-06-21 18:43:10 +00:00
e_fmod.S
e_fmodf.S
e_fmodl.c
e_hypot.S Avoid excess range in results from i386 exp, hypot, pow functions (bug 18980). 2015-09-18 21:53:22 +00:00
e_hypotf.S Avoid excess range in results from i386 exp, hypot, pow functions (bug 18980). 2015-09-18 21:53:22 +00:00
e_ilogb.S
e_ilogbf.S
e_ilogbl.S
e_log2.S
e_log2f.S
e_log2l.S
e_log10.S
e_log10f.S
e_log10l.S
e_log.S
e_logf.S
e_logl.S
e_pow.S Avoid excess range in results from i386 exp, hypot, pow functions (bug 18980). 2015-09-18 21:53:22 +00:00
e_powf.S Avoid excess range in results from i386 exp, hypot, pow functions (bug 18980). 2015-09-18 21:53:22 +00:00
e_powl.S
e_rem_pio2.c
e_remainder.S
e_remainderf.S
e_remainderl.S
e_scalb.S Avoid excess range in results from i386 scalb functions (bug 18981). 2015-09-18 20:34:59 +00:00
e_scalbf.S Avoid excess range in results from i386 scalb functions (bug 18981). 2015-09-18 20:34:59 +00:00
e_scalbl.S
e_sqrt.S
e_sqrtf.S
e_sqrtl.c
fclrexcpt.c
fedisblxcpt.c
feenablxcpt.c
fegetenv.c
fegetexcept.c
fegetround.c
feholdexcpt.c
fenv_private.h
fesetenv.c
fesetround.c
feupdateenv.c
fgetexcptflg.c
fraiseexcpt.c
fsetexcptflg.c
ftestexcept.c
halfulp.c
i386-math-asm.h Avoid excess range in results from i386 exp, hypot, pow functions (bug 18980). 2015-09-18 21:53:22 +00:00
Implies
k_rem_pio2l.c
libm-test-ulps Avoid excess range in results from i386 exp, hypot, pow functions (bug 18980). 2015-09-18 21:53:22 +00:00
math_private.h
math-tests.h
mpatan2.c
mpatan.c
mpexp.c
mplog.c
mpsqrt.c
s_asinh.S
s_asinhf.S
s_asinhl.S
s_atan.S
s_atanf.S
s_atanl.c
s_cbrt.S
s_cbrtf.S
s_cbrtl.S
s_ceil.S
s_ceilf.S
s_ceill.S
s_copysign.S
s_copysignf.S
s_copysignl.S
s_expm1.S Fix expm1 missing underflows (bug 16353). 2015-06-22 21:06:19 +00:00
s_expm1f.S Fix expm1 missing underflows (bug 16353). 2015-06-22 21:06:19 +00:00
s_expm1l.S
s_fabs.S
s_fabsf.S
s_fabsl.S
s_fdim.S
s_fdimf.S
s_fdiml.S
s_finite.S
s_finitef.S
s_finitel.S
s_floor.S
s_floorf.S
s_floorl.S
s_fmax.S
s_fmaxf.S
s_fmaxl.S
s_fmin.S
s_fminf.S
s_fminl.S
s_fpclassifyl.c
s_frexp.S
s_frexpf.S
s_frexpl.S
s_isinfl.c
s_isnanl.c
s_llrint.S
s_llrintf.S
s_llrintl.S
s_log1p.S
s_log1pf.S
s_log1pl.S
s_logb.S
s_logbf.S
s_logbl.c
s_lrint.S
s_lrintf.S
s_lrintl.S
s_nearbyint.S
s_nearbyintf.S
s_nearbyintl.S
s_nextafterl.c
s_nexttoward.c
s_nexttowardf.c
s_remquo.S
s_remquof.S
s_remquol.S
s_rint.S
s_rintf.S
s_rintl.c
s_scalbln.c
s_scalblnf.c
s_scalblnl.c
s_scalbn.S Avoid excess range in results from i386 scalb functions (bug 18981). 2015-09-18 20:34:59 +00:00
s_scalbnf.S Avoid excess range in results from i386 scalb functions (bug 18981). 2015-09-18 20:34:59 +00:00
s_scalbnl.S Make scalbn set errno (bug 6803). 2015-09-16 21:11:00 +00:00
s_significand.S
s_significandf.S
s_significandl.c
s_trunc.S
s_truncf.S
s_truncl.S
slowexp.c
slowpow.c
t_exp.c
Versions
w_sqrt.c