glibc/sysdeps/ieee754/dbl-64/wordsize-64
Joseph Myers d9afe48d55 Fix dbl-64/wordsize-64 remquo (bug 17569).
The dbl-64/wordsize-64 remquo implementation follows similar logic to
various other implementations, but where that logic computes some
absolute values, it wrongly uses a previously computed bit-pattern for
the absolute value of the first argument, where actually it needs the
absolute value of the first argument mod 8 times the second.  This
patch fixes it to compute the correct absolute value.

The integer quotient result of remquo is only specified mod 8
(including its sign); architecture-specific versions may well vary in
what results they give for higher bits of that result (and indeed bug
17569 gives an example correct result from __builtin_remquo giving 9
for that result, where the particular glibc implementation used in
that bug report would give 1 after this fix).  Thus, this patch adapts
the tests of remquo to test that result only mod 8, to allow for such
variation when tests with higher quotient are included.

Tested for x86_64 and x86.

	[BZ #17569]
	* sysdeps/ieee754/dbl-64/wordsize-64/s_remquo.c (__remquo):
	Compute absolute value of x as modified by fmod, not original
	value of x.
	* math/libm-test.inc (RUN_TEST_ffI_f1): Rename to
	RUN_TEST_ffI_f1_mod8.  Check extra return value mod 8.
	(RUN_TEST_LOOP_ffI_f1): Rename to RUN_TEST_LOOP_ffI_f1_mod8.  Call
	RUN_TEST_ffI_f1_mod8.
	(remquo_test_data): Add more tests.
2015-02-13 21:54:44 +00:00
..
e_acosh.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
e_cosh.c Fix wordsize-64 cosh regression (bug 14273). 2012-06-21 19:26:09 +00:00
e_fmod.c Add #include <stdint.h> for uint[32|64]_t usage (except installed headers). 2013-05-16 11:32:54 -05:00
e_log2.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
e_log10.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
math_private.h Add #include <stdint.h> for uint[32|64]_t usage (except installed headers). 2013-05-16 11:32:54 -05:00
s_ceil.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_finite.c Add #include <stdint.h> for uint[32|64]_t usage (except installed headers). 2013-05-16 11:32:54 -05:00
s_floor.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
s_frexp.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
s_isinf_ns.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_isinf.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_isnan.c Add #include <stdint.h> for uint[32|64]_t usage (except installed headers). 2013-05-16 11:32:54 -05:00
s_issignaling.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
s_llround.c lround: provide cast for wordsize-64 version if needed 2015-01-05 11:59:32 -05:00
s_logb.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
s_lround.c Make lround the alias of llround for wordsize-64 2012-03-16 15:20:45 -07:00
s_modf.c Add #include <stdint.h> for uint[32|64]_t usage (except installed headers). 2013-05-16 11:32:54 -05:00
s_nearbyint.c Clean up dbl-64 rint, nearbyint. 2012-03-13 14:12:44 +00:00
s_remquo.c Fix dbl-64/wordsize-64 remquo (bug 17569). 2015-02-13 21:54:44 +00:00
s_rint.c Clean up dbl-64 rint, nearbyint. 2012-03-13 14:12:44 +00:00
s_round.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
s_scalbln.c [BZ #6803] Set errno for scalbln, scalbn 2014-06-20 07:48:20 +05:30
s_scalbn.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_trunc.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00