diff options
author | Ondřej Bílka <neleai@seznam.cz> | 2014-02-10 14:45:42 +0100 |
---|---|---|
committer | Ondřej Bílka <neleai@seznam.cz> | 2014-02-10 15:07:12 +0100 |
commit | a1ffb40e32741f992c743e7b16c061fefa3747ac (patch) | |
tree | 246a29a87b26cfd5d07b17070f85eb3785018de9 /math | |
parent | 1448f3244714a9dabb5240ec18b094f100887d5c (diff) | |
download | glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.tar.gz glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.tar.xz glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.zip |
Use glibc_likely instead __builtin_expect.
Diffstat (limited to 'math')
43 files changed, 125 insertions, 125 deletions
diff --git a/math/e_exp2l.c b/math/e_exp2l.c index 0bea7726af..c0edfbe2a3 100644 --- a/math/e_exp2l.c +++ b/math/e_exp2l.c @@ -23,7 +23,7 @@ long double __ieee754_exp2l (long double x) { - if (__builtin_expect (isless (x, (long double) LDBL_MAX_EXP), 1)) + if (__glibc_likely (isless (x, (long double) LDBL_MAX_EXP))) { if (__builtin_expect (isgreaterequal (x, (long double) (LDBL_MIN_EXP - LDBL_MANT_DIG diff --git a/math/e_scalb.c b/math/e_scalb.c index 487f4413c2..bddedfa032 100644 --- a/math/e_scalb.c +++ b/math/e_scalb.c @@ -40,9 +40,9 @@ invalid_fn (double x, double fn) double __ieee754_scalb (double x, double fn) { - if (__builtin_expect (__isnan (x), 0)) + if (__glibc_unlikely (__isnan (x))) return x * fn; - if (__builtin_expect (!__finite (fn), 0)) + if (__glibc_unlikely (!__finite (fn))) { if (__isnan (fn) || fn > 0.0) return x * fn; @@ -50,7 +50,7 @@ __ieee754_scalb (double x, double fn) return x; return x / -fn; } - if (__builtin_expect ((double) (int) fn != fn, 0)) + if (__glibc_unlikely ((double) (int) fn != fn)) return invalid_fn (x, fn); return __scalbn (x, (int) fn); diff --git a/math/e_scalbf.c b/math/e_scalbf.c index 68e6c5fcce..319752c993 100644 --- a/math/e_scalbf.c +++ b/math/e_scalbf.c @@ -40,9 +40,9 @@ invalid_fn (float x, float fn) float __ieee754_scalbf (float x, float fn) { - if (__builtin_expect (__isnanf (x), 0)) + if (__glibc_unlikely (__isnanf (x))) return x * fn; - if (__builtin_expect (!__finitef (fn), 0)) + if (__glibc_unlikely (!__finitef (fn))) { if (__isnanf (fn) || fn > 0.0f) return x * fn; @@ -50,7 +50,7 @@ __ieee754_scalbf (float x, float fn) return x; return x / -fn; } - if (__builtin_expect ((float) (int) fn != fn, 0)) + if (__glibc_unlikely ((float) (int) fn != fn)) return invalid_fn (x, fn); return __scalbnf (x, (int) fn); diff --git a/math/e_scalbl.c b/math/e_scalbl.c index 256e7b131f..5815a0d67b 100644 --- a/math/e_scalbl.c +++ b/math/e_scalbl.c @@ -40,9 +40,9 @@ invalid_fn (long double x, long double fn) long double __ieee754_scalbl (long double x, long double fn) { - if (__builtin_expect (__isnanl (x), 0)) + if (__glibc_unlikely (__isnanl (x))) return x * fn; - if (__builtin_expect (!__finitel (fn), 0)) + if (__glibc_unlikely (!__finitel (fn))) { if (__isnanl (fn) || fn > 0.0L) return x * fn; @@ -50,7 +50,7 @@ __ieee754_scalbl (long double x, long double fn) return x; return x / -fn; } - if (__builtin_expect ((long double) (int) fn != fn, 0)) + if (__glibc_unlikely ((long double) (int) fn != fn)) return invalid_fn (x, fn); return __scalbnl (x, (int) fn); diff --git a/math/s_catan.c b/math/s_catan.c index 87cdd31295..d6552d8b7c 100644 --- a/math/s_catan.c +++ b/math/s_catan.c @@ -29,7 +29,7 @@ __catan (__complex__ double x) int rcls = fpclassify (__real__ x); int icls = fpclassify (__imag__ x); - if (__builtin_expect (rcls <= FP_INFINITE || icls <= FP_INFINITE, 0)) + if (__glibc_unlikely (rcls <= FP_INFINITE || icls <= FP_INFINITE)) { if (rcls == FP_INFINITE) { @@ -55,7 +55,7 @@ __catan (__complex__ double x) __imag__ res = __nan (""); } } - else if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0)) + else if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO)) { res = x; } diff --git a/math/s_catanf.c b/math/s_catanf.c index 80a34744e1..41e419d8b0 100644 --- a/math/s_catanf.c +++ b/math/s_catanf.c @@ -29,7 +29,7 @@ __catanf (__complex__ float x) int rcls = fpclassify (__real__ x); int icls = fpclassify (__imag__ x); - if (__builtin_expect (rcls <= FP_INFINITE || icls <= FP_INFINITE, 0)) + if (__glibc_unlikely (rcls <= FP_INFINITE || icls <= FP_INFINITE)) { if (rcls == FP_INFINITE) { @@ -55,7 +55,7 @@ __catanf (__complex__ float x) __imag__ res = __nanf (""); } } - else if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0)) + else if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO)) { res = x; } diff --git a/math/s_catanh.c b/math/s_catanh.c index 0c8b268418..2ba1298bb6 100644 --- a/math/s_catanh.c +++ b/math/s_catanh.c @@ -29,7 +29,7 @@ __catanh (__complex__ double x) int rcls = fpclassify (__real__ x); int icls = fpclassify (__imag__ x); - if (__builtin_expect (rcls <= FP_INFINITE || icls <= FP_INFINITE, 0)) + if (__glibc_unlikely (rcls <= FP_INFINITE || icls <= FP_INFINITE)) { if (icls == FP_INFINITE) { @@ -50,7 +50,7 @@ __catanh (__complex__ double x) __imag__ res = __nan (""); } } - else if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0)) + else if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO)) { res = x; } diff --git a/math/s_catanhf.c b/math/s_catanhf.c index ebb7b8232d..0ee69a5ba0 100644 --- a/math/s_catanhf.c +++ b/math/s_catanhf.c @@ -29,7 +29,7 @@ __catanhf (__complex__ float x) int rcls = fpclassify (__real__ x); int icls = fpclassify (__imag__ x); - if (__builtin_expect (rcls <= FP_INFINITE || icls <= FP_INFINITE, 0)) + if (__glibc_unlikely (rcls <= FP_INFINITE || icls <= FP_INFINITE)) { if (icls == FP_INFINITE) { @@ -50,7 +50,7 @@ __catanhf (__complex__ float x) __imag__ res = __nanf (""); } } - else if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0)) + else if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO)) { res = x; } diff --git a/math/s_catanhl.c b/math/s_catanhl.c index d45f1d1986..537bb3e28d 100644 --- a/math/s_catanhl.c +++ b/math/s_catanhl.c @@ -36,7 +36,7 @@ __catanhl (__complex__ long double x) int rcls = fpclassify (__real__ x); int icls = fpclassify (__imag__ x); - if (__builtin_expect (rcls <= FP_INFINITE || icls <= FP_INFINITE, 0)) + if (__glibc_unlikely (rcls <= FP_INFINITE || icls <= FP_INFINITE)) { if (icls == FP_INFINITE) { @@ -57,7 +57,7 @@ __catanhl (__complex__ long double x) __imag__ res = __nanl (""); } } - else if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0)) + else if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO)) { res = x; } diff --git a/math/s_catanl.c b/math/s_catanl.c index 32a4424962..cea9282a54 100644 --- a/math/s_catanl.c +++ b/math/s_catanl.c @@ -36,7 +36,7 @@ __catanl (__complex__ long double x) int rcls = fpclassify (__real__ x); int icls = fpclassify (__imag__ x); - if (__builtin_expect (rcls <= FP_INFINITE || icls <= FP_INFINITE, 0)) + if (__glibc_unlikely (rcls <= FP_INFINITE || icls <= FP_INFINITE)) { if (rcls == FP_INFINITE) { @@ -62,7 +62,7 @@ __catanl (__complex__ long double x) __imag__ res = __nanl (""); } } - else if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0)) + else if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO)) { res = x; } diff --git a/math/s_ccosh.c b/math/s_ccosh.c index 3ee40b1153..a3b93271f0 100644 --- a/math/s_ccosh.c +++ b/math/s_ccosh.c @@ -30,16 +30,16 @@ __ccosh (__complex__ double x) int rcls = fpclassify (__real__ x); int icls = fpclassify (__imag__ x); - if (__builtin_expect (rcls >= FP_ZERO, 1)) + if (__glibc_likely (rcls >= FP_ZERO)) { /* Real part is finite. */ - if (__builtin_expect (icls >= FP_ZERO, 1)) + if (__glibc_likely (icls >= FP_ZERO)) { /* Imaginary part is finite. */ const int t = (int) ((DBL_MAX_EXP - 1) * M_LN2); double sinix, cosix; - if (__builtin_expect (icls != FP_SUBNORMAL, 1)) + if (__glibc_likely (icls != FP_SUBNORMAL)) { __sincos (__imag__ x, &sinix, &cosix); } @@ -108,12 +108,12 @@ __ccosh (__complex__ double x) else if (rcls == FP_INFINITE) { /* Real part is infinite. */ - if (__builtin_expect (icls > FP_ZERO, 1)) + if (__glibc_likely (icls > FP_ZERO)) { /* Imaginary part is finite. */ double sinix, cosix; - if (__builtin_expect (icls != FP_SUBNORMAL, 1)) + if (__glibc_likely (icls != FP_SUBNORMAL)) { __sincos (__imag__ x, &sinix, &cosix); } diff --git a/math/s_ccoshf.c b/math/s_ccoshf.c index 4a9e94d004..084fc6d650 100644 --- a/math/s_ccoshf.c +++ b/math/s_ccoshf.c @@ -30,16 +30,16 @@ __ccoshf (__complex__ float x) int rcls = fpclassify (__real__ x); int icls = fpclassify (__imag__ x); - if (__builtin_expect (rcls >= FP_ZERO, 1)) + if (__glibc_likely (rcls >= FP_ZERO)) { /* Real part is finite. */ - if (__builtin_expect (icls >= FP_ZERO, 1)) + if (__glibc_likely (icls >= FP_ZERO)) { /* Imaginary part is finite. */ const int t = (int) ((FLT_MAX_EXP - 1) * M_LN2); float sinix, cosix; - if (__builtin_expect (icls != FP_SUBNORMAL, 1)) + if (__glibc_likely (icls != FP_SUBNORMAL)) { __sincosf (__imag__ x, &sinix, &cosix); } @@ -105,15 +105,15 @@ __ccoshf (__complex__ float x) feraiseexcept (FE_INVALID); } } - else if (__builtin_expect (rcls == FP_INFINITE, 1)) + else if (__glibc_likely (rcls == FP_INFINITE)) { /* Real part is infinite. */ - if (__builtin_expect (icls > FP_ZERO, 1)) + if (__glibc_likely (icls > FP_ZERO)) { /* Imaginary part is finite. */ float sinix, cosix; - if (__builtin_expect (icls != FP_SUBNORMAL, 1)) + if (__glibc_likely (icls != FP_SUBNORMAL)) { __sincosf (__imag__ x, &sinix, &cosix); } diff --git a/math/s_ccoshl.c b/math/s_ccoshl.c index bb79aad28e..e958c496d3 100644 --- a/math/s_ccoshl.c +++ b/math/s_ccoshl.c @@ -30,16 +30,16 @@ __ccoshl (__complex__ long double x) int rcls = fpclassify (__real__ x); int icls = fpclassify (__imag__ x); - if (__builtin_expect (rcls >= FP_ZERO, 1)) + if (__glibc_likely (rcls >= FP_ZERO)) { /* Real part is finite. */ - if (__builtin_expect (icls >= FP_ZERO, 1)) + if (__glibc_likely (icls >= FP_ZERO)) { /* Imaginary part is finite. */ const int t = (int) ((LDBL_MAX_EXP - 1) * M_LN2l); long double sinix, cosix; - if (__builtin_expect (icls != FP_SUBNORMAL, 1)) + if (__glibc_likely (icls != FP_SUBNORMAL)) { __sincosl (__imag__ x, &sinix, &cosix); } @@ -105,15 +105,15 @@ __ccoshl (__complex__ long double x) feraiseexcept (FE_INVALID); } } - else if (__builtin_expect (rcls == FP_INFINITE, 1)) + else if (__glibc_likely (rcls == FP_INFINITE)) { /* Real part is infinite. */ - if (__builtin_expect (icls > FP_ZERO, 1)) + if (__glibc_likely (icls > FP_ZERO)) { /* Imaginary part is finite. */ long double sinix, cosix; - if (__builtin_expect (icls != FP_SUBNORMAL, 1)) + if (__glibc_likely (icls != FP_SUBNORMAL)) { __sincosl (__imag__ x, &sinix, &cosix); } diff --git a/math/s_cexp.c b/math/s_cexp.c index dcb3228b99..a636e35dc4 100644 --- a/math/s_cexp.c +++ b/math/s_cexp.c @@ -30,16 +30,16 @@ __cexp (__complex__ double x) int rcls = fpclassify (__real__ x); int icls = fpclassify (__imag__ x); - if (__builtin_expect (rcls >= FP_ZERO, 1)) + if (__glibc_likely (rcls >= FP_ZERO)) { /* Real part is finite. */ - if (__builtin_expect (icls >= FP_ZERO, 1)) + if (__glibc_likely (icls >= FP_ZERO)) { /* Imaginary part is finite. */ const int t = (int) ((DBL_MAX_EXP - 1) * M_LN2); double sinix, cosix; - if (__builtin_expect (icls != FP_SUBNORMAL, 1)) + if (__glibc_likely (icls != FP_SUBNORMAL)) { __sincos (__imag__ x, &sinix, &cosix); } @@ -97,10 +97,10 @@ __cexp (__complex__ double x) feraiseexcept (FE_INVALID); } } - else if (__builtin_expect (rcls == FP_INFINITE, 1)) + else if (__glibc_likely (rcls == FP_INFINITE)) { /* Real part is infinite. */ - if (__builtin_expect (icls >= FP_ZERO, 1)) + if (__glibc_likely (icls >= FP_ZERO)) { /* Imaginary part is finite. */ double value = signbit (__real__ x) ? 0.0 : HUGE_VAL; @@ -115,7 +115,7 @@ __cexp (__complex__ double x) { double sinix, cosix; - if (__builtin_expect (icls != FP_SUBNORMAL, 1)) + if (__glibc_likely (icls != FP_SUBNORMAL)) { __sincos (__imag__ x, &sinix, &cosix); } diff --git a/math/s_cexpf.c b/math/s_cexpf.c index 8bfc7e251d..d0cdf79786 100644 --- a/math/s_cexpf.c +++ b/math/s_cexpf.c @@ -30,16 +30,16 @@ __cexpf (__complex__ float x) int rcls = fpclassify (__real__ x); int icls = fpclassify (__imag__ x); - if (__builtin_expect (rcls >= FP_ZERO, 1)) + if (__glibc_likely (rcls >= FP_ZERO)) { /* Real part is finite. */ - if (__builtin_expect (icls >= FP_ZERO, 1)) + if (__glibc_likely (icls >= FP_ZERO)) { /* Imaginary part is finite. */ const int t = (int) ((FLT_MAX_EXP - 1) * M_LN2); float sinix, cosix; - if (__builtin_expect (icls != FP_SUBNORMAL, 1)) + if (__glibc_likely (icls != FP_SUBNORMAL)) { __sincosf (__imag__ x, &sinix, &cosix); } @@ -97,10 +97,10 @@ __cexpf (__complex__ float x) feraiseexcept (FE_INVALID); } } - else if (__builtin_expect (rcls == FP_INFINITE, 1)) + else if (__glibc_likely (rcls == FP_INFINITE)) { /* Real part is infinite. */ - if (__builtin_expect (icls >= FP_ZERO, 1)) + if (__glibc_likely (icls >= FP_ZERO)) { /* Imaginary part is finite. */ float value = signbit (__real__ x) ? 0.0 : HUGE_VALF; @@ -115,7 +115,7 @@ __cexpf (__complex__ float x) { float sinix, cosix; - if (__builtin_expect (icls != FP_SUBNORMAL, 1)) + if (__glibc_likely (icls != FP_SUBNORMAL)) { __sincosf (__imag__ x, &sinix, &cosix); } diff --git a/math/s_cexpl.c b/math/s_cexpl.c index bd5572db88..3b64fd181a 100644 --- a/math/s_cexpl.c +++ b/math/s_cexpl.c @@ -30,16 +30,16 @@ __cexpl (__complex__ long double x) int rcls = fpclassify (__real__ x); int icls = fpclassify (__imag__ x); - if (__builtin_expect (rcls >= FP_ZERO, 1)) + if (__glibc_likely (rcls >= FP_ZERO)) { /* Real part is finite. */ - if (__builtin_expect (icls >= FP_ZERO, 1)) + if (__glibc_likely (icls >= FP_ZERO)) { /* Imaginary part is finite. */ const int t = (int) ((LDBL_MAX_EXP - 1) * M_LN2l); long double sinix, cosix; - if (__builtin_expect (icls != FP_SUBNORMAL, 1)) + if (__glibc_likely (icls != FP_SUBNORMAL)) { __sincosl (__imag__ x, &sinix, &cosix); } @@ -97,10 +97,10 @@ __cexpl (__complex__ long double x) feraiseexcept (FE_INVALID); } } - else if (__builtin_expect (rcls == FP_INFINITE, 1)) + else if (__glibc_likely (rcls == FP_INFINITE)) { /* Real part is infinite. */ - if (__builtin_expect (icls >= FP_ZERO, 1)) + if (__glibc_likely (icls >= FP_ZERO)) { /* Imaginary part is finite. */ long double value = signbit (__real__ x) ? 0.0 : HUGE_VALL; @@ -115,7 +115,7 @@ __cexpl (__complex__ long double x) { long double sinix, cosix; - if (__builtin_expect (icls != FP_SUBNORMAL, 1)) + if (__glibc_likely (icls != FP_SUBNORMAL)) { __sincosl (__imag__ x, &sinix, &cosix); } diff --git a/math/s_clog.c b/math/s_clog.c index e2b5846f2f..8639868bbf 100644 --- a/math/s_clog.c +++ b/math/s_clog.c @@ -29,7 +29,7 @@ __clog (__complex__ double x) int rcls = fpclassify (__real__ x); int icls = fpclassify (__imag__ x); - if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0)) + if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO)) { /* Real and imaginary part are 0.0. */ __imag__ result = signbit (__real__ x) ? M_PI : 0.0; @@ -37,7 +37,7 @@ __clog (__complex__ double x) /* Yes, the following line raises an exception. */ __real__ result = -1.0 / fabs (__real__ x); } - else if (__builtin_expect (rcls != FP_NAN && icls != FP_NAN, 1)) + else if (__glibc_likely (rcls != FP_NAN && icls != FP_NAN)) { /* Neither real nor imaginary part is NaN. */ double absx = fabs (__real__ x), absy = fabs (__imag__ x); diff --git a/math/s_clog10.c b/math/s_clog10.c index 0274db3617..417d56186c 100644 --- a/math/s_clog10.c +++ b/math/s_clog10.c @@ -32,7 +32,7 @@ __clog10 (__complex__ double x) int rcls = fpclassify (__real__ x); int icls = fpclassify (__imag__ x); - if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0)) + if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO)) { /* Real and imaginary part are 0.0. */ __imag__ result = signbit (__real__ x) ? M_PI : 0.0; @@ -40,7 +40,7 @@ __clog10 (__complex__ double x) /* Yes, the following line raises an exception. */ __real__ result = -1.0 / fabs (__real__ x); } - else if (__builtin_expect (rcls != FP_NAN && icls != FP_NAN, 1)) + else if (__glibc_likely (rcls != FP_NAN && icls != FP_NAN)) { /* Neither real nor imaginary part is NaN. */ double absx = fabs (__real__ x), absy = fabs (__imag__ x); diff --git a/math/s_clog10f.c b/math/s_clog10f.c index dc676b23fc..a9120e03f8 100644 --- a/math/s_clog10f.c +++ b/math/s_clog10f.c @@ -32,7 +32,7 @@ __clog10f (__complex__ float x) int rcls = fpclassify (__real__ x); int icls = fpclassify (__imag__ x); - if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0)) + if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO)) { /* Real and imaginary part are 0.0. */ __imag__ result = signbit (__real__ x) ? M_PI : 0.0; @@ -40,7 +40,7 @@ __clog10f (__complex__ float x) /* Yes, the following line raises an exception. */ __real__ result = -1.0 / fabsf (__real__ x); } - else if (__builtin_expect (rcls != FP_NAN && icls != FP_NAN, 1)) + else if (__glibc_likely (rcls != FP_NAN && icls != FP_NAN)) { /* Neither real nor imaginary part is NaN. */ float absx = fabsf (__real__ x), absy = fabsf (__imag__ x); diff --git a/math/s_clog10l.c b/math/s_clog10l.c index f7c3ec43a3..ac33a8f140 100644 --- a/math/s_clog10l.c +++ b/math/s_clog10l.c @@ -39,7 +39,7 @@ __clog10l (__complex__ long double x) int rcls = fpclassify (__real__ x); int icls = fpclassify (__imag__ x); - if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0)) + if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO)) { /* Real and imaginary part are 0.0. */ __imag__ result = signbit (__real__ x) ? M_PIl : 0.0; @@ -47,7 +47,7 @@ __clog10l (__complex__ long double x) /* Yes, the following line raises an exception. */ __real__ result = -1.0 / fabsl (__real__ x); } - else if (__builtin_expect (rcls != FP_NAN && icls != FP_NAN, 1)) + else if (__glibc_likely (rcls != FP_NAN && icls != FP_NAN)) { /* Neither real nor imaginary part is NaN. */ long double absx = fabsl (__real__ x), absy = fabsl (__imag__ x); diff --git a/math/s_clogf.c b/math/s_clogf.c index 73c2928116..79117df622 100644 --- a/math/s_clogf.c +++ b/math/s_clogf.c @@ -29,7 +29,7 @@ __clogf (__complex__ float x) int rcls = fpclassify (__real__ x); int icls = fpclassify (__imag__ x); - if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0)) + if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO)) { /* Real and imaginary part are 0.0. */ __imag__ result = signbit (__real__ x) ? M_PI : 0.0; @@ -37,7 +37,7 @@ __clogf (__complex__ float x) /* Yes, the following line raises an exception. */ __real__ result = -1.0 / fabsf (__real__ x); } - else if (__builtin_expect (rcls != FP_NAN && icls != FP_NAN, 1)) + else if (__glibc_likely (rcls != FP_NAN && icls != FP_NAN)) { /* Neither real nor imaginary part is NaN. */ float absx = fabsf (__real__ x), absy = fabsf (__imag__ x); diff --git a/math/s_clogl.c b/math/s_clogl.c index ec2ff84036..bdf82c155a 100644 --- a/math/s_clogl.c +++ b/math/s_clogl.c @@ -36,7 +36,7 @@ __clogl (__complex__ long double x) int rcls = fpclassify (__real__ x); int icls = fpclassify (__imag__ x); - if (__builtin_expect (rcls == FP_ZERO && icls == FP_ZERO, 0)) + if (__glibc_unlikely (rcls == FP_ZERO && icls == FP_ZERO)) { /* Real and imaginary part are 0.0. */ __imag__ result = signbit (__real__ x) ? M_PIl : 0.0; @@ -44,7 +44,7 @@ __clogl (__complex__ long double x) /* Yes, the following line raises an exception. */ __real__ result = -1.0 / fabsl (__real__ x); } - else if (__builtin_expect (rcls != FP_NAN && icls != FP_NAN, 1)) + else if (__glibc_likely (rcls != FP_NAN && icls != FP_NAN)) { /* Neither real nor imaginary part is NaN. */ long double absx = fabsl (__real__ x), absy = fabsl (__imag__ x); diff --git a/math/s_csin.c b/math/s_csin.c index 48a4a901ab..b4c8a1b2cf 100644 --- a/math/s_csin.c +++ b/math/s_csin.c @@ -33,16 +33,16 @@ __csin (__complex__ double x) __real__ x = fabs (__real__ x); - if (__builtin_expect (icls >= FP_ZERO, 1)) + if (__glibc_likely (icls >= FP_ZERO)) { /* Imaginary part is finite. */ - if (__builtin_expect (rcls >= FP_ZERO, 1)) + if (__glibc_likely (rcls >= FP_ZERO)) { /* Real part is finite. */ const int t = (int) ((DBL_MAX_EXP - 1) * M_LN2); double sinix, cosix; - if (__builtin_expect (rcls != FP_SUBNORMAL, 1)) + if (__glibc_likely (rcls != FP_SUBNORMAL)) { __sincos (__real__ x, &sinix, &cosix); } @@ -136,7 +136,7 @@ __csin (__complex__ double x) /* Real part is finite. */ double sinix, cosix; - if (__builtin_expect (rcls != FP_SUBNORMAL, 1)) + if (__glibc_likely (rcls != FP_SUBNORMAL)) { __sincos (__real__ x, &sinix, &cosix); } diff --git a/math/s_csinf.c b/math/s_csinf.c index 26c4bb0a2f..1faefd1df6 100644 --- a/math/s_csinf.c +++ b/math/s_csinf.c @@ -33,16 +33,16 @@ __csinf (__complex__ float x) __real__ x = fabsf (__real__ x); - if (__builtin_expect (icls >= FP_ZERO, 1)) + if (__glibc_likely (icls >= FP_ZERO)) { /* Imaginary part is finite. */ - if (__builtin_expect (rcls >= FP_ZERO, 1)) + if (__glibc_likely (rcls >= FP_ZERO)) { /* Real part is finite. */ const int t = (int) ((FLT_MAX_EXP - 1) * M_LN2); float sinix, cosix; - if (__builtin_expect (rcls != FP_SUBNORMAL, 1)) + if (__glibc_likely (rcls != FP_SUBNORMAL)) { __sincosf (__real__ x, &sinix, &cosix); } @@ -136,7 +136,7 @@ __csinf (__complex__ float x) /* Real part is finite. */ float sinix, cosix; - if (__builtin_expect (rcls != FP_SUBNORMAL, 1)) + if (__glibc_likely (rcls != FP_SUBNORMAL)) { __sincosf (__real__ x, &sinix, &cosix); } diff --git a/math/s_csinh.c b/math/s_csinh.c index 3fc737b493..428add6c85 100644 --- a/math/s_csinh.c +++ b/math/s_csinh.c @@ -33,16 +33,16 @@ __csinh (__complex__ double x) __real__ x = fabs (__real__ x); - if (__builtin_expect (rcls >= FP_ZERO, 1)) + if (__glibc_likely (rcls >= FP_ZERO)) { /* Real part is finite. */ - if (__builtin_expect (icls >= FP_ZERO, 1)) + if (__glibc_likely (icls >= FP_ZERO)) { /* Imaginary part is finite. */ const int t = (int) ((DBL_MAX_EXP - 1) * M_LN2); double sinix, cosix; - if (__builtin_expect (icls != FP_SUBNORMAL, 1)) + if (__glibc_likely (icls != FP_SUBNORMAL)) { __sincos (__imag__ x, &sinix, &cosix); } @@ -125,12 +125,12 @@ __csinh (__complex__ double x) else if (rcls == FP_INFINITE) { /* Real part is infinite. */ - if (__builtin_expect (icls > FP_ZERO, 1)) + if (__glibc_likely (icls > FP_ZERO)) { /* Imaginary part is finite. */ double sinix, cosix; - if (__builtin_expect (icls != FP_SUBNORMAL, 1)) + if (__glibc_likely (icls != FP_SUBNORMAL)) { __sincos (__imag__ x, &sinix, &cosix); } diff --git a/math/s_csinhf.c b/math/s_csinhf.c index 081c7592d6..d31f705a51 100644 --- a/math/s_csinhf.c +++ b/math/s_csinhf.c @@ -33,16 +33,16 @@ __csinhf (__complex__ float x) __real__ x = fabsf (__real__ x); - if (__builtin_expect (rcls >= FP_ZERO, 1)) + if (__glibc_likely (rcls >= FP_ZERO)) { /* Real part is finite. */ - if (__builtin_expect (icls >= FP_ZERO, 1)) + if (__glibc_likely (icls >= FP_ZERO)) { /* Imaginary part is finite. */ const int t = (int) ((FLT_MAX_EXP - 1) * M_LN2); float sinix, cosix; - if (__builtin_expect (icls != FP_SUBNORMAL, 1)) + if (__glibc_likely (icls != FP_SUBNORMAL)) { __sincosf (__imag__ x, &sinix, &cosix); } @@ -122,15 +122,15 @@ __csinhf (__complex__ float x) } } } - else if (__builtin_expect (rcls == FP_INFINITE, 1)) + else if (__glibc_likely (rcls == FP_INFINITE)) { /* Real part is infinite. */ - if (__builtin_expect (icls > FP_ZERO, 1)) + if (__glibc_likely (icls > FP_ZERO)) { /* Imaginary part is finite. */ float sinix, cosix; - if (__builtin_expect (icls != FP_SUBNORMAL, 1)) + if (__glibc_likely (icls != FP_SUBNORMAL)) { __sincosf (__imag__ x, &sinix, &cosix); } diff --git a/math/s_csinhl.c b/math/s_csinhl.c index 3c4ba0d617..c6e58f1a0d 100644 --- a/math/s_csinhl.c +++ b/math/s_csinhl.c @@ -33,16 +33,16 @@ __csinhl (__complex__ long double x) __real__ x = fabsl (__real__ x); - if (__builtin_expect (rcls >= FP_ZERO, 1)) + if (__glibc_likely (rcls >= FP_ZERO)) { /* Real part is finite. */ - if (__builtin_expect (icls >= FP_ZERO, 1)) + if (__glibc_likely (icls >= FP_ZERO)) { /* Imaginary part is finite. */ const int t = (int) ((LDBL_MAX_EXP - 1) * M_LN2l); long double sinix, cosix; - if (__builtin_expect (icls != FP_SUBNORMAL, 1)) + if (__glibc_likely (icls != FP_SUBNORMAL)) { __sincosl (__imag__ x, &sinix, &cosix); } @@ -122,15 +122,15 @@ __csinhl (__complex__ long double x) } } } - else if (__builtin_expect (rcls == FP_INFINITE, 1)) + else if (__glibc_likely (rcls == FP_INFINITE)) { /* Real part is infinite. */ - if (__builtin_expect (icls > FP_ZERO, 1)) + if (__glibc_likely (icls > FP_ZERO)) { /* Imaginary part is finite. */ long double sinix, cosix; - if (__builtin_expect (icls != FP_SUBNORMAL, 1)) + if (__glibc_likely (icls != FP_SUBNORMAL)) { __sincosl (__imag__ x, &sinix, &cosix); } diff --git a/math/s_csinl.c b/math/s_csinl.c index 5ae8969aac..a3316d3470 100644 --- a/math/s_csinl.c +++ b/math/s_csinl.c @@ -33,16 +33,16 @@ __csinl (__complex__ long double x) __real__ x = fabsl (__real__ x); - if (__builtin_expect (icls >= FP_ZERO, 1)) + if (__glibc_likely (icls >= FP_ZERO)) { /* Imaginary part is finite. */ - if (__builtin_expect (rcls >= FP_ZERO, 1)) + if (__glibc_likely (rcls >= FP_ZERO)) { /* Real part is finite. */ const int t = (int) ((LDBL_MAX_EXP - 1) * M_LN2l); long double sinix, cosix; - if (__builtin_expect (rcls != FP_SUBNORMAL, 1)) + if (__glibc_likely (rcls != FP_SUBNORMAL)) { __sincosl (__real__ x, &sinix, &cosix); } @@ -136,7 +136,7 @@ __csinl (__complex__ long double x) /* Real part is finite. */ long double sinix, cosix; - if (__builtin_expect (rcls != FP_SUBNORMAL, 1)) + if (__glibc_likely (rcls != FP_SUBNORMAL)) { __sincosl (__real__ x, &sinix, &cosix); } diff --git a/math/s_csqrt.c b/math/s_csqrt.c index 2bbd2b8adf..a19bb34a81 100644 --- a/math/s_csqrt.c +++ b/math/s_csqrt.c @@ -30,7 +30,7 @@ __csqrt (__complex__ double x) int rcls = fpclassify (__real__ x); int icls = fpclassify (__imag__ x); - if (__builtin_expect (rcls <= FP_INFINITE || icls <= FP_INFINITE, 0)) + if (__glibc_unlikely (rcls <= FP_INFINITE || icls <= FP_INFINITE)) { if (icls == FP_INFINITE) { @@ -59,7 +59,7 @@ __csqrt (__complex__ double x) } else { - if (__builtin_expect (icls == FP_ZERO, 0)) + if (__glibc_unlikely (icls == FP_ZERO)) { if (__real__ x < 0.0) { @@ -73,7 +73,7 @@ __csqrt (__complex__ double x) __imag__ res = __copysign (0.0, __imag__ x); } } - else if (__builtin_expect (rcls == FP_ZERO, 0)) + else if (__glibc_unlikely (rcls == FP_ZERO)) { double r; if (fabs (__imag__ x) >= 2.0 * DBL_MIN) diff --git a/math/s_csqrtf.c b/math/s_csqrtf.c index b2a11dec81..1c22df84c1 100644 --- a/math/s_csqrtf.c +++ b/math/s_csqrtf.c @@ -30,7 +30,7 @@ __csqrtf (__complex__ float x) int rcls = fpclassify (__real__ x); int icls = fpclassify (__imag__ x); - if (__builtin_expect (rcls <= FP_INFINITE || icls <= FP_INFINITE, 0)) + if (__glibc_unlikely (rcls <= FP_INFINITE || icls <= FP_INFINITE)) { if (icls == FP_INFINITE) { @@ -59,7 +59,7 @@ __csqrtf (__complex__ float x) } else { - if (__builtin_expect (icls == FP_ZERO, 0)) + if (__glibc_unlikely (icls == FP_ZERO)) { if (__real__ x < 0.0) { @@ -73,7 +73,7 @@ __csqrtf (__complex__ float x) __imag__ res = __copysignf (0.0, __imag__ x); } } - else if (__builtin_expect (rcls == FP_ZERO, 0)) + else if (__glibc_unlikely (rcls == FP_ZERO)) { float r; if (fabsf (__imag__ x) >= 2.0f * FLT_MIN) diff --git a/math/s_csqrtl.c b/math/s_csqrtl.c index a72bac1835..2dab3dbaab 100644 --- a/math/s_csqrtl.c +++ b/math/s_csqrtl.c @@ -30,7 +30,7 @@ __csqrtl (__complex__ long double x) int rcls = fpclassify (__real__ x); int icls = fpclassify (__imag__ x); - if (__builtin_expect (rcls <= FP_INFINITE || icls <= FP_INFINITE, 0)) + if (__glibc_unlikely (rcls <= FP_INFINITE || icls <= FP_INFINITE)) { if (icls == FP_INFINITE) { @@ -59,7 +59,7 @@ __csqrtl (__complex__ long double x) } else { - if (__builtin_expect (icls == FP_ZERO, 0)) + if (__glibc_unlikely (icls == FP_ZERO)) { if (__real__ x < 0.0) { @@ -73,7 +73,7 @@ __csqrtl (__complex__ long double x) __imag__ res = __copysignl (0.0, __imag__ x); } } - else if (__builtin_expect (rcls == FP_ZERO, 0)) + else if (__glibc_unlikely (rcls == FP_ZERO)) { long double r; if (fabsl (__imag__ x) >= 2.0L * LDBL_MIN) diff --git a/math/s_ctan.c b/math/s_ctan.c index 6fed4fe465..407ff5a7fc 100644 --- a/math/s_ctan.c +++ b/math/s_ctan.c @@ -28,7 +28,7 @@ __ctan (__complex__ double x) { __complex__ double res; - if (__builtin_expect (!isfinite (__real__ x) || !isfinite (__imag__ x), 0)) + if (__glibc_unlikely (!isfinite (__real__ x) || !isfinite (__imag__ x))) { if (__isinf_ns (__imag__ x)) { @@ -58,7 +58,7 @@ __ctan (__complex__ double x) /* tan(x+iy) = (sin(2x) + i*sinh(2y))/(cos(2x) + cosh(2y)) = (sin(x)*cos(x) + i*sinh(y)*cosh(y)/(cos(x)^2 + sinh(y)^2). */ - if (__builtin_expect (rcls != FP_SUBNORMAL, 1)) + if (__glibc_likely (rcls != FP_SUBNORMAL)) { __sincos (__real__ x, &sinrx, &cosrx); } diff --git a/math/s_ctanf.c b/math/s_ctanf.c index a2343dd54e..e6f345a231 100644 --- a/math/s_ctanf.c +++ b/math/s_ctanf.c @@ -28,7 +28,7 @@ __ctanf (__complex__ float x) { __complex__ float res; - if (__builtin_expect (!isfinite (__real__ x) || !isfinite (__imag__ x), 0)) + if (__glibc_unlikely (!isfinite (__real__ x) || !isfinite (__imag__ x))) { if (__isinf_nsf (__imag__ x)) { @@ -57,7 +57,7 @@ __ctanf (__complex__ float x) /* tan(x+iy) = (sin(2x) + i*sinh(2y))/(cos(2x) + cosh(2y)) = (sin(x)*cos(x) + i*sinh(y)*cosh(y)/(cos(x)^2 + sinh(y)^2). */ - if (__builtin_expect (fpclassify(__real__ x) != FP_SUBNORMAL, 1)) + if (__glibc_likely (fpclassify(__real__ x) != FP_SUBNORMAL)) { __sincosf (__real__ x, &sinrx, &cosrx); } diff --git a/math/s_ctanh.c b/math/s_ctanh.c index 0ca35e0990..be3e47e45f 100644 --- a/math/s_ctanh.c +++ b/math/s_ctanh.c @@ -28,7 +28,7 @@ __ctanh (__complex__ double x) { __complex__ double res; - if (__builtin_expect (!isfinite (__real__ x) || !isfinite (__imag__ x), 0)) + if (__glibc_unlikely (!isfinite (__real__ x) || !isfinite (__imag__ x))) { if (__isinf_ns (__real__ x)) { @@ -58,7 +58,7 @@ __ctanh (__complex__ double x) /* tanh(x+iy) = (sinh(2x) + i*sin(2y))/(cosh(2x) + cos(2y)) = (sinh(x)*cosh(x) + i*sin(y)*cos(y))/(sinh(x)^2 + cos(y)^2). */ - if (__builtin_expect (icls != FP_SUBNORMAL, 1)) + if (__glibc_likely (icls != FP_SUBNORMAL)) { __sincos (__imag__ x, &sinix, &cosix); } diff --git a/math/s_ctanhf.c b/math/s_ctanhf.c index 8938d70186..39a335ef2d 100644 --- a/math/s_ctanhf.c +++ b/math/s_ctanhf.c @@ -28,7 +28,7 @@ __ctanhf (__complex__ float x) { __complex__ float res; - if (__builtin_expect (!isfinite (__real__ x) || !isfinite (__imag__ x), 0)) + if (__glibc_unlikely (!isfinite (__real__ x) || !isfinite (__imag__ x))) { if (__isinf_nsf (__real__ x)) { @@ -57,7 +57,7 @@ __ctanhf (__complex__ float x) /* tanh(x+iy) = (sinh(2x) + i*sin(2y))/(cosh(2x) + cos(2y)) = (sinh(x)*cosh(x) + i*sin(y)*cos(y))/(sinh(x)^2 + cos(y)^2). */ - if (__builtin_expect (fpclassify(__imag__ x) != FP_SUBNORMAL, 1)) + if (__glibc_likely (fpclassify(__imag__ x) != FP_SUBNORMAL)) { __sincosf (__imag__ x, &sinix, &cosix); } diff --git a/math/s_ctanhl.c b/math/s_ctanhl.c index 098e009184..64e448baa8 100644 --- a/math/s_ctanhl.c +++ b/math/s_ctanhl.c @@ -28,7 +28,7 @@ __ctanhl (__complex__ long double x) { __complex__ long double res; - if (__builtin_expect (!isfinite (__real__ x) || !isfinite (__imag__ x), 0)) + if (__glibc_unlikely (!isfinite (__real__ x) || !isfinite (__imag__ x))) { if (__isinf_nsl (__real__ x)) { @@ -58,7 +58,7 @@ __ctanhl (__complex__ long double x) /* tanh(x+iy) = (sinh(2x) + i*sin(2y))/(cosh(2x) + cos(2y)) = (sinh(x)*cosh(x) + i*sin(y)*cos(y))/(sinh(x)^2 + cos(y)^2). */ - if (__builtin_expect (icls != FP_SUBNORMAL, 1)) + if (__glibc_likely (icls != FP_SUBNORMAL)) { __sincosl (__imag__ x, &sinix, &cosix); } diff --git a/math/s_ctanl.c b/math/s_ctanl.c index 98fdac0c8d..282febdd89 100644 --- a/math/s_ctanl.c +++ b/math/s_ctanl.c @@ -28,7 +28,7 @@ __ctanl (__complex__ long double x) { __complex__ long double res; - if (__builtin_expect (!isfinite (__real__ x) || !isfinite (__imag__ x), 0)) + if (__glibc_unlikely (!isfinite (__real__ x) || !isfinite (__imag__ x))) { if (__isinf_nsl (__imag__ x)) { @@ -58,7 +58,7 @@ __ctanl (__complex__ long double x) /* tan(x+iy) = (sin(2x) + i*sinh(2y))/(cos(2x) + cosh(2y)) = (sin(x)*cos(x) + i*sinh(y)*cosh(y)/(cos(x)^2 + sinh(y)^2). */ - if (__builtin_expect (rcls != FP_SUBNORMAL, 1)) + if (__glibc_likely (rcls != FP_SUBNORMAL)) { __sincosl (__real__ x, &sinrx, &cosrx); } diff --git a/math/w_pow.c b/math/w_pow.c index 713d7a8719..26790b91d8 100644 --- a/math/w_pow.c +++ b/math/w_pow.c @@ -25,7 +25,7 @@ double __pow (double x, double y) { double z = __ieee754_pow (x, y); - if (__builtin_expect (!__finite (z), 0)) + if (__glibc_unlikely (!__finite (z))) { if (_LIB_VERSION != _IEEE_) { diff --git a/math/w_powf.c b/math/w_powf.c index 1ba22c0560..fa9e0071c8 100644 --- a/math/w_powf.c +++ b/math/w_powf.c @@ -25,7 +25,7 @@ float __powf (float x, float y) { float z = __ieee754_powf (x, y); - if (__builtin_expect (!__finitef (z), 0)) + if (__glibc_unlikely (!__finitef (z))) { if (_LIB_VERSION != _IEEE_) { diff --git a/math/w_powl.c b/math/w_powl.c index eba9202f23..7c8d9f8ba4 100644 --- a/math/w_powl.c +++ b/math/w_powl.c @@ -25,7 +25,7 @@ long double __powl (long double x, long double y) { long double z = __ieee754_powl (x, y); - if (__builtin_expect (!__finitel (z), 0)) + if (__glibc_unlikely (!__finitel (z))) { if (_LIB_VERSION != _IEEE_) { diff --git a/math/w_scalb.c b/math/w_scalb.c index 21b0c792d3..dbfefaf9d5 100644 --- a/math/w_scalb.c +++ b/math/w_scalb.c @@ -27,7 +27,7 @@ sysv_scalb (double x, double fn) { double z = __ieee754_scalb (x, fn); - if (__builtin_expect (__isinf (z), 0)) + if (__glibc_unlikely (__isinf (z))) { if (__finite (x)) return __kernel_standard (x, fn, 32); /* scalb overflow */ diff --git a/math/w_scalbf.c b/math/w_scalbf.c index c23e35ba34..244fd1e91b 100644 --- a/math/w_scalbf.c +++ b/math/w_scalbf.c @@ -27,7 +27,7 @@ sysv_scalbf (float x, float fn) { float z = __ieee754_scalbf (x, fn); - if (__builtin_expect (__isinff (z), 0)) + if (__glibc_unlikely (__isinff (z))) { if (__finitef (x)) return __kernel_standard_f (x, fn, 132); /* scalb overflow */ diff --git a/math/w_scalbl.c b/math/w_scalbl.c index 4252af3bf8..cffaa67cc7 100644 --- a/math/w_scalbl.c +++ b/math/w_scalbl.c @@ -27,7 +27,7 @@ sysv_scalbl (long double x, long double fn) { long double z = __ieee754_scalbl (x, fn); - if (__builtin_expect (__isinfl (z), 0)) + if (__glibc_unlikely (__isinfl (z))) { if (__finitel (x)) return __kernel_standard_l (x, fn, 232); /* scalb overflow */ |