about summary refs log tree commit diff
path: root/math/auto-libm-test-in
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2015-06-29 16:52:16 +0000
committerJoseph Myers <joseph@codesourcery.com>2015-06-29 16:52:16 +0000
commit63dbe5f32238858c7b953b867ed0588c7808dd4f (patch)
tree05aff3104a86894353a10f5ddc0c32deef550977 /math/auto-libm-test-in
parent31545c23277cd54a1edd41c85d8255fb589158e3 (diff)
downloadglibc-63dbe5f32238858c7b953b867ed0588c7808dd4f.tar.gz
glibc-63dbe5f32238858c7b953b867ed0588c7808dd4f.tar.xz
glibc-63dbe5f32238858c7b953b867ed0588c7808dd4f.zip
Fix j1, jn missing underflows (bug 16559).
Similar to various other bugs in this area, j1 and jn implementations
can fail to raise the underflow exception when the internal
computation is exact although the actual function is inexact.  This
patch forces the exception in a similar way to other such fixes.  (The
ldbl-128 / ldbl-128ibm j1l implementation is different and doesn't
need a change for this until spurious underflows in it are fixed.)

Tested for x86_64, x86, mips64 and powerpc.

	[BZ #16559]
	* sysdeps/ieee754/dbl-64/e_j1.c: Include <float.h>.
	(__ieee754_j1): Force underflow exception for small results.
	* sysdeps/ieee754/dbl-64/e_jn.c (__ieee754_jn): Likewise.
	* sysdeps/ieee754/flt-32/e_j1f.c: Include <float.h>.
	(__ieee754_j1f): Force underflow exception for small results.
	* sysdeps/ieee754/flt-32/e_jnf.c (__ieee754_jnf): Likewise.
	* sysdeps/ieee754/ldbl-128/e_jnl.c (__ieee754_jnl): Likewise.
	* sysdeps/ieee754/ldbl-128ibm/e_jnl.c (__ieee754_jnl): Likewise.
	* sysdeps/ieee754/ldbl-96/e_j1l.c: Include <float.h>.
	(__ieee754_j1l): Force underflow exception for small results.
	* sysdeps/ieee754/ldbl-96/e_jnl.c (__ieee754_jnl): Likewise.
	* math/auto-libm-test-in: Add more tests of j1 and jn.
	* math/auto-libm-test-out: Regenerated.
Diffstat (limited to 'math/auto-libm-test-in')
-rw-r--r--math/auto-libm-test-in16
1 files changed, 16 insertions, 0 deletions
diff --git a/math/auto-libm-test-in b/math/auto-libm-test-in
index 75cf545a86..34b02c91f7 100644
--- a/math/auto-libm-test-in
+++ b/math/auto-libm-test-in
@@ -1812,6 +1812,11 @@ j1 0x1.ff00000000002p+840
 j1 0x1p1023
 j1 0x1p16382
 j1 0x1p16383
+# Bug 18611: errno setting may be missing.
+j1 min missing-errno
+j1 -min missing-errno
+j1 min_subnorm missing-errno
+j1 -min_subnorm missing-errno
 
 # jn (0, x) == j0 (x).
 jn 0 -1.0
@@ -1836,6 +1841,11 @@ jn 1 1.5
 jn 1 2.0
 jn 1 8.0
 jn 1 10.0
+# Bug 18611: errno setting may be missing.
+jn 1 min missing-errno
+jn 1 -min missing-errno
+jn 1 min_subnorm missing-errno
+jn 1 -min_subnorm missing-errno
 
 jn 3 -1.0
 jn 3 0.0
@@ -1867,6 +1877,12 @@ jn 2 0x1p127
 jn 2 0x1p1023
 jn 2 0x1p16383
 
+# Bug 18611: errno setting may be missing.
+jn 10 min missing-errno
+jn 10 -min missing-errno
+jn 10 min_subnorm missing-errno
+jn 10 -min_subnorm missing-errno
+
 lgamma max
 lgamma 1
 lgamma 3