From patchwork Fri Sep 18 18:29:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wilco X-Patchwork-Id: 519511 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id AD312140216 for ; Sat, 19 Sep 2015 04:30:15 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=dJdDilPq; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type; q=dns; s=default; b=m5SVO3XkrPvBFrCI4K0Jv94RgNXJ6 vrwzHwVcq+AT6SasQJJcfdTV1dnZ6VvJ5/HZuUegLhZ6yZo1wqU3G5f+lQ2/LHFC ht/CW4+gtuWzA+Cc78mTMJ3P61rm3Vxgsw4M5fuSd8S4b9yY4/hvDKTRjQg/xkVu R3BXU3F+wYDkLs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type; s=default; bh=Wl3Z0e6JQJKGxbYXONmUR5dprV8=; b=dJd DilPqKrgGPfDh0pN3jQJi+/VUAv7pSLxLN9CZdaiX3fazZ1suEyKMTfkrb4r8wZC Lu9hgt5cOvVBWGz5Y/3Wxhh/FNR1Sz3+wWBFUgZ/0AwawNKTXQPYxI6ZmireJFd5 p/8LLCRep+JSjem55Znoq8b2FAD96OpZV3JJ/Bj4= Received: (qmail 107285 invoked by alias); 18 Sep 2015 18:30:08 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 107263 invoked by uid 89); 18 Sep 2015 18:30:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com From: "Wilco Dijkstra" To: "'GNU C Library'" Subject: [PATCH] Remove __isinf_ns, __isnan and __finite inlines Date: Fri, 18 Sep 2015 19:29:52 +0100 Message-ID: <002001d0f240$02db2750$089175f0$@com> MIME-Version: 1.0 X-MC-Unique: tEu8K-ZZTA2ZVpYtqTeX2w-1 Since we now inline isinf, isnan and isfinite in math.h, replace uses of __isinf_ns(l/f) with isinf, and remove the unused inlines __isinf_ns(l/f), __isnan(f) and __finite(f). OK for commit? 2015-09-18 Wilco Dijkstra * include/math.h: Remove __isinf_ns, __isinf_nsf, __isinf_nsl. * math/Makefile: Remove isinf_ns.c. * math/divtc3.c (__divtc3): Replace __isinf_nsl with isinf. * math/multc3.c (__multc3): Likewise. * math/s_casin.c (__casin): Likewise. * math/s_casinf.c (__casinf): Likewise. * math/s_casinl.c (__casinl): Likewise. * math/s_cproj.c (__cproj): Likewise. * math/s_cprojf.c (__cprojf): Likewise. * math/s_cprojl.c (__cprofl): Likewise. * math/s_ctan.c (__ctan): Likewise. * math/s_ctanf.c (__ctanf): Likewise. * math/s_ctanh.c (__ctanh): Likewise. * math/s_ctanhf.c (__ctanhf): Likewise. * math/s_ctanhl.c (__ctanhl): Likewise. * math/s_ctanl.c (__ctanl): Likewise. * math/w_fmod.c (__fmod): Likewise. * math/w_fmodf.c (__fmodf): Likewise. * math/w_fmodl.c (_fmodl): Likewise. * math/w_remainder.c (__remainder): Likewise. * math/w_remainderf.c (__remainderf): Likewise. * math/w_remainderl.c (__remainderl): Likewise. * math/w_scalb.c (__scalb): Likewise. * math/w_scalbf.c (__scalbf): Likewise. * math/w_scalbl.c (__scalbl): Likewise. * sysdeps/ieee754/dbl-64/s_isinf_ns.c: Deleted file. * sysdeps/ieee754/dbl-64/s_sincos.c (__sincos): Replace __isinf_ns with isinf. * sysdeps/ieee754/dbl-64/wordsize-64/math_private.h: Deleted file. * sysdeps/ieee754/dbl-64/wordsize-64/s_isinf_ns.c: Deleted file. * sysdeps/ieee754/flt-32/e_exp2f.c (__ieee754_exp2f): Replace __isinf_nsf with isinf. * sysdeps/ieee754/flt-32/math_private.h: Deleted file. * sysdeps/ieee754/flt-32/s_isinf_nsf.c: Deleted file. * sysdeps/ieee754/ldbl-128/s_isinf_nsl.c: Deleted file. * sysdeps/ieee754/ldbl-128/s_sincosl.c (__sincosl): Replace __isinf_nsl with isinf. * sysdeps/ieee754/ldbl-128ibm/s_isinf_nsl.c: Deleted file. * sysdeps/ieee754/ldbl-128ibm/s_sincosl.c (__sincosl): Replace __isinf_nsl with isinf. * sysdeps/ieee754/ldbl-96/s_isinf_nsl.c: Deleted file. * sysdeps/ieee754/ldbl-96/s_sincosl.c (__sincosl): Replace __isinf_nsl with isinf. --- include/math.h | 4 --- math/Makefile | 2 +- math/divtc3.c | 12 ++++---- math/multc3.c | 16 +++++----- math/s_casin.c | 2 +- math/s_casinf.c | 2 +- math/s_casinl.c | 2 +- math/s_cproj.c | 2 +- math/s_cprojf.c | 2 +- math/s_cprojl.c | 2 +- math/s_ctan.c | 4 +-- math/s_ctanf.c | 4 +-- math/s_ctanh.c | 4 +-- math/s_ctanhf.c | 4 +-- math/s_ctanhl.c | 4 +-- math/s_ctanl.c | 4 +-- math/w_fmod.c | 2 +- math/w_fmodf.c | 2 +- math/w_fmodl.c | 2 +- math/w_remainder.c | 2 +- math/w_remainderf.c | 2 +- math/w_remainderl.c | 2 +- math/w_scalb.c | 6 ++-- math/w_scalbf.c | 6 ++-- math/w_scalbl.c | 6 ++-- sysdeps/ieee754/dbl-64/s_isinf_ns.c | 20 ------------- sysdeps/ieee754/dbl-64/s_sincos.c | 2 +- sysdeps/ieee754/dbl-64/wordsize-64/math_private.h | 36 ----------------------- sysdeps/ieee754/dbl-64/wordsize-64/s_isinf_ns.c | 20 ------------- sysdeps/ieee754/flt-32/e_exp2f.c | 2 +- sysdeps/ieee754/flt-32/math_private.h | 35 ---------------------- sysdeps/ieee754/flt-32/s_isinf_nsf.c | 20 ------------- sysdeps/ieee754/ldbl-128/s_isinf_nsl.c | 19 ------------ sysdeps/ieee754/ldbl-128/s_sincosl.c | 2 +- sysdeps/ieee754/ldbl-128ibm/s_isinf_nsl.c | 23 --------------- sysdeps/ieee754/ldbl-128ibm/s_sincosl.c | 2 +- sysdeps/ieee754/ldbl-96/s_isinf_nsl.c | 18 ------------ sysdeps/ieee754/ldbl-96/s_sincosl.c | 2 +- 38 files changed, 53 insertions(+), 248 deletions(-) delete mode 100644 sysdeps/ieee754/dbl-64/s_isinf_ns.c delete mode 100644 sysdeps/ieee754/dbl-64/wordsize-64/math_private.h delete mode 100644 sysdeps/ieee754/dbl-64/wordsize-64/s_isinf_ns.c delete mode 100644 sysdeps/ieee754/flt-32/math_private.h delete mode 100644 sysdeps/ieee754/flt-32/s_isinf_nsf.c delete mode 100644 sysdeps/ieee754/ldbl-128/s_isinf_nsl.c delete mode 100644 sysdeps/ieee754/ldbl-128ibm/s_isinf_nsl.c delete mode 100644 sysdeps/ieee754/ldbl-96/s_isinf_nsl.c diff --git a/include/math.h b/include/math.h index 42bb55e..b28c441 100644 --- a/include/math.h +++ b/include/math.h @@ -35,9 +35,5 @@ libm_hidden_proto (__expl) libm_hidden_proto (__expm1l) # endif -extern int __isinf_ns (double); -extern int __isinf_nsf (float); -extern int __isinf_nsl (long double); - #endif #endif diff --git a/math/Makefile b/math/Makefile index 2e5291a..8a26209 100644 --- a/math/Makefile +++ b/math/Makefile @@ -61,7 +61,7 @@ libm-calls = e_acos e_acosh e_asin e_atan2 e_atanh e_cosh e_exp e_fmod \ s_catan s_casin s_ccos s_csin s_ctan s_ctanh s_cacos \ s_casinh s_cacosh s_catanh s_csqrt s_cpow s_cproj s_clog10 \ s_fma s_lrint s_llrint s_lround s_llround e_exp10 w_log2 \ - s_isinf_ns s_issignaling $(calls:s_%=m_%) x2y2m1 k_casinh \ + s_issignaling $(calls:s_%=m_%) x2y2m1 k_casinh \ gamma_product k_standard lgamma_neg lgamma_product dbl-only-routines := branred doasin dosincos halfulp mpa mpatan2 \ diff --git a/math/divtc3.c b/math/divtc3.c index bfd9b3f..c0dee8e 100644 --- a/math/divtc3.c +++ b/math/divtc3.c @@ -54,19 +54,19 @@ __divtc3 (long double a, long double b, long double c, long double d) x = __copysignl (INFINITY, c) * a; y = __copysignl (INFINITY, c) * b; } - else if ((__isinf_nsl (a) || __isinf_nsl (b)) + else if ((isinf (a) || isinf (b)) && isfinite (c) && isfinite (d)) { - a = __copysignl (__isinf_nsl (a) ? 1 : 0, a); - b = __copysignl (__isinf_nsl (b) ? 1 : 0, b); + a = __copysignl (isinf (a) ? 1 : 0, a); + b = __copysignl (isinf (b) ? 1 : 0, b); x = INFINITY * (a * c + b * d); y = INFINITY * (b * c - a * d); } - else if ((__isinf_nsl (c) || __isinf_nsl (d)) + else if ((isinf (c) || isinf (d)) && isfinite (a) && isfinite (b)) { - c = __copysignl (__isinf_nsl (c) ? 1 : 0, c); - d = __copysignl (__isinf_nsl (d) ? 1 : 0, d); + c = __copysignl (isinf (c) ? 1 : 0, c); + d = __copysignl (isinf (d) ? 1 : 0, d); x = 0.0 * (a * c + b * d); y = 0.0 * (b * c - a * d); } diff --git a/math/multc3.c b/math/multc3.c index 1dbb59a..2fd165d 100644 --- a/math/multc3.c +++ b/math/multc3.c @@ -38,29 +38,29 @@ __multc3 (long double a, long double b, long double c, long double d) { /* Recover infinities that computed as NaN + iNaN. */ bool recalc = 0; - if (__isinf_nsl (a) || __isinf_nsl (b)) + if (isinf (a) || isinf (b)) { /* z is infinite. "Box" the infinity and change NaNs in the other factor to 0. */ - a = __copysignl (__isinf_nsl (a) ? 1 : 0, a); - b = __copysignl (__isinf_nsl (b) ? 1 : 0, b); + a = __copysignl (isinf (a) ? 1 : 0, a); + b = __copysignl (isinf (b) ? 1 : 0, b); if (isnan (c)) c = __copysignl (0, c); if (isnan (d)) d = __copysignl (0, d); recalc = 1; } - if (__isinf_nsl (c) || __isinf_nsl (d)) + if (isinf (c) || isinf (d)) { /* w is infinite. "Box" the infinity and change NaNs in the other factor to 0. */ - c = __copysignl (__isinf_nsl (c) ? 1 : 0, c); - d = __copysignl (__isinf_nsl (d) ? 1 : 0, d); + c = __copysignl (isinf (c) ? 1 : 0, c); + d = __copysignl (isinf (d) ? 1 : 0, d); if (isnan (a)) a = __copysignl (0, a); if (isnan (b)) b = __copysignl (0, b); recalc = 1; } if (!recalc - && (__isinf_nsl (ac) || __isinf_nsl (bd) - || __isinf_nsl (ad) || __isinf_nsl (bc))) + && (isinf (ac) || isinf (bd) + || isinf (ad) || isinf (bc))) { /* Recover infinities from overflow by changing NaNs to 0. */ if (isnan (a)) a = __copysignl (0, a); diff --git a/math/s_casin.c b/math/s_casin.c index 206f1d2..826fd38 100644 --- a/math/s_casin.c +++ b/math/s_casin.c @@ -33,7 +33,7 @@ __casin (__complex__ double x) { res = x; } - else if (__isinf_ns (__real__ x) || __isinf_ns (__imag__ x)) + else if (isinf (__real__ x) || isinf (__imag__ x)) { __real__ res = __nan (""); __imag__ res = __copysign (HUGE_VAL, __imag__ x); diff --git a/math/s_casinf.c b/math/s_casinf.c index 65cba20..9b3d2f1 100644 --- a/math/s_casinf.c +++ b/math/s_casinf.c @@ -33,7 +33,7 @@ __casinf (__complex__ float x) { res = x; } - else if (__isinf_nsf (__real__ x) || __isinf_nsf (__imag__ x)) + else if (isinf (__real__ x) || isinf (__imag__ x)) { __real__ res = __nanf (""); __imag__ res = __copysignf (HUGE_VALF, __imag__ x); diff --git a/math/s_casinl.c b/math/s_casinl.c index 2263a26..f7d85fc 100644 --- a/math/s_casinl.c +++ b/math/s_casinl.c @@ -33,7 +33,7 @@ __casinl (__complex__ long double x) { res = x; } - else if (__isinf_nsl (__real__ x) || __isinf_nsl (__imag__ x)) + else if (isinf (__real__ x) || isinf (__imag__ x)) { __real__ res = __nanl (""); __imag__ res = __copysignl (HUGE_VALL, __imag__ x); diff --git a/math/s_cproj.c b/math/s_cproj.c index bf2cfc4..42bf076 100644 --- a/math/s_cproj.c +++ b/math/s_cproj.c @@ -25,7 +25,7 @@ __complex__ double __cproj (__complex__ double x) { - if (__isinf_ns (__real__ x) || __isinf_ns (__imag__ x)) + if (isinf (__real__ x) || isinf (__imag__ x)) { __complex__ double res; diff --git a/math/s_cprojf.c b/math/s_cprojf.c index 531d10e..9340372 100644 --- a/math/s_cprojf.c +++ b/math/s_cprojf.c @@ -25,7 +25,7 @@ __complex__ float __cprojf (__complex__ float x) { - if (__isinf_nsf (__real__ x) || __isinf_nsf (__imag__ x)) + if (isinf (__real__ x) || isinf (__imag__ x)) { __complex__ float res; diff --git a/math/s_cprojl.c b/math/s_cprojl.c index 32292a4..de88318 100644 --- a/math/s_cprojl.c +++ b/math/s_cprojl.c @@ -25,7 +25,7 @@ __complex__ long double __cprojl (__complex__ long double x) { - if (__isinf_nsl (__real__ x) || __isinf_nsl (__imag__ x)) + if (isinf (__real__ x) || isinf (__imag__ x)) { __complex__ long double res; diff --git a/math/s_ctan.c b/math/s_ctan.c index 7ed6abd..674c3b6 100644 --- a/math/s_ctan.c +++ b/math/s_ctan.c @@ -30,7 +30,7 @@ __ctan (__complex__ double x) if (__glibc_unlikely (!isfinite (__real__ x) || !isfinite (__imag__ x))) { - if (__isinf_ns (__imag__ x)) + if (isinf (__imag__ x)) { if (isfinite (__real__ x) && fabs (__real__ x) > 1.0) { @@ -51,7 +51,7 @@ __ctan (__complex__ double x) __real__ res = __nan (""); __imag__ res = __nan (""); - if (__isinf_ns (__real__ x)) + if (isinf (__real__ x)) feraiseexcept (FE_INVALID); } } diff --git a/math/s_ctanf.c b/math/s_ctanf.c index d87f775..e0ebe43 100644 --- a/math/s_ctanf.c +++ b/math/s_ctanf.c @@ -30,7 +30,7 @@ __ctanf (__complex__ float x) if (__glibc_unlikely (!isfinite (__real__ x) || !isfinite (__imag__ x))) { - if (__isinf_nsf (__imag__ x)) + if (isinf (__imag__ x)) { if (isfinite (__real__ x) && fabsf (__real__ x) > 1.0f) { @@ -51,7 +51,7 @@ __ctanf (__complex__ float x) __real__ res = __nanf (""); __imag__ res = __nanf (""); - if (__isinf_nsf (__real__ x)) + if (isinf (__real__ x)) feraiseexcept (FE_INVALID); } } diff --git a/math/s_ctanh.c b/math/s_ctanh.c index a41cd1a..58607b1 100644 --- a/math/s_ctanh.c +++ b/math/s_ctanh.c @@ -30,7 +30,7 @@ __ctanh (__complex__ double x) if (__glibc_unlikely (!isfinite (__real__ x) || !isfinite (__imag__ x))) { - if (__isinf_ns (__real__ x)) + if (isinf (__real__ x)) { __real__ res = __copysign (1.0, __real__ x); if (isfinite (__imag__ x) && fabs (__imag__ x) > 1.0) @@ -51,7 +51,7 @@ __ctanh (__complex__ double x) __real__ res = __nan (""); __imag__ res = __nan (""); - if (__isinf_ns (__imag__ x)) + if (isinf (__imag__ x)) feraiseexcept (FE_INVALID); } } diff --git a/math/s_ctanhf.c b/math/s_ctanhf.c index 3ce8ac1..a4fd230 100644 --- a/math/s_ctanhf.c +++ b/math/s_ctanhf.c @@ -30,7 +30,7 @@ __ctanhf (__complex__ float x) if (__glibc_unlikely (!isfinite (__real__ x) || !isfinite (__imag__ x))) { - if (__isinf_nsf (__real__ x)) + if (isinf (__real__ x)) { __real__ res = __copysignf (1.0, __real__ x); if (isfinite (__imag__ x) && fabsf (__imag__ x) > 1.0f) @@ -51,7 +51,7 @@ __ctanhf (__complex__ float x) __real__ res = __nanf (""); __imag__ res = __nanf (""); - if (__isinf_nsf (__imag__ x)) + if (isinf (__imag__ x)) feraiseexcept (FE_INVALID); } } diff --git a/math/s_ctanhl.c b/math/s_ctanhl.c index 2fc54a8..fb67b2b 100644 --- a/math/s_ctanhl.c +++ b/math/s_ctanhl.c @@ -37,7 +37,7 @@ __ctanhl (__complex__ long double x) if (__glibc_unlikely (!isfinite (__real__ x) || !isfinite (__imag__ x))) { - if (__isinf_nsl (__real__ x)) + if (isinf (__real__ x)) { __real__ res = __copysignl (1.0, __real__ x); if (isfinite (__imag__ x) && fabsl (__imag__ x) > 1.0L) @@ -58,7 +58,7 @@ __ctanhl (__complex__ long double x) __real__ res = __nanl (""); __imag__ res = __nanl (""); - if (__isinf_nsl (__imag__ x)) + if (isinf (__imag__ x)) feraiseexcept (FE_INVALID); } } diff --git a/math/s_ctanl.c b/math/s_ctanl.c index 9090c1a..4783dcb 100644 --- a/math/s_ctanl.c +++ b/math/s_ctanl.c @@ -37,7 +37,7 @@ __ctanl (__complex__ long double x) if (__glibc_unlikely (!isfinite (__real__ x) || !isfinite (__imag__ x))) { - if (__isinf_nsl (__imag__ x)) + if (isinf (__imag__ x)) { if (isfinite (__real__ x) && fabsl (__real__ x) > 1.0L) { @@ -58,7 +58,7 @@ __ctanl (__complex__ long double x) __real__ res = __nanl (""); __imag__ res = __nanl (""); - if (__isinf_nsl (__real__ x)) + if (isinf (__real__ x)) feraiseexcept (FE_INVALID); } } diff --git a/math/w_fmod.c b/math/w_fmod.c index 0ee5ee4..90f2465 100644 --- a/math/w_fmod.c +++ b/math/w_fmod.c @@ -23,7 +23,7 @@ double __fmod (double x, double y) { - if (__builtin_expect (__isinf_ns (x) || y == 0.0, 0) + if (__builtin_expect (isinf (x) || y == 0.0, 0) && _LIB_VERSION != _IEEE_ && !isnan (y) && !isnan (x)) /* fmod(+-Inf,y) or fmod(x,0) */ return __kernel_standard (x, y, 27); diff --git a/math/w_fmodf.c b/math/w_fmodf.c index ba9b847..7dcb2fe 100644 --- a/math/w_fmodf.c +++ b/math/w_fmodf.c @@ -23,7 +23,7 @@ float __fmodf (float x, float y) { - if (__builtin_expect (__isinf_nsf (x) || y == 0.0f, 0) + if (__builtin_expect (isinf (x) || y == 0.0f, 0) && _LIB_VERSION != _IEEE_ && !isnan (y) && !isnan (x)) /* fmod(+-Inf,y) or fmod(x,0) */ return __kernel_standard_f (x, y, 127); diff --git a/math/w_fmodl.c b/math/w_fmodl.c index a64af8e..f6a25d2 100644 --- a/math/w_fmodl.c +++ b/math/w_fmodl.c @@ -23,7 +23,7 @@ long double __fmodl (long double x, long double y) { - if (__builtin_expect (__isinf_nsl (x) || y == 0.0L, 0) + if (__builtin_expect (isinf (x) || y == 0.0L, 0) && _LIB_VERSION != _IEEE_ && !isnan (y) && !isnan (x)) /* fmod(+-Inf,y) or fmod(x,0) */ return __kernel_standard_l (x, y, 227); diff --git a/math/w_remainder.c b/math/w_remainder.c index 9be4dfd..a6da192 100644 --- a/math/w_remainder.c +++ b/math/w_remainder.c @@ -25,7 +25,7 @@ double __remainder (double x, double y) { if (((__builtin_expect (y == 0.0, 0) && ! isnan (x)) - || (__builtin_expect (__isinf_ns (x), 0) && ! isnan (y))) + || (__builtin_expect (isinf (x), 0) && ! isnan (y))) && _LIB_VERSION != _IEEE_) return __kernel_standard (x, y, 28); /* remainder domain */ diff --git a/math/w_remainderf.c b/math/w_remainderf.c index b207d84..c003002 100644 --- a/math/w_remainderf.c +++ b/math/w_remainderf.c @@ -25,7 +25,7 @@ float __remainderf (float x, float y) { if (((__builtin_expect (y == 0.0f, 0) && ! isnan (x)) - || (__builtin_expect (__isinf_nsf (x), 0) && ! isnan (y))) + || (__builtin_expect (isinf (x), 0) && ! isnan (y))) && _LIB_VERSION != _IEEE_) return __kernel_standard_f (x, y, 128); /* remainder domain */ diff --git a/math/w_remainderl.c b/math/w_remainderl.c index 78842af..b25929d 100644 --- a/math/w_remainderl.c +++ b/math/w_remainderl.c @@ -25,7 +25,7 @@ long double __remainderl (long double x, long double y) { if (((__builtin_expect (y == 0.0L, 0) && ! isnan (x)) - || (__builtin_expect (__isinf_nsl (x), 0) && ! isnan (y))) + || (__builtin_expect (isinf (x), 0) && ! isnan (y))) && _LIB_VERSION != _IEEE_) return __kernel_standard_l (x, y, 228); /* remainder domain */ diff --git a/math/w_scalb.c b/math/w_scalb.c index 09627f4..ea258b1 100644 --- a/math/w_scalb.c +++ b/math/w_scalb.c @@ -58,15 +58,15 @@ __scalb (double x, double fn) if (!isnan (x) && !isnan (fn)) __set_errno (EDOM); } - else if (__isinf_ns (z)) + else if (isinf (z)) { - if (!__isinf_ns (x) && !__isinf_ns (fn)) + if (!isinf (x) && !isinf (fn)) __set_errno (ERANGE); } else { /* z == 0. */ - if (x != 0.0 && !__isinf_ns (fn)) + if (x != 0.0 && !isinf (fn)) __set_errno (ERANGE); } } diff --git a/math/w_scalbf.c b/math/w_scalbf.c index e7b855b..30eb3a2 100644 --- a/math/w_scalbf.c +++ b/math/w_scalbf.c @@ -58,15 +58,15 @@ __scalbf (float x, float fn) if (!isnan (x) && !isnan (fn)) __set_errno (EDOM); } - else if (__isinf_nsf (z)) + else if (isinf (z)) { - if (!__isinf_nsf (x) && !__isinf_nsf (fn)) + if (!isinf (x) && !isinf (fn)) __set_errno (ERANGE); } else { /* z == 0. */ - if (x != 0.0f && !__isinf_nsf (fn)) + if (x != 0.0f && !isinf (fn)) __set_errno (ERANGE); } } diff --git a/math/w_scalbl.c b/math/w_scalbl.c index 5e1e017..0fcf807 100644 --- a/math/w_scalbl.c +++ b/math/w_scalbl.c @@ -58,15 +58,15 @@ __scalbl (long double x, long double fn) if (!isnan (x) && !isnan (fn)) __set_errno (EDOM); } - else if (__isinf_nsl (z)) + else if (isinf (z)) { - if (!__isinf_nsl (x) && !__isinf_nsl (fn)) + if (!isinf (x) && !isinf (fn)) __set_errno (ERANGE); } else { /* z == 0. */ - if (x != 0.0L && !__isinf_nsl (fn)) + if (x != 0.0L && !isinf (fn)) __set_errno (ERANGE); } } diff --git a/sysdeps/ieee754/dbl-64/s_isinf_ns.c b/sysdeps/ieee754/dbl-64/s_isinf_ns.c deleted file mode 100644 index d8142bc..0000000 --- a/sysdeps/ieee754/dbl-64/s_isinf_ns.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Written by Ulrich Drepper . - */ - -/* - * __isinf_ns(x) returns != 0 if x is ±inf, else 0; - * no branching! - */ - -#include -#include - -#undef __isinf_ns -int -__isinf_ns (double x) -{ - int32_t hx, lx; - EXTRACT_WORDS (hx, lx, x); - return !(lx | ((hx & 0x7fffffff) ^ 0x7ff00000)); -} diff --git a/sysdeps/ieee754/dbl-64/s_sincos.c b/sysdeps/ieee754/dbl-64/s_sincos.c index c8a9999..d7431b7 100644 --- a/sysdeps/ieee754/dbl-64/s_sincos.c +++ b/sysdeps/ieee754/dbl-64/s_sincos.c @@ -37,7 +37,7 @@ __sincos (double x, double *sinx, double *cosx) { /* sin(Inf or NaN) is NaN */ *sinx = *cosx = x - x; - if (__isinf_ns (x)) + if (isinf (x)) __set_errno (EDOM); } else diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/math_private.h b/sysdeps/ieee754/dbl-64/wordsize-64/math_private.h deleted file mode 100644 index 4f92199..0000000 --- a/sysdeps/ieee754/dbl-64/wordsize-64/math_private.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef _MATH_PRIVATE_H_ - -#include_next -#include - -#ifndef __isnan -extern __always_inline int -__isnan (double d) -{ - uint64_t di; - EXTRACT_WORDS64 (di, d); - return (di & 0x7fffffffffffffffull) > 0x7ff0000000000000ull; -} -#endif - -#ifndef __isinf_ns -extern __always_inline int -__isinf_ns (double d) -{ - uint64_t di; - EXTRACT_WORDS64 (di, d); - return (di & 0x7fffffffffffffffull) == 0x7ff0000000000000ull; -} -#endif - -#ifndef __finite -extern __always_inline int -__finite (double d) -{ - uint64_t di; - EXTRACT_WORDS64 (di, d); - return (di & 0x7fffffffffffffffull) < 0x7ff0000000000000ull; -} -#endif - -#endif /* _MATH_PRIVATE_H_ */ diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_isinf_ns.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_isinf_ns.c deleted file mode 100644 index 9d78ed1..0000000 --- a/sysdeps/ieee754/dbl-64/wordsize-64/s_isinf_ns.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Written by Ulrich Drepper . - */ - -/* - * __isinf_ns(x) returns != 0 if x is ±inf, else 0; - * no branching! - */ - -#include -#include - -#undef __isinf_ns -int -__isinf_ns (double x) -{ - int64_t ix; - EXTRACT_WORDS64(ix,x); - return (ix & UINT64_C(0x7fffffffffffffff)) == UINT64_C(0x7ff0000000000000); -} diff --git a/sysdeps/ieee754/flt-32/e_exp2f.c b/sysdeps/ieee754/flt-32/e_exp2f.c index bc62042..170c565 100644 --- a/sysdeps/ieee754/flt-32/e_exp2f.c +++ b/sysdeps/ieee754/flt-32/e_exp2f.c @@ -122,7 +122,7 @@ __ieee754_exp2f (float x) /* Exceptional cases: */ else if (isless (x, himark)) { - if (__isinf_nsf (x)) + if (isinf (x)) /* e^-inf == 0, with no error. */ return 0; else diff --git a/sysdeps/ieee754/flt-32/math_private.h b/sysdeps/ieee754/flt-32/math_private.h deleted file mode 100644 index e33db02..0000000 --- a/sysdeps/ieee754/flt-32/math_private.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef _MATH_PRIVATE_H_ - -#include_next - -#ifndef __isnanf -extern __always_inline int -__isnanf (float d) -{ - u_int32_t di; - GET_FLOAT_WORD (di, d); - return (di & 0x7fffffff) > 0x7f800000; -} -#endif - -#ifndef __isinf_nsf -extern __always_inline int -__isinf_nsf (float d) -{ - u_int32_t di; - GET_FLOAT_WORD (di, d); - return (di & 0x7fffffff) == 0x7f800000; -} -#endif - -#ifndef __finitef -extern __always_inline int -__finitef (float d) -{ - u_int32_t di; - GET_FLOAT_WORD (di, d); - return (di & 0x7fffffff) < 0x7f800000; -} -#endif - -#endif /* _MATH_PRIVATE_H_ */ diff --git a/sysdeps/ieee754/flt-32/s_isinf_nsf.c b/sysdeps/ieee754/flt-32/s_isinf_nsf.c deleted file mode 100644 index 284d619..0000000 --- a/sysdeps/ieee754/flt-32/s_isinf_nsf.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Written by Ulrich Drepper . - */ - -/* - * __isinf_nsf(x) returns != 0 if x is ±inf, else 0; - * no branching! - */ - -#include -#include - -#undef __isinf_nsf -int -__isinf_nsf (float x) -{ - int32_t ix; - GET_FLOAT_WORD(ix,x); - return (ix & 0x7fffffff) == 0x7f800000; -} diff --git a/sysdeps/ieee754/ldbl-128/s_isinf_nsl.c b/sysdeps/ieee754/ldbl-128/s_isinf_nsl.c deleted file mode 100644 index 7d6cfb9..0000000 --- a/sysdeps/ieee754/ldbl-128/s_isinf_nsl.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Written by Ulrich Drepper - */ - -/* - * __isinf_nsl(x) returns != 0 if x is ±inf, else 0; - * no branching! - */ - -#include -#include - -int -__isinf_nsl (long double x) -{ - int64_t hx,lx; - GET_LDOUBLE_WORDS64(hx,lx,x); - return !(lx | ((hx & 0x7fffffffffffffffLL) ^ 0x7fff000000000000LL)); -} diff --git a/sysdeps/ieee754/ldbl-128/s_sincosl.c b/sysdeps/ieee754/ldbl-128/s_sincosl.c index 6c4cbd7..d4d432a 100644 --- a/sysdeps/ieee754/ldbl-128/s_sincosl.c +++ b/sysdeps/ieee754/ldbl-128/s_sincosl.c @@ -39,7 +39,7 @@ __sincosl (long double x, long double *sinx, long double *cosx) { /* sin(Inf or NaN) is NaN */ *sinx = *cosx = x - x; - if (__isinf_nsl (x)) + if (isinf (x)) __set_errno (EDOM); } else diff --git a/sysdeps/ieee754/ldbl-128ibm/s_isinf_nsl.c b/sysdeps/ieee754/ldbl-128ibm/s_isinf_nsl.c deleted file mode 100644 index 54e72c9..0000000 --- a/sysdeps/ieee754/ldbl-128ibm/s_isinf_nsl.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - * __isinf_nsl(x) returns != 0 if x is ±inf, else 0; - * no branching! - * slightly dodgy in relying on signed shift right copying sign bit - */ - -#include -#include - -int -__isinf_nsl (long double x) -{ - double xhi; - int64_t hx, mask; - - xhi = ldbl_high (x); - EXTRACT_WORDS64 (hx, xhi); - - mask = (hx & 0x7fffffffffffffffLL) ^ 0x7ff0000000000000LL; - mask |= -mask; - mask >>= 63; - return ~mask; -} diff --git a/sysdeps/ieee754/ldbl-128ibm/s_sincosl.c b/sysdeps/ieee754/ldbl-128ibm/s_sincosl.c index 8a49c54..b7efd1a 100644 --- a/sysdeps/ieee754/ldbl-128ibm/s_sincosl.c +++ b/sysdeps/ieee754/ldbl-128ibm/s_sincosl.c @@ -42,7 +42,7 @@ __sincosl (long double x, long double *sinx, long double *cosx) { /* sin(Inf or NaN) is NaN */ *sinx = *cosx = x - x; - if (__isinf_nsl (x)) + if (isinf (x)) __set_errno (EDOM); } else diff --git a/sysdeps/ieee754/ldbl-96/s_isinf_nsl.c b/sysdeps/ieee754/ldbl-96/s_isinf_nsl.c deleted file mode 100644 index 9c7868b..0000000 --- a/sysdeps/ieee754/ldbl-96/s_isinf_nsl.c +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Written by Ulrich Drepper . - */ - -/* - * __isinf_nsl(x) returns != 0 if x is ±inf, else 0; - */ - -#include -#include - -int -__isinf_nsl (long double x) -{ - int32_t se,hx,lx; - GET_LDOUBLE_WORDS(se,hx,lx,x); - return !(((se & 0x7fff) ^ 0x7fff) | lx | (hx & 0x7fffffff)); -} diff --git a/sysdeps/ieee754/ldbl-96/s_sincosl.c b/sysdeps/ieee754/ldbl-96/s_sincosl.c index 37067bd..86f1d96 100644 --- a/sysdeps/ieee754/ldbl-96/s_sincosl.c +++ b/sysdeps/ieee754/ldbl-96/s_sincosl.c @@ -42,7 +42,7 @@ __sincosl (long double x, long double *sinx, long double *cosx) { /* sin(Inf or NaN) is NaN */ *sinx = *cosx = x - x; - if (__isinf_nsl (x)) + if (isinf (x)) __set_errno (EDOM); } else