about summary refs log tree commit diff
path: root/math
diff options
context:
space:
mode:
Diffstat (limited to 'math')
-rw-r--r--math/auto-libm-test-in12
-rw-r--r--math/auto-libm-test-out170
-rw-r--r--math/w_exp2.c2
-rw-r--r--math/w_exp2f.c2
-rw-r--r--math/w_exp2l.c2
5 files changed, 92 insertions, 96 deletions
diff --git a/math/auto-libm-test-in b/math/auto-libm-test-in
index 126a9eaec7..83832a7f35 100644
--- a/math/auto-libm-test-in
+++ b/math/auto-libm-test-in
@@ -203,22 +203,18 @@ exp2 -0
 exp2 10
 exp2 -1
 exp2 1e6
-# Bug 16283: errno may not be set on underflow.
-exp2 -1e6 missing-errno
+exp2 -1e6
 exp2 max
-# Bug 16283: errno may not be set on underflow.
-exp2 -max missing-errno
+exp2 -max
 exp2 0.75
 exp2 100.5
 exp2 127
 exp2 -149
 exp2 1000.25
 exp2 1023
-# Bug 16283: errno may not be set on underflow.
-exp2 -1074 missing-errno
+exp2 -1074
 exp2 16383
-# Bug 16283: errno may not be set on underflow.
-exp2 -16400 missing-errno
+exp2 -16400
 
 expm1 0
 expm1 -0
diff --git a/math/auto-libm-test-out b/math/auto-libm-test-out
index 9b3c398893..4241399a9a 100644
--- a/math/auto-libm-test-out
+++ b/math/auto-libm-test-out
@@ -6725,30 +6725,30 @@ exp2 1e6
 = exp2 tonearest ldbl-128ibm 0xf.424p+16L : plus_infty : inexact-ok overflow errno-erange
 = exp2 towardzero ldbl-128ibm 0xf.424p+16L : 0xf.ffffffffffffbffffffffffffcp+1020L : inexact-ok overflow errno-erange-ok
 = exp2 upward ldbl-128ibm 0xf.424p+16L : plus_infty : inexact-ok overflow errno-erange
-exp2 -1e6 missing-errno
-= exp2 downward flt-32 -0xf.424p+16f : 0x0p+0f : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 tonearest flt-32 -0xf.424p+16f : 0x0p+0f : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 towardzero flt-32 -0xf.424p+16f : 0x0p+0f : inexact-ok underflow errno-erange errno-erange-ok
+exp2 -1e6
+= exp2 downward flt-32 -0xf.424p+16f : 0x0p+0f : inexact-ok underflow errno-erange
+= exp2 tonearest flt-32 -0xf.424p+16f : 0x0p+0f : inexact-ok underflow errno-erange
+= exp2 towardzero flt-32 -0xf.424p+16f : 0x0p+0f : inexact-ok underflow errno-erange
 = exp2 upward flt-32 -0xf.424p+16f : 0x8p-152f : inexact-ok underflow errno-erange-ok
-= exp2 downward dbl-64 -0xf.424p+16 : 0x0p+0 : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 tonearest dbl-64 -0xf.424p+16 : 0x0p+0 : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 towardzero dbl-64 -0xf.424p+16 : 0x0p+0 : inexact-ok underflow errno-erange errno-erange-ok
+= exp2 downward dbl-64 -0xf.424p+16 : 0x0p+0 : inexact-ok underflow errno-erange
+= exp2 tonearest dbl-64 -0xf.424p+16 : 0x0p+0 : inexact-ok underflow errno-erange
+= exp2 towardzero dbl-64 -0xf.424p+16 : 0x0p+0 : inexact-ok underflow errno-erange
 = exp2 upward dbl-64 -0xf.424p+16 : 0x4p-1076 : inexact-ok underflow errno-erange-ok
-= exp2 downward ldbl-96-intel -0xf.424p+16L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 tonearest ldbl-96-intel -0xf.424p+16L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 towardzero ldbl-96-intel -0xf.424p+16L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
+= exp2 downward ldbl-96-intel -0xf.424p+16L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 tonearest ldbl-96-intel -0xf.424p+16L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 towardzero ldbl-96-intel -0xf.424p+16L : 0x0p+0L : inexact-ok underflow errno-erange
 = exp2 upward ldbl-96-intel -0xf.424p+16L : 0x8p-16448L : inexact-ok underflow errno-erange-ok
-= exp2 downward ldbl-96-m68k -0xf.424p+16L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 tonearest ldbl-96-m68k -0xf.424p+16L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 towardzero ldbl-96-m68k -0xf.424p+16L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
+= exp2 downward ldbl-96-m68k -0xf.424p+16L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 tonearest ldbl-96-m68k -0xf.424p+16L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 towardzero ldbl-96-m68k -0xf.424p+16L : 0x0p+0L : inexact-ok underflow errno-erange
 = exp2 upward ldbl-96-m68k -0xf.424p+16L : 0x4p-16448L : inexact-ok underflow errno-erange-ok
-= exp2 downward ldbl-128 -0xf.424p+16L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 tonearest ldbl-128 -0xf.424p+16L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 towardzero ldbl-128 -0xf.424p+16L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
+= exp2 downward ldbl-128 -0xf.424p+16L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 tonearest ldbl-128 -0xf.424p+16L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 towardzero ldbl-128 -0xf.424p+16L : 0x0p+0L : inexact-ok underflow errno-erange
 = exp2 upward ldbl-128 -0xf.424p+16L : 0x4p-16496L : inexact-ok underflow errno-erange-ok
-= exp2 downward ldbl-128ibm -0xf.424p+16L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 tonearest ldbl-128ibm -0xf.424p+16L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 towardzero ldbl-128ibm -0xf.424p+16L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
+= exp2 downward ldbl-128ibm -0xf.424p+16L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 tonearest ldbl-128ibm -0xf.424p+16L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 towardzero ldbl-128ibm -0xf.424p+16L : 0x0p+0L : inexact-ok underflow errno-erange
 = exp2 upward ldbl-128ibm -0xf.424p+16L : 0x4p-1076L : inexact-ok underflow errno-erange-ok
 exp2 max
 = exp2 downward flt-32 0xf.fffffp+124f : 0xf.fffffp+124f : inexact-ok overflow errno-erange-ok
@@ -6819,74 +6819,74 @@ exp2 max
 = exp2 tonearest ldbl-128ibm 0xf.ffffffffffffbffffffffffffcp+1020L : plus_infty : inexact-ok overflow errno-erange
 = exp2 towardzero ldbl-128ibm 0xf.ffffffffffffbffffffffffffcp+1020L : 0xf.ffffffffffffbffffffffffffcp+1020L : inexact-ok overflow errno-erange-ok
 = exp2 upward ldbl-128ibm 0xf.ffffffffffffbffffffffffffcp+1020L : plus_infty : inexact-ok overflow errno-erange
-exp2 -max missing-errno
-= exp2 downward flt-32 -0xf.fffffp+124f : 0x0p+0f : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 tonearest flt-32 -0xf.fffffp+124f : 0x0p+0f : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 towardzero flt-32 -0xf.fffffp+124f : 0x0p+0f : inexact-ok underflow errno-erange errno-erange-ok
+exp2 -max
+= exp2 downward flt-32 -0xf.fffffp+124f : 0x0p+0f : inexact-ok underflow errno-erange
+= exp2 tonearest flt-32 -0xf.fffffp+124f : 0x0p+0f : inexact-ok underflow errno-erange
+= exp2 towardzero flt-32 -0xf.fffffp+124f : 0x0p+0f : inexact-ok underflow errno-erange
 = exp2 upward flt-32 -0xf.fffffp+124f : 0x8p-152f : inexact-ok underflow errno-erange-ok
-= exp2 downward dbl-64 -0xf.fffffp+124 : 0x0p+0 : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 tonearest dbl-64 -0xf.fffffp+124 : 0x0p+0 : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 towardzero dbl-64 -0xf.fffffp+124 : 0x0p+0 : inexact-ok underflow errno-erange errno-erange-ok
+= exp2 downward dbl-64 -0xf.fffffp+124 : 0x0p+0 : inexact-ok underflow errno-erange
+= exp2 tonearest dbl-64 -0xf.fffffp+124 : 0x0p+0 : inexact-ok underflow errno-erange
+= exp2 towardzero dbl-64 -0xf.fffffp+124 : 0x0p+0 : inexact-ok underflow errno-erange
 = exp2 upward dbl-64 -0xf.fffffp+124 : 0x4p-1076 : inexact-ok underflow errno-erange-ok
-= exp2 downward ldbl-96-intel -0xf.fffffp+124L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 tonearest ldbl-96-intel -0xf.fffffp+124L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 towardzero ldbl-96-intel -0xf.fffffp+124L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
+= exp2 downward ldbl-96-intel -0xf.fffffp+124L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 tonearest ldbl-96-intel -0xf.fffffp+124L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 towardzero ldbl-96-intel -0xf.fffffp+124L : 0x0p+0L : inexact-ok underflow errno-erange
 = exp2 upward ldbl-96-intel -0xf.fffffp+124L : 0x8p-16448L : inexact-ok underflow errno-erange-ok
-= exp2 downward ldbl-96-m68k -0xf.fffffp+124L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 tonearest ldbl-96-m68k -0xf.fffffp+124L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 towardzero ldbl-96-m68k -0xf.fffffp+124L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
+= exp2 downward ldbl-96-m68k -0xf.fffffp+124L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 tonearest ldbl-96-m68k -0xf.fffffp+124L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 towardzero ldbl-96-m68k -0xf.fffffp+124L : 0x0p+0L : inexact-ok underflow errno-erange
 = exp2 upward ldbl-96-m68k -0xf.fffffp+124L : 0x4p-16448L : inexact-ok underflow errno-erange-ok
-= exp2 downward ldbl-128 -0xf.fffffp+124L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 tonearest ldbl-128 -0xf.fffffp+124L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 towardzero ldbl-128 -0xf.fffffp+124L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
+= exp2 downward ldbl-128 -0xf.fffffp+124L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 tonearest ldbl-128 -0xf.fffffp+124L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 towardzero ldbl-128 -0xf.fffffp+124L : 0x0p+0L : inexact-ok underflow errno-erange
 = exp2 upward ldbl-128 -0xf.fffffp+124L : 0x4p-16496L : inexact-ok underflow errno-erange-ok
-= exp2 downward ldbl-128ibm -0xf.fffffp+124L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 tonearest ldbl-128ibm -0xf.fffffp+124L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 towardzero ldbl-128ibm -0xf.fffffp+124L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
+= exp2 downward ldbl-128ibm -0xf.fffffp+124L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 tonearest ldbl-128ibm -0xf.fffffp+124L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 towardzero ldbl-128ibm -0xf.fffffp+124L : 0x0p+0L : inexact-ok underflow errno-erange
 = exp2 upward ldbl-128ibm -0xf.fffffp+124L : 0x4p-1076L : inexact-ok underflow errno-erange-ok
-= exp2 downward dbl-64 -0xf.ffffffffffff8p+1020 : 0x0p+0 : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 tonearest dbl-64 -0xf.ffffffffffff8p+1020 : 0x0p+0 : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 towardzero dbl-64 -0xf.ffffffffffff8p+1020 : 0x0p+0 : inexact-ok underflow errno-erange errno-erange-ok
+= exp2 downward dbl-64 -0xf.ffffffffffff8p+1020 : 0x0p+0 : inexact-ok underflow errno-erange
+= exp2 tonearest dbl-64 -0xf.ffffffffffff8p+1020 : 0x0p+0 : inexact-ok underflow errno-erange
+= exp2 towardzero dbl-64 -0xf.ffffffffffff8p+1020 : 0x0p+0 : inexact-ok underflow errno-erange
 = exp2 upward dbl-64 -0xf.ffffffffffff8p+1020 : 0x4p-1076 : inexact-ok underflow errno-erange-ok
-= exp2 downward ldbl-96-intel -0xf.ffffffffffff8p+1020L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 tonearest ldbl-96-intel -0xf.ffffffffffff8p+1020L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 towardzero ldbl-96-intel -0xf.ffffffffffff8p+1020L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
+= exp2 downward ldbl-96-intel -0xf.ffffffffffff8p+1020L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 tonearest ldbl-96-intel -0xf.ffffffffffff8p+1020L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 towardzero ldbl-96-intel -0xf.ffffffffffff8p+1020L : 0x0p+0L : inexact-ok underflow errno-erange
 = exp2 upward ldbl-96-intel -0xf.ffffffffffff8p+1020L : 0x8p-16448L : inexact-ok underflow errno-erange-ok
-= exp2 downward ldbl-96-m68k -0xf.ffffffffffff8p+1020L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 tonearest ldbl-96-m68k -0xf.ffffffffffff8p+1020L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 towardzero ldbl-96-m68k -0xf.ffffffffffff8p+1020L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
+= exp2 downward ldbl-96-m68k -0xf.ffffffffffff8p+1020L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 tonearest ldbl-96-m68k -0xf.ffffffffffff8p+1020L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 towardzero ldbl-96-m68k -0xf.ffffffffffff8p+1020L : 0x0p+0L : inexact-ok underflow errno-erange
 = exp2 upward ldbl-96-m68k -0xf.ffffffffffff8p+1020L : 0x4p-16448L : inexact-ok underflow errno-erange-ok
-= exp2 downward ldbl-128 -0xf.ffffffffffff8p+1020L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 tonearest ldbl-128 -0xf.ffffffffffff8p+1020L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 towardzero ldbl-128 -0xf.ffffffffffff8p+1020L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
+= exp2 downward ldbl-128 -0xf.ffffffffffff8p+1020L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 tonearest ldbl-128 -0xf.ffffffffffff8p+1020L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 towardzero ldbl-128 -0xf.ffffffffffff8p+1020L : 0x0p+0L : inexact-ok underflow errno-erange
 = exp2 upward ldbl-128 -0xf.ffffffffffff8p+1020L : 0x4p-16496L : inexact-ok underflow errno-erange-ok
-= exp2 downward ldbl-128ibm -0xf.ffffffffffff8p+1020L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 tonearest ldbl-128ibm -0xf.ffffffffffff8p+1020L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 towardzero ldbl-128ibm -0xf.ffffffffffff8p+1020L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
+= exp2 downward ldbl-128ibm -0xf.ffffffffffff8p+1020L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 tonearest ldbl-128ibm -0xf.ffffffffffff8p+1020L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 towardzero ldbl-128ibm -0xf.ffffffffffff8p+1020L : 0x0p+0L : inexact-ok underflow errno-erange
 = exp2 upward ldbl-128ibm -0xf.ffffffffffff8p+1020L : 0x4p-1076L : inexact-ok underflow errno-erange-ok
-= exp2 downward ldbl-96-intel -0xf.fffffffffffffffp+16380L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 tonearest ldbl-96-intel -0xf.fffffffffffffffp+16380L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 towardzero ldbl-96-intel -0xf.fffffffffffffffp+16380L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
+= exp2 downward ldbl-96-intel -0xf.fffffffffffffffp+16380L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 tonearest ldbl-96-intel -0xf.fffffffffffffffp+16380L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 towardzero ldbl-96-intel -0xf.fffffffffffffffp+16380L : 0x0p+0L : inexact-ok underflow errno-erange
 = exp2 upward ldbl-96-intel -0xf.fffffffffffffffp+16380L : 0x8p-16448L : inexact-ok underflow errno-erange-ok
-= exp2 downward ldbl-96-m68k -0xf.fffffffffffffffp+16380L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 tonearest ldbl-96-m68k -0xf.fffffffffffffffp+16380L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 towardzero ldbl-96-m68k -0xf.fffffffffffffffp+16380L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
+= exp2 downward ldbl-96-m68k -0xf.fffffffffffffffp+16380L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 tonearest ldbl-96-m68k -0xf.fffffffffffffffp+16380L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 towardzero ldbl-96-m68k -0xf.fffffffffffffffp+16380L : 0x0p+0L : inexact-ok underflow errno-erange
 = exp2 upward ldbl-96-m68k -0xf.fffffffffffffffp+16380L : 0x4p-16448L : inexact-ok underflow errno-erange-ok
-= exp2 downward ldbl-128 -0xf.fffffffffffffffp+16380L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 tonearest ldbl-128 -0xf.fffffffffffffffp+16380L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 towardzero ldbl-128 -0xf.fffffffffffffffp+16380L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
+= exp2 downward ldbl-128 -0xf.fffffffffffffffp+16380L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 tonearest ldbl-128 -0xf.fffffffffffffffp+16380L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 towardzero ldbl-128 -0xf.fffffffffffffffp+16380L : 0x0p+0L : inexact-ok underflow errno-erange
 = exp2 upward ldbl-128 -0xf.fffffffffffffffp+16380L : 0x4p-16496L : inexact-ok underflow errno-erange-ok
-= exp2 downward ldbl-128 -0xf.fffffffffffffffffffffffffff8p+16380L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 tonearest ldbl-128 -0xf.fffffffffffffffffffffffffff8p+16380L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 towardzero ldbl-128 -0xf.fffffffffffffffffffffffffff8p+16380L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
+= exp2 downward ldbl-128 -0xf.fffffffffffffffffffffffffff8p+16380L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 tonearest ldbl-128 -0xf.fffffffffffffffffffffffffff8p+16380L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 towardzero ldbl-128 -0xf.fffffffffffffffffffffffffff8p+16380L : 0x0p+0L : inexact-ok underflow errno-erange
 = exp2 upward ldbl-128 -0xf.fffffffffffffffffffffffffff8p+16380L : 0x4p-16496L : inexact-ok underflow errno-erange-ok
-= exp2 downward ldbl-128 -0xf.ffffffffffffbffffffffffffcp+1020L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 tonearest ldbl-128 -0xf.ffffffffffffbffffffffffffcp+1020L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 towardzero ldbl-128 -0xf.ffffffffffffbffffffffffffcp+1020L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
+= exp2 downward ldbl-128 -0xf.ffffffffffffbffffffffffffcp+1020L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 tonearest ldbl-128 -0xf.ffffffffffffbffffffffffffcp+1020L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 towardzero ldbl-128 -0xf.ffffffffffffbffffffffffffcp+1020L : 0x0p+0L : inexact-ok underflow errno-erange
 = exp2 upward ldbl-128 -0xf.ffffffffffffbffffffffffffcp+1020L : 0x4p-16496L : inexact-ok underflow errno-erange-ok
-= exp2 downward ldbl-128ibm -0xf.ffffffffffffbffffffffffffcp+1020L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 tonearest ldbl-128ibm -0xf.ffffffffffffbffffffffffffcp+1020L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 towardzero ldbl-128ibm -0xf.ffffffffffffbffffffffffffcp+1020L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
+= exp2 downward ldbl-128ibm -0xf.ffffffffffffbffffffffffffcp+1020L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 tonearest ldbl-128ibm -0xf.ffffffffffffbffffffffffffcp+1020L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 towardzero ldbl-128ibm -0xf.ffffffffffffbffffffffffffcp+1020L : 0x0p+0L : inexact-ok underflow errno-erange
 = exp2 upward ldbl-128ibm -0xf.ffffffffffffbffffffffffffcp+1020L : 0x4p-1076L : inexact-ok underflow errno-erange-ok
 exp2 0.75
 = exp2 downward flt-32 0xcp-4f : 0x1.ae89f8p+0f : inexact-ok
@@ -7038,10 +7038,10 @@ exp2 1023
 = exp2 tonearest ldbl-128ibm 0x3.ffp+8L : 0x8p+1020L : inexact-ok
 = exp2 towardzero ldbl-128ibm 0x3.ffp+8L : 0x8p+1020L : inexact-ok
 = exp2 upward ldbl-128ibm 0x3.ffp+8L : 0x8p+1020L : inexact-ok
-exp2 -1074 missing-errno
-= exp2 downward flt-32 -0x4.32p+8f : 0x0p+0f : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 tonearest flt-32 -0x4.32p+8f : 0x0p+0f : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 towardzero flt-32 -0x4.32p+8f : 0x0p+0f : inexact-ok underflow errno-erange errno-erange-ok
+exp2 -1074
+= exp2 downward flt-32 -0x4.32p+8f : 0x0p+0f : inexact-ok underflow errno-erange
+= exp2 tonearest flt-32 -0x4.32p+8f : 0x0p+0f : inexact-ok underflow errno-erange
+= exp2 towardzero flt-32 -0x4.32p+8f : 0x0p+0f : inexact-ok underflow errno-erange
 = exp2 upward flt-32 -0x4.32p+8f : 0x8p-152f : inexact-ok underflow errno-erange-ok
 = exp2 downward dbl-64 -0x4.32p+8 : 0x4p-1076 : inexact-ok underflow-ok errno-erange-ok
 = exp2 tonearest dbl-64 -0x4.32p+8 : 0x4p-1076 : inexact-ok underflow-ok errno-erange-ok
@@ -7088,14 +7088,14 @@ exp2 16383
 = exp2 tonearest ldbl-128ibm 0x3.fffp+12L : plus_infty : inexact-ok overflow errno-erange
 = exp2 towardzero ldbl-128ibm 0x3.fffp+12L : 0xf.ffffffffffffbffffffffffffcp+1020L : inexact-ok overflow errno-erange-ok
 = exp2 upward ldbl-128ibm 0x3.fffp+12L : plus_infty : inexact-ok overflow errno-erange
-exp2 -16400 missing-errno
-= exp2 downward flt-32 -0x4.01p+12f : 0x0p+0f : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 tonearest flt-32 -0x4.01p+12f : 0x0p+0f : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 towardzero flt-32 -0x4.01p+12f : 0x0p+0f : inexact-ok underflow errno-erange errno-erange-ok
+exp2 -16400
+= exp2 downward flt-32 -0x4.01p+12f : 0x0p+0f : inexact-ok underflow errno-erange
+= exp2 tonearest flt-32 -0x4.01p+12f : 0x0p+0f : inexact-ok underflow errno-erange
+= exp2 towardzero flt-32 -0x4.01p+12f : 0x0p+0f : inexact-ok underflow errno-erange
 = exp2 upward flt-32 -0x4.01p+12f : 0x8p-152f : inexact-ok underflow errno-erange-ok
-= exp2 downward dbl-64 -0x4.01p+12 : 0x0p+0 : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 tonearest dbl-64 -0x4.01p+12 : 0x0p+0 : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 towardzero dbl-64 -0x4.01p+12 : 0x0p+0 : inexact-ok underflow errno-erange errno-erange-ok
+= exp2 downward dbl-64 -0x4.01p+12 : 0x0p+0 : inexact-ok underflow errno-erange
+= exp2 tonearest dbl-64 -0x4.01p+12 : 0x0p+0 : inexact-ok underflow errno-erange
+= exp2 towardzero dbl-64 -0x4.01p+12 : 0x0p+0 : inexact-ok underflow errno-erange
 = exp2 upward dbl-64 -0x4.01p+12 : 0x4p-1076 : inexact-ok underflow errno-erange-ok
 = exp2 downward ldbl-96-intel -0x4.01p+12L : 0x1p-16400L : inexact-ok underflow-ok errno-erange-ok
 = exp2 tonearest ldbl-96-intel -0x4.01p+12L : 0x1p-16400L : inexact-ok underflow-ok errno-erange-ok
@@ -7109,9 +7109,9 @@ exp2 -16400 missing-errno
 = exp2 tonearest ldbl-128 -0x4.01p+12L : 0x1p-16400L : inexact-ok underflow-ok errno-erange-ok
 = exp2 towardzero ldbl-128 -0x4.01p+12L : 0x1p-16400L : inexact-ok underflow-ok errno-erange-ok
 = exp2 upward ldbl-128 -0x4.01p+12L : 0x1p-16400L : inexact-ok underflow-ok errno-erange-ok
-= exp2 downward ldbl-128ibm -0x4.01p+12L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 tonearest ldbl-128ibm -0x4.01p+12L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
-= exp2 towardzero ldbl-128ibm -0x4.01p+12L : 0x0p+0L : inexact-ok underflow errno-erange errno-erange-ok
+= exp2 downward ldbl-128ibm -0x4.01p+12L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 tonearest ldbl-128ibm -0x4.01p+12L : 0x0p+0L : inexact-ok underflow errno-erange
+= exp2 towardzero ldbl-128ibm -0x4.01p+12L : 0x0p+0L : inexact-ok underflow errno-erange
 = exp2 upward ldbl-128ibm -0x4.01p+12L : 0x4p-1076L : inexact-ok underflow errno-erange-ok
 expm1 0
 = expm1 downward flt-32 0x0p+0f : 0x0p+0f : inexact-ok
diff --git a/math/w_exp2.c b/math/w_exp2.c
index b5d8e25702..02820be373 100644
--- a/math/w_exp2.c
+++ b/math/w_exp2.c
@@ -9,7 +9,7 @@ double
 __exp2 (double x)
 {
   double z = __ieee754_exp2 (x);
-  if (__builtin_expect (!__finite (z), 0)
+  if (__builtin_expect (!__finite (z) || z == 0, 0)
       && __finite (x) && _LIB_VERSION != _IEEE_)
     /* exp2 overflow: 44, exp2 underflow: 45 */
     return __kernel_standard (x, x, 44 + !!__signbit (x));
diff --git a/math/w_exp2f.c b/math/w_exp2f.c
index 7c277ef390..8430fd5702 100644
--- a/math/w_exp2f.c
+++ b/math/w_exp2f.c
@@ -9,7 +9,7 @@ float
 __exp2f (float x)
 {
   float z = __ieee754_exp2f (x);
-  if (__builtin_expect (!__finitef (z), 0)
+  if (__builtin_expect (!__finitef (z) || z == 0, 0)
       && __finitef (x) && _LIB_VERSION != _IEEE_)
     /* exp2 overflow: 144, exp2 underflow: 145 */
     return __kernel_standard_f (x, x, 144 + !!__signbitf (x));
diff --git a/math/w_exp2l.c b/math/w_exp2l.c
index 7f06805a0d..33861d584a 100644
--- a/math/w_exp2l.c
+++ b/math/w_exp2l.c
@@ -9,7 +9,7 @@ long double
 __exp2l (long double x)
 {
   long double z = __ieee754_exp2l (x);
-  if (__builtin_expect (!__finitel (z), 0)
+  if (__builtin_expect (!__finitel (z) || z == 0, 0)
       && __finitel (x) && _LIB_VERSION != _IEEE_)
     /* exp2 overflow: 244, exp2 underflow: 245 */
     return __kernel_standard_l (x, x, 244 + !!__signbitl (x));