glibc/sysdeps/x86_64/fpu
Joseph Myers f4015c8a86 Use generic fdim on more architectures (bug 6796, bug 20255, bug 20256).
Some architectures have their own versions of fdim functions, which
are missing errno setting (bug 6796) and may also return sNaN instead
of qNaN for sNaN input, in the case of the x86 / x86_64 long double
versions (bug 20256).

These versions are not actually doing anything that a compiler
couldn't generate, just straightforward comparisons / arithmetic (and,
in the x86 / x86_64 case, testing for NaNs with fxam, which isn't
actually needed once you use an unordered comparison and let the NaNs
pass through the same subtraction as non-NaN inputs).  This patch
removes the x86 / x86_64 / powerpc versions, so that those
architectures use the generic C versions, which correctly handle
setting errno and deal properly with sNaN inputs.  This seems better
than dealing with setting errno in lots of .S versions.

The i386 versions also return results with excess range and precision,
which is not appropriate for a function exactly defined by reference
to IEEE operations.  For errno setting to work correctly on overflow,
it's necessary to remove excess range with math_narrow_eval, which
this patch duly does in the float and double versions so that the
tests can reliably pass on x86.  For float, this avoids any double
rounding issues as the long double precision is more than twice that
of float.  For double, double rounding issues will need to be
addressed separately, so this patch does not fully fix bug 20255.

Tested for x86_64, x86 and powerpc.

	[BZ #6796]
	[BZ #20255]
	[BZ #20256]
	* math/s_fdim.c: Include <math_private.h>.
	(__fdim): Use math_narrow_eval on result.
	* math/s_fdimf.c: Include <math_private.h>.
	(__fdimf): Use math_narrow_eval on result.
	* sysdeps/i386/fpu/s_fdim.S: Remove file.
	* sysdeps/i386/fpu/s_fdimf.S: Likewise.
	* sysdeps/i386/fpu/s_fdiml.S: Likewise.
	* sysdeps/i386/i686/fpu/s_fdim.S: Likewise.
	* sysdeps/i386/i686/fpu/s_fdimf.S: Likewise.
	* sysdeps/i386/i686/fpu/s_fdiml.S: Likewise.
	* sysdeps/powerpc/fpu/s_fdim.c: Likewise.
	* sysdeps/powerpc/fpu/s_fdimf.c: Likewise.
	* sysdeps/powerpc/powerpc32/fpu/s_fdim.c: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/s_fdim.c: Likewise.
	* sysdeps/x86_64/fpu/s_fdiml.S: Likewise.
	* math/libm-test.inc (fdim_test_data): Expect errno setting on
	overflow.  Add sNaN tests.
2016-06-14 16:04:19 +00:00
..
multiarch Do not raise "inexact" from x86_64 SSE4.1 ceil, floor (bug 15479). 2016-05-24 21:11:18 +00:00
dla.h
e_acosl.c
e_atan2l.c
e_exp2l.S
e_exp10l.S
e_expf.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
e_expl.S Fix i386/x86_64 expl, exp10l, expm1l for sNaN input (bug 20226). 2016-06-08 21:55:06 +00:00
e_fmodl.S
e_ilogbl.S
e_log2l.S Fix i386/x86_64 log2l (sNaN) (bug 20235). 2016-06-09 18:04:30 +00:00
e_log10l.S Fix i386/x86_64 log10l (sNaN) (bug 20228). 2016-06-08 22:59:18 +00:00
e_logl.S Fix i386/x86_64 logl (sNaN) (bug 20227). 2016-06-08 22:24:06 +00:00
e_powl.S Fix x86_64 / x86 powl inaccuracy for integer exponents (bug 19848). 2016-03-24 01:32:52 +00:00
e_remainderl.S
e_scalbl.S
e_sqrt.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
e_sqrtf.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
e_sqrtl.c
fclrexcpt.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
fedisblxcpt.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
feenablxcpt.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
fegetenv.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
fegetexcept.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
fegetround.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
feholdexcpt.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
fesetenv.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
fesetround.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
feupdateenv.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
fgetexcptflg.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
fraiseexcpt.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
fsetexcptflg.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
ftestexcept.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
Implies
k_rem_pio2l.c
libm-test-ulps Fix x86_64 / x86 powl inaccuracy for integer exponents (bug 19848). 2016-03-24 01:32:52 +00:00
Makefile
math_ldbl.h
math_private.h
math-tests-arch.h 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_atanl.c
s_ceill.S
s_copysign.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_copysignf.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_copysignl.S
s_cosf.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_expm1l.S
s_fabs.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_fabsf.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_fabsl.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_finitel.S
s_floorl.S
s_fmax.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_fmaxf.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_fmaxl.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_fmin.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_fminf.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_fminl.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_fpclassifyl.c
s_isinfl.c
s_isnanl.c
s_llrint.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_llrintf.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_llrintl.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_log1pl.S Fix i386/x86_64 log1pl (sNaN) (bug 20229). 2016-06-08 23:11:42 +00:00
s_logbl.c
s_lrint.S
s_lrintf.S
s_lrintl.S
s_nearbyintl.S
s_nextafterl.c
s_nexttoward.c
s_nexttowardf.c
s_rintl.c
s_scalbnl.S
s_signbit.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_signbitf.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_significandl.c
s_sincosf.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_sinf.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_truncl.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_d_cos2_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_d_cos4_core_avx.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_d_cos4_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_d_cos8_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_d_exp2_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_d_exp4_core_avx.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_d_exp4_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_d_exp8_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_d_exp_data.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_d_exp_data.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_d_log2_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_d_log4_core_avx.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_d_log4_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_d_log8_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_d_log_data.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_d_log_data.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_d_pow2_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_d_pow4_core_avx.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_d_pow4_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_d_pow8_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_d_pow_data.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_d_pow_data.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_d_sin2_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_d_sin4_core_avx.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_d_sin4_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_d_sin8_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_d_sincos2_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_d_sincos4_core_avx.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_d_sincos4_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_d_sincos8_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_d_trig_data.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_d_trig_data.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_d_wrapper_impl.h Use JUMPTARGET in x86-64 mathvec 2016-03-16 14:24:19 -07:00
svml_finite_alias.S Use PIC relocation in ALIAS_IMPL 2016-02-17 14:23:32 -08:00
svml_s_cosf4_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_s_cosf8_core_avx.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_s_cosf8_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_s_cosf16_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_s_expf4_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_s_expf8_core_avx.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_s_expf8_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_s_expf16_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_s_expf_data.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_s_expf_data.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_s_logf4_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_s_logf8_core_avx.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_s_logf8_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_s_logf16_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_s_logf_data.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_s_logf_data.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_s_powf4_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_s_powf8_core_avx.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_s_powf8_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_s_powf16_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_s_powf_data.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_s_powf_data.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_s_sincosf4_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_s_sincosf8_core_avx.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_s_sincosf8_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_s_sincosf16_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_s_sinf4_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_s_sinf8_core_avx.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_s_sinf8_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_s_sinf16_core.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_s_trig_data.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_s_trig_data.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
svml_s_wrapper_impl.h Use JUMPTARGET in x86-64 mathvec 2016-03-16 14:24:19 -07:00
test-double-vlen2-wrappers.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
test-double-vlen2.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
test-double-vlen4-avx2-wrappers.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
test-double-vlen4-avx2.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
test-double-vlen4-wrappers.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
test-double-vlen4.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
test-double-vlen8-wrappers.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
test-double-vlen8.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
test-float-vlen4-wrappers.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
test-float-vlen4.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
test-float-vlen8-avx2-wrappers.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
test-float-vlen8-avx2.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
test-float-vlen8-wrappers.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
test-float-vlen8.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
test-float-vlen16-wrappers.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
test-float-vlen16.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
Versions
x86_64-math-asm.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00