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.zip glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.tar.gz glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.tar.bz2 |
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 0bea772..c0edfbe 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 487f441..bddedfa 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 68e6c5f..319752c 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 256e7b1..5815a0d 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 87cdd31..d6552d8 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 80a3474..41e419d 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 0c8b268..2ba1298 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 ebb7b82..0ee69a5 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 d45f1d1..537bb3e 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 32a4424..cea9282 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 3ee40b1..a3b9327 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 4a9e94d..084fc6d 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 bb79aad..e958c49 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 dcb3228..a636e35 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 8bfc7e2..d0cdf79 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 bd5572d..3b64fd1 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 e2b5846..8639868 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 0274db3..417d561 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 dc676b2..a9120e0 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 f7c3ec4..ac33a8f 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 73c2928..79117df 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 ec2ff84..bdf82c1 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 48a4a90..b4c8a1b 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 26c4bb0..1faefd1 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 3fc737b..428add6 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 081c759..d31f705 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 3c4ba0d..c6e58f1 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 5ae8969..a3316d3 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 2bbd2b8..a19bb34 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 b2a11de..1c22df8 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 a72bac1..2dab3db 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 6fed4fe..407ff5a 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 a2343dd..e6f345a 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 0ca35e0..be3e47e 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 8938d70..39a335e 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 098e009..64e448b 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 98fdac0..282febd 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 713d7a8..26790b9 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 1ba22c0..fa9e007 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 eba9202..7c8d9f8 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 21b0c79..dbfefaf 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 c23e35b..244fd1e 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 4252af3..cffaa67 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 */ |