glibc/sysdeps/ieee754/flt-32
Joseph Myers 6ace393821 Fix pow missing underflows (bug 18825).
Similar to various other bugs in this area, pow functions can fail to
raise the underflow exception when the result is tiny and inexact but
one or more low bits of the intermediate result that is scaled down
(or, in the i386 case, converted from a wider evaluation format) are
zero.  This patch forces the exception in a similar way to previous
fixes, thereby concluding the fixes for known bugs with missing
underflow exceptions currently filed in Bugzilla.

Tested for x86_64, x86, mips64 and powerpc.

	[BZ #18825]
	* sysdeps/i386/fpu/i386-math-asm.h (FLT_NARROW_EVAL_UFLOW_NONNAN):
	New macro.
	(DBL_NARROW_EVAL_UFLOW_NONNAN): Likewise.
	(LDBL_CHECK_FORCE_UFLOW_NONNAN): Likewise.
	* sysdeps/i386/fpu/e_pow.S: Use DEFINE_DBL_MIN.
	(__ieee754_pow): Use DBL_NARROW_EVAL_UFLOW_NONNAN instead of
	DBL_NARROW_EVAL, reloading the PIC register as needed.
	* sysdeps/i386/fpu/e_powf.S: Use DEFINE_FLT_MIN.
	(__ieee754_powf): Use FLT_NARROW_EVAL_UFLOW_NONNAN instead of
	FLT_NARROW_EVAL.  Use separate return path for case when first
	argument is NaN.
	* sysdeps/i386/fpu/e_powl.S: Include <i386-math-asm.h>.  Use
	DEFINE_LDBL_MIN.
	(__ieee754_powl): Use LDBL_CHECK_FORCE_UFLOW_NONNAN, reloading the
	PIC register.
	* sysdeps/ieee754/dbl-64/e_pow.c (__ieee754_pow): Use
	math_check_force_underflow_nonneg.
	* sysdeps/ieee754/flt-32/e_powf.c (__ieee754_powf): Force
	underflow for subnormal result.
	* sysdeps/ieee754/ldbl-128/e_powl.c (__ieee754_powl): Likewise.
	* sysdeps/ieee754/ldbl-128ibm/e_powl.c (__ieee754_powl): Use
	math_check_force_underflow_nonneg.
	* sysdeps/x86/fpu/powl_helper.c (__powl_helper): Use
	math_check_force_underflow.
	* sysdeps/x86_64/fpu/x86_64-math-asm.h
	(LDBL_CHECK_FORCE_UFLOW_NONNAN): New macro.
	* sysdeps/x86_64/fpu/e_powl.S: Include <x86_64-math-asm.h>.  Use
	DEFINE_LDBL_MIN.
	(__ieee754_powl): Use LDBL_CHECK_FORCE_UFLOW_NONNAN.
	* math/auto-libm-test-in: Add more tests of pow.
	* math/auto-libm-test-out: Regenerated.
2015-09-25 22:29:10 +00:00
..
e_acosf.c
e_acoshf.c
e_asinf.c Refactor code forcing underflow exceptions. 2015-09-23 22:42:30 +00:00
e_atan2f.c
e_atanhf.c Refactor code forcing underflow exceptions. 2015-09-23 22:42:30 +00:00
e_coshf.c Avoid excess range overflowing results from cosh, sinh, lgamma (bug 18980). 2015-09-18 20:00:48 +00:00
e_exp2f.c Don't use volatile in exp2f. 2015-09-23 22:52:13 +00:00
e_expf.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_fmodf.c
e_gammaf_r.c Refactor code forcing underflow exceptions. 2015-09-23 22:42:30 +00:00
e_hypotf.c Simplify hypotf infinity handling (bug 15918). 2015-09-15 17:24:23 +00:00
e_ilogbf.c
e_j0f.c Avoid uninitialized warnings in Bessel functions. 2015-02-26 21:49:19 +00:00
e_j1f.c Refactor code forcing underflow exceptions. 2015-09-23 22:42:30 +00:00
e_jnf.c Refactor code forcing underflow exceptions. 2015-09-23 22:42:30 +00:00
e_lgammaf_r.c Avoid excess range overflowing results from cosh, sinh, lgamma (bug 18980). 2015-09-18 20:00:48 +00:00
e_log2f.c
e_log10f.c Fix several build failures with GCC6 due to unused static variables. 2015-09-18 20:42:54 +01:00
e_logf.c
e_powf.c Fix pow missing underflows (bug 18825). 2015-09-25 22:29:10 +00:00
e_rem_pio2f.c
e_remainderf.c
e_sinhf.c Refactor code forcing underflow exceptions. 2015-09-23 22:42:30 +00:00
e_sqrtf.c
k_cosf.c
k_rem_pio2f.c Use math_narrow_eval more consistently. 2015-09-23 18:14:57 +00:00
k_sinf.c Refactor code forcing underflow exceptions. 2015-09-23 22:42:30 +00:00
k_tanf.c Refactor code forcing underflow exceptions. 2015-09-23 22:42:30 +00:00
lgamma_negf.c Use math_narrow_eval more consistently. 2015-09-23 18:14:57 +00:00
lgamma_productf.c Fix lgamma (negative) inaccuracy (bug 2542, bug 2543, bug 2558). 2015-09-10 22:27:58 +00:00
mpn2flt.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
s_asinhf.c Refactor code forcing underflow exceptions. 2015-09-23 22:42:30 +00:00
s_atanf.c Refactor code forcing underflow exceptions. 2015-09-23 22:42:30 +00:00
s_cbrtf.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
s_ceilf.c
s_copysignf.c
s_cosf.c Fix several build failures with GCC6 due to unused static variables. 2015-09-18 20:42:54 +01:00
s_erff.c Refactor code forcing underflow exceptions. 2015-09-23 22:42:30 +00:00
s_expm1f.c Refactor code forcing underflow exceptions. 2015-09-23 22:42:30 +00:00
s_fabsf.c 2015-05-28 Wilco Dijkstra <wdijkstr@arm.com> 2015-05-28 11:42:55 +01:00
s_finitef.c Reduce number of constants in __finite* (bug 15384). 2015-09-17 16:47:14 +00:00
s_floorf.c
s_fpclassifyf.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
s_frexpf.c
s_isinff.c
s_isnanf.c
s_issignalingf.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
s_llrintf.c Use math_narrow_eval more consistently. 2015-09-23 18:14:57 +00:00
s_llroundf.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
s_log1pf.c Refactor code forcing underflow exceptions. 2015-09-23 22:42:30 +00:00
s_logbf.c
s_lrintf.c Use math_narrow_eval more consistently. 2015-09-23 18:14:57 +00:00
s_lroundf.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
s_modff.c
s_nearbyintf.c
s_nextafterf.c
s_remquof.c Fix sign of remquo zero remainder in round-downward mode (bug 17987). 2015-02-17 00:41:50 +00:00
s_rintf.c
s_roundf.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
s_scalblnf.c
s_scalbnf.c Make scalbn set errno (bug 6803). 2015-09-16 21:11:00 +00:00
s_signbitf.c Use the GCC builtin functions for the non-inlined signbit implementations. 2015-09-18 16:39:08 +01:00
s_sincosf.c Fix sincos errno setting (bug 15467). 2015-02-11 23:17:25 +00:00
s_sinf.c
s_tanf.c
s_tanhf.c Refactor code forcing underflow exceptions. 2015-09-23 22:42:30 +00:00
s_truncf.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
t_exp2f.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
w_expf.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