Fix i386 atanhl (sNaN) (bug 20219).

The i386 version of atanhl returns sNaN for sNaN input.  This patch
fixes it to add NaN arguments to themselves so it returns qNaN in this
case.

Tested for x86_64 and x86.

	[BZ #20219]
	* sysdeps/i386/fpu/e_atanhl.S (__ieee754_atanhl): Add NaN argument
	to itself.
	* math/libm-test.inc (atanh_test_data): Add sNaN tests.
This commit is contained in:
Joseph Myers 2016-06-07 23:08:32 +00:00
parent c23805a95d
commit 8fa8a330f9
3 changed files with 8 additions and 0 deletions

View File

@ -1,5 +1,10 @@
2016-06-07 Joseph Myers <joseph@codesourcery.com> 2016-06-07 Joseph Myers <joseph@codesourcery.com>
[BZ #20219]
* sysdeps/i386/fpu/e_atanhl.S (__ieee754_atanhl): Add NaN argument
to itself.
* math/libm-test.inc (atanh_test_data): Add sNaN tests.
[BZ #20218] [BZ #20218]
* sysdeps/i386/fpu/s_asinhl.S (__asinhl): Add non-finite argument * sysdeps/i386/fpu/s_asinhl.S (__asinhl): Add non-finite argument
to itself. to itself.

View File

@ -1915,6 +1915,8 @@ static const struct test_f_f_data atanh_test_data[] =
TEST_f_f (atanh, -1, minus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE), TEST_f_f (atanh, -1, minus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE),
TEST_f_f (atanh, qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_f_f (atanh, qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
TEST_f_f (atanh, -qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_f_f (atanh, -qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
TEST_f_f (atanh, snan_value, qnan_value, INVALID_EXCEPTION),
TEST_f_f (atanh, -snan_value, qnan_value, INVALID_EXCEPTION),
/* atanh (x) == qNaN plus invalid exception if |x| > 1. */ /* atanh (x) == qNaN plus invalid exception if |x| > 1. */
TEST_f_f (atanh, 1.125L, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM), TEST_f_f (atanh, 1.125L, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM),

View File

@ -121,6 +121,7 @@ ENTRY(__ieee754_atanhl)
cmpl $0, 4(%esp) cmpl $0, 4(%esp)
je 7b je 7b
6: fldt 4(%esp) 6: fldt 4(%esp)
fadd %st(0)
ret ret
END(__ieee754_atanhl) END(__ieee754_atanhl)
strong_alias (__ieee754_atanhl, __atanhl_finite) strong_alias (__ieee754_atanhl, __atanhl_finite)