Skip to content

Commit

Permalink
Since we now inline isinf, isnan and isfinite in math.h, replace uses…
Browse files Browse the repository at this point in the history
… of __isinf_ns(l/f)

with isinf, and remove the unused inlines __isinf_ns(l/f), __isnan(f) and __finite(f).

2015-09-18  Wilco Dijkstra  <wdijkstr@arm.com>

        * 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_cprojl.c(__cprojll): Replace
        __isinf_nsl with isinf.
        * sysdeps/ieee754/ldbl-128ibm/s_ctanl.c(__ctanl): 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.
  • Loading branch information
Wilco Dijkstra committed Sep 18, 2015
1 parent 6565fcb commit fe8c2b3
Show file tree
Hide file tree
Showing 39 changed files with 103 additions and 248 deletions.
50 changes: 50 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,53 @@
2015-09-18 Wilco Dijkstra <wdijkstr@arm.com>

* 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_cprojl.c(__cprojll): Replace
__isinf_nsl with isinf.
* sysdeps/ieee754/ldbl-128ibm/s_ctanl.c(__ctanl): 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.

2015-09-18 Wilco Dijkstra <wdijkstr@arm.com>

* resolv/base64.c (rcsid): Remove unused static.
Expand Down
4 changes: 0 additions & 4 deletions include/math.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion math/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
12 changes: 6 additions & 6 deletions math/divtc3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
16 changes: 8 additions & 8 deletions math/multc3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion math/s_casin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion math/s_casinf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion math/s_casinl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion math/s_cproj.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion math/s_cprojf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion math/s_cprojl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions math/s_ctan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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);
}
}
Expand Down
4 changes: 2 additions & 2 deletions math/s_ctanf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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);
}
}
Expand Down
4 changes: 2 additions & 2 deletions math/s_ctanh.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
}
}
Expand Down
4 changes: 2 additions & 2 deletions math/s_ctanhf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
}
}
Expand Down
4 changes: 2 additions & 2 deletions math/s_ctanhl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
}
}
Expand Down
4 changes: 2 additions & 2 deletions math/s_ctanl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion math/w_fmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion math/w_fmodf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion math/w_fmodl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion math/w_remainder.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down
2 changes: 1 addition & 1 deletion math/w_remainderf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down
2 changes: 1 addition & 1 deletion math/w_remainderl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down
6 changes: 3 additions & 3 deletions math/w_scalb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
6 changes: 3 additions & 3 deletions math/w_scalbf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
Loading

0 comments on commit fe8c2b3

Please sign in to comment.