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 /sysdeps/ieee754/dbl-64/wordsize-64 | |
parent | 1448f3244714a9dabb5240ec18b094f100887d5c (diff) | |
download | glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.tar.gz glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.tar.xz glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.zip |
Use glibc_likely instead __builtin_expect.
Diffstat (limited to 'sysdeps/ieee754/dbl-64/wordsize-64')
-rw-r--r-- | sysdeps/ieee754/dbl-64/wordsize-64/e_acosh.c | 6 | ||||
-rw-r--r-- | sysdeps/ieee754/dbl-64/wordsize-64/e_log10.c | 6 | ||||
-rw-r--r-- | sysdeps/ieee754/dbl-64/wordsize-64/e_log2.c | 6 | ||||
-rw-r--r-- | sysdeps/ieee754/dbl-64/wordsize-64/s_frexp.c | 4 | ||||
-rw-r--r-- | sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c | 2 | ||||
-rw-r--r-- | sysdeps/ieee754/dbl-64/wordsize-64/s_remquo.c | 4 | ||||
-rw-r--r-- | sysdeps/ieee754/dbl-64/wordsize-64/s_round.c | 2 |
7 files changed, 15 insertions, 15 deletions
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/e_acosh.c b/sysdeps/ieee754/dbl-64/wordsize-64/e_acosh.c index 26268f2498..ccccdaf106 100644 --- a/sysdeps/ieee754/dbl-64/wordsize-64/e_acosh.c +++ b/sysdeps/ieee754/dbl-64/wordsize-64/e_acosh.c @@ -39,7 +39,7 @@ __ieee754_acosh (double x) if (hx > INT64_C (0x4000000000000000)) { - if (__builtin_expect (hx >= INT64_C (0x41b0000000000000), 0)) + if (__glibc_unlikely (hx >= INT64_C (0x41b0000000000000))) { /* x > 2**28 */ if (hx >= INT64_C (0x7ff0000000000000)) @@ -53,13 +53,13 @@ __ieee754_acosh (double x) double t = x * x; return __ieee754_log (2.0 * x - one / (x + __ieee754_sqrt (t - one))); } - else if (__builtin_expect (hx > INT64_C (0x3ff0000000000000), 1)) + else if (__glibc_likely (hx > INT64_C (0x3ff0000000000000))) { /* 1<x<2 */ double t = x - one; return __log1p (t + __ieee754_sqrt (2.0 * t + t * t)); } - else if (__builtin_expect (hx == INT64_C (0x3ff0000000000000), 1)) + else if (__glibc_likely (hx == INT64_C (0x3ff0000000000000))) return 0.0; /* acosh(1) = 0 */ else /* x < 1 */ return (x - x) / (x - x); diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/e_log10.c b/sysdeps/ieee754/dbl-64/wordsize-64/e_log10.c index dcb7b58a1b..4f5a81669e 100644 --- a/sysdeps/ieee754/dbl-64/wordsize-64/e_log10.c +++ b/sysdeps/ieee754/dbl-64/wordsize-64/e_log10.c @@ -64,16 +64,16 @@ __ieee754_log10 (double x) k = 0; if (hx < INT64_C(0x0010000000000000)) { /* x < 2**-1022 */ - if (__builtin_expect ((hx & UINT64_C(0x7fffffffffffffff)) == 0, 0)) + if (__glibc_unlikely ((hx & UINT64_C(0x7fffffffffffffff)) == 0)) return -two54 / (x - x); /* log(+-0)=-inf */ - if (__builtin_expect (hx < 0, 0)) + if (__glibc_unlikely (hx < 0)) return (x - x) / (x - x); /* log(-#) = NaN */ k -= 54; x *= two54; /* subnormal number, scale up x */ EXTRACT_WORDS64 (hx, x); } /* scale up resulted in a NaN number */ - if (__builtin_expect (hx >= UINT64_C(0x7ff0000000000000), 0)) + if (__glibc_unlikely (hx >= UINT64_C(0x7ff0000000000000))) return x + x; k += (hx >> 52) - 1023; i = ((uint64_t) k & UINT64_C(0x8000000000000000)) >> 63; diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/e_log2.c b/sysdeps/ieee754/dbl-64/wordsize-64/e_log2.c index 6dc7b7d217..5ccb78cf03 100644 --- a/sysdeps/ieee754/dbl-64/wordsize-64/e_log2.c +++ b/sysdeps/ieee754/dbl-64/wordsize-64/e_log2.c @@ -80,15 +80,15 @@ __ieee754_log2 (double x) k = 0; if (hx < INT64_C(0x0010000000000000)) { /* x < 2**-1022 */ - if (__builtin_expect ((hx & UINT64_C(0x7fffffffffffffff)) == 0, 0)) + if (__glibc_unlikely ((hx & UINT64_C(0x7fffffffffffffff)) == 0)) return -two54 / (x - x); /* log(+-0)=-inf */ - if (__builtin_expect (hx < 0, 0)) + if (__glibc_unlikely (hx < 0)) return (x - x) / (x - x); /* log(-#) = NaN */ k -= 54; x *= two54; /* subnormal number, scale up x */ EXTRACT_WORDS64 (hx, x); } - if (__builtin_expect (hx >= UINT64_C(0x7ff0000000000000), 0)) + if (__glibc_unlikely (hx >= UINT64_C(0x7ff0000000000000))) return x + x; k += (hx >> 52) - 1023; hx &= UINT64_C(0x000fffffffffffff); diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_frexp.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_frexp.c index d03e33ee1f..f2d980d9e0 100644 --- a/sysdeps/ieee754/dbl-64/wordsize-64/s_frexp.c +++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_frexp.c @@ -39,11 +39,11 @@ __frexp (double x, int *eptr) int32_t ex = 0x7ff & (ix >> 52); int e = 0; - if (__builtin_expect (ex != 0x7ff && x != 0.0, 1)) + if (__glibc_likely (ex != 0x7ff && x != 0.0)) { /* Not zero and finite. */ e = ex - 1022; - if (__builtin_expect (ex == 0, 0)) + if (__glibc_unlikely (ex == 0)) { /* Subnormal. */ x *= 0x1p54; diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c index e51c849592..1970ce922e 100644 --- a/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c +++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c @@ -34,7 +34,7 @@ __logb (double x) ex = ix >> 52; if (ex == 0x7ff) return x * x; - if (__builtin_expect (ex == 0, 0)) + if (__glibc_unlikely (ex == 0)) { int m = __builtin_clzll (ix); ex -= m - 12; diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_remquo.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_remquo.c index b22503f5c7..06b9242a86 100644 --- a/sysdeps/ieee754/dbl-64/wordsize-64/s_remquo.c +++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_remquo.c @@ -40,7 +40,7 @@ __remquo (double x, double y, int *quo) hx &= UINT64_C(0x7fffffffffffffff); /* Purge off exception values. */ - if (__builtin_expect (hy == 0, 0)) + if (__glibc_unlikely (hy == 0)) return (x * y) / (x * y); /* y = 0 */ if (__builtin_expect (hx >= UINT64_C(0x7ff0000000000000) /* x not finite */ || hy > UINT64_C(0x7ff0000000000000), 0))/* y is NaN */ @@ -49,7 +49,7 @@ __remquo (double x, double y, int *quo) if (hy <= UINT64_C(0x7fbfffffffffffff)) x = __ieee754_fmod (x, 8 * y); /* now x < 8y */ - if (__builtin_expect (hx == hy, 0)) + if (__glibc_unlikely (hx == hy)) { *quo = qs ? -1 : 1; return zero * x; diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_round.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_round.c index 684858c065..8b86b81b00 100644 --- a/sysdeps/ieee754/dbl-64/wordsize-64/s_round.c +++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_round.c @@ -32,7 +32,7 @@ __round (double x) EXTRACT_WORDS64 (i0, x); j0 = ((i0 >> 52) & 0x7ff) - 0x3ff; - if (__builtin_expect (j0 < 52, 1)) + if (__glibc_likely (j0 < 52)) { if (j0 < 0) { |