aboutsummaryrefslogtreecommitdiff
path: root/math
diff options
context:
space:
mode:
authorOndřej Bílka <neleai@seznam.cz>2014-02-10 14:45:42 +0100
committerOndřej Bílka <neleai@seznam.cz>2014-02-10 15:07:12 +0100
commita1ffb40e32741f992c743e7b16c061fefa3747ac (patch)
tree246a29a87b26cfd5d07b17070f85eb3785018de9 /math
parent1448f3244714a9dabb5240ec18b094f100887d5c (diff)
downloadglibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.tar.xz
glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.zip
Use glibc_likely instead __builtin_expect.
Diffstat (limited to 'math')
-rw-r--r--math/e_exp2l.c2
-rw-r--r--math/e_scalb.c6
-rw-r--r--math/e_scalbf.c6
-rw-r--r--math/e_scalbl.c6
-rw-r--r--math/s_catan.c4
-rw-r--r--math/s_catanf.c4
-rw-r--r--math/s_catanh.c4
-rw-r--r--math/s_catanhf.c4
-rw-r--r--math/s_catanhl.c4
-rw-r--r--math/s_catanl.c4
-rw-r--r--math/s_ccosh.c10
-rw-r--r--math/s_ccoshf.c12
-rw-r--r--math/s_ccoshl.c12
-rw-r--r--math/s_cexp.c12
-rw-r--r--math/s_cexpf.c12
-rw-r--r--math/s_cexpl.c12
-rw-r--r--math/s_clog.c4
-rw-r--r--math/s_clog10.c4
-rw-r--r--math/s_clog10f.c4
-rw-r--r--math/s_clog10l.c4
-rw-r--r--math/s_clogf.c4
-rw-r--r--math/s_clogl.c4
-rw-r--r--math/s_csin.c8
-rw-r--r--math/s_csinf.c8
-rw-r--r--math/s_csinh.c10
-rw-r--r--math/s_csinhf.c12
-rw-r--r--math/s_csinhl.c12
-rw-r--r--math/s_csinl.c8
-rw-r--r--math/s_csqrt.c6
-rw-r--r--math/s_csqrtf.c6
-rw-r--r--math/s_csqrtl.c6
-rw-r--r--math/s_ctan.c4
-rw-r--r--math/s_ctanf.c4
-rw-r--r--math/s_ctanh.c4
-rw-r--r--math/s_ctanhf.c4
-rw-r--r--math/s_ctanhl.c4
-rw-r--r--math/s_ctanl.c4
-rw-r--r--math/w_pow.c2
-rw-r--r--math/w_powf.c2
-rw-r--r--math/w_powl.c2
-rw-r--r--math/w_scalb.c2
-rw-r--r--math/w_scalbf.c2
-rw-r--r--math/w_scalbl.c2
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))<