From 7540cfc5a8c39eca9ba7b631dd30b35f6530f54d Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Sun, 21 Jun 2015 17:48:04 +0000 Subject: Fix x86 / x86_64 expl, exp10l missing underflows (bug 16361). Similar to various other bugs in this area, the x86 and x86_64 implementations of expl / exp10l can fail to produce underflow exceptions when the unscaled result has trailing 0 bits so the scaling down to subnormal precision is exact. This patch fixes this by forcing the exception in the case of tiny results. Tested for x86_64 and x86. [BZ #16361] * sysdeps/i386/fpu/e_expl.S [!USE_AS_EXPM1L] (cmin): New object. [!USE_AS_EXPM1L] (IEEE754_EXPL): Force underflow exception for tiny results. * sysdeps/x86_64/fpu/e_expl.S [!USE_AS_EXPM1L] (cmin): New object. [!USE_AS_EXPM1L] (IEEE754_EXPL): Force underflow exception for tiny results. * math/auto-libm-test-in: Add more tests of exp and exp10. Do not mark underflow exceptions as possibly missing for bug 16361. * math/auto-libm-test-out: Regenerated. --- math/auto-libm-test-in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'math/auto-libm-test-in') diff --git a/math/auto-libm-test-in b/math/auto-libm-test-in index 6ec4bc69af..e8e4da62b8 100644 --- a/math/auto-libm-test-in +++ b/math/auto-libm-test-in @@ -1191,6 +1191,7 @@ exp -7.4444006192138124e+02 exp -0x1.75f113c30b1c8p+9 exp -max exp -11342.8125 +exp -0x2.c5b2319c4843acc0p12 exp 0x1p-10 exp -0x1p-10 exp 0x1p-20 @@ -1223,8 +1224,8 @@ exp10 305 exp10 -305 # GCC bug 59666: results on directed rounding may be incorrect. exp10 4932 xfail-rounding:ldbl-128ibm -# Bug 16361: underflow exception may be misssing -exp10 -4932 missing-underflow:ldbl-96-intel:x86 missing-underflow:ldbl-96-intel:x86_64 +exp10 -4932 +exp10 -0x1.343793004f503232p12 # GCC bug 59666: results on directed rounding may be incorrect. exp10 1e5 xfail-rounding:ldbl-128ibm exp10 -1e5 -- cgit 1.4.1