diff options
author | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-28 13:42:32 +0000 |
---|---|---|
committer | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-28 13:42:32 +0000 |
commit | 857dd6a4fa24bd5f15495035a49857a19ce662d4 (patch) | |
tree | 5dacc7e99e9bdb5f215dbbbd1c7c76f00f4c3684 | |
parent | 2a33161dade1a9b493ed07265861620dc3c82c94 (diff) | |
download | gcc-857dd6a4fa24bd5f15495035a49857a19ce662d4.tar.gz |
* config/fp-bit.c (isnan, isinf, pack_d, unpack_d): Use
__builtin_expect.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@107603 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/fp-bit.c | 12 |
2 files changed, 12 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2320e10de95..1dd5299619c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2005-11-28 Joseph S. Myers <joseph@codesourcery.com> + * config/fp-bit.c (isnan, isinf, pack_d, unpack_d): Use + __builtin_expect. + +2005-11-28 Joseph S. Myers <joseph@codesourcery.com> + * config/fp-bit.h (LSHIFT): Take shift count parameter. * config/fp-bit.c (_fpadd_parts): Shift in one go instead of one bit at a time. diff --git a/gcc/config/fp-bit.c b/gcc/config/fp-bit.c index cf943daed91..ef7437dfc62 100644 --- a/gcc/config/fp-bit.c +++ b/gcc/config/fp-bit.c @@ -160,14 +160,15 @@ INLINE static int isnan ( fp_number_type * x) { - return x->class == CLASS_SNAN || x->class == CLASS_QNAN; + return __builtin_expect (x->class == CLASS_SNAN || x->class == CLASS_QNAN, + 0); } INLINE static int isinf ( fp_number_type * x) { - return x->class == CLASS_INFINITY; + return __builtin_expect (x->class == CLASS_INFINITY, 0); } #endif /* NO_NANS */ @@ -249,7 +250,7 @@ pack_d ( fp_number_type * src) } else { - if (src->normal_exp < NORMAL_EXPMIN) + if (__builtin_expect (src->normal_exp < NORMAL_EXPMIN, 0)) { #ifdef NO_DENORMALS /* Go straight to a zero representation if denormals are not @@ -296,7 +297,7 @@ pack_d ( fp_number_type * src) #endif /* NO_DENORMALS */ } else if (!LARGEST_EXPONENT_IS_NORMAL (FRAC_NBITS) - && src->normal_exp > EXPBIAS) + && __builtin_expect (src->normal_exp > EXPBIAS, 0)) { exp = EXPMAX; fraction = 0; @@ -560,7 +561,8 @@ unpack_d (FLO_union_type * src, fp_number_type * dst) dst->fraction.ll = fraction; } } - else if (!LARGEST_EXPONENT_IS_NORMAL (FRAC_NBITS) && exp == EXPMAX) + else if (!LARGEST_EXPONENT_IS_NORMAL (FRAC_NBITS) + && __builtin_expect (exp == EXPMAX, 0)) { /* Huge exponent*/ if (fraction == 0) |