Fix i386 asinhl (sNaN) (bug 20218).

The i386 version of asinhl returns sNaN (without raising any
exceptions) for sNaN input.  This patch fixes it to add non-finite
arguments to themselves, so that "invalid" is raised and qNaN
returned.

Tested for x86_64 and x86.

	[BZ #20218]
	* sysdeps/i386/fpu/s_asinhl.S (__asinhl): Add non-finite argument
	to itself.
	* math/libm-test.inc (asinh_test_data): Add sNaN tests.
This commit is contained in:
Joseph Myers 2016-06-07 22:54:58 +00:00
parent 91655fc307
commit c23805a95d
3 changed files with 10 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2016-06-07 Joseph Myers <joseph@codesourcery.com>
[BZ #20218]
* sysdeps/i386/fpu/s_asinhl.S (__asinhl): Add non-finite argument
to itself.
* math/libm-test.inc (asinh_test_data): Add sNaN tests.
2016-06-07 H.J. Lu <hongjiu.lu@intel.com>
[BZ #20195]

View File

@ -1878,6 +1878,8 @@ static const struct test_f_f_data asinh_test_data[] =
TEST_f_f (asinh, minus_infty, minus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE),
TEST_f_f (asinh, qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
TEST_f_f (asinh, -qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
TEST_f_f (asinh, snan_value, qnan_value, INVALID_EXCEPTION),
TEST_f_f (asinh, -snan_value, qnan_value, INVALID_EXCEPTION),
AUTO_TESTS_f_f (asinh),
};

View File

@ -88,6 +88,7 @@ ENTRY(__asinhl)
4: ret
7: fldt 4(%esp)
fadd %st
ret
6: faddl MO(one)