This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch, master, updated. glibc-2.14-386-g99ce7b0


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  99ce7b04edf17821a6abd19844f10e8c1cd3c724 (commit)
      from  1004d1821ea9093f6b75e68047dc0b3d093578f7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=99ce7b04edf17821a6abd19844f10e8c1cd3c724

commit 99ce7b04edf17821a6abd19844f10e8c1cd3c724
Author: Ulrich Drepper <drepper@gmail.com>
Date:   Mon Oct 17 23:16:34 2011 -0400

    Small optimization of generic exp2

diff --git a/ChangeLog b/ChangeLog
index c47826c..ad7db01 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2011-10-17  Ulrich Drepper  <drepper@gmail.com>
 
+	* sysdeps/ieee754/dbl-64/e_exp2.c (__ieee754_exp2): Small optimization.
+
 	* sysdeps/ieee754/dbl-64/wordsize-64/s_frexp.c: New file.
 
 	* sysdeps/x86_64/fpu/math_private.h: Relax asm requirements for
diff --git a/sysdeps/ieee754/dbl-64/e_exp2.c b/sysdeps/ieee754/dbl-64/e_exp2.c
index 674cdb0..c973f35 100644
--- a/sysdeps/ieee754/dbl-64/e_exp2.c
+++ b/sysdeps/ieee754/dbl-64/e_exp2.c
@@ -53,8 +53,19 @@ __ieee754_exp2 (double x)
   static const double lomark = (double) (DBL_MIN_EXP - DBL_MANT_DIG - 1);
 
   /* Check for usual case.  */
-  if (isless (x, himark) && isgreaterequal (x, lomark))
+  if (__builtin_expect (isless (x, himark), 1))
     {
+      /* Exceptional cases:  */
+      if (__builtin_expect (! isgreaterequal (x, lomark), 0))
+	{
+	  if (__isinf (x))
+	    /* e^-inf == 0, with no error.  */
+	    return 0;
+	  else
+	    /* Underflow */
+	    return TWOM1000 * TWOM1000;
+	}
+
       static const double THREEp42 = 13194139533312.0;
       int tval, unsafe;
       double rx, x22, result;
@@ -120,16 +131,6 @@ __ieee754_exp2 (double x)
       else
 	return result * scale_u.d;
     }
-  /* Exceptional cases:  */
-  else if (isless (x, himark))
-    {
-      if (__isinf (x))
-	/* e^-inf == 0, with no error.  */
-	return 0;
-      else
-	/* Underflow */
-	return TWOM1000 * TWOM1000;
-    }
   else
     /* Return x, if x is a NaN or Inf; or overflow, otherwise.  */
     return TWO1023*x;

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                       |    2 ++
 sysdeps/ieee754/dbl-64/e_exp2.c |   23 ++++++++++++-----------
 2 files changed, 14 insertions(+), 11 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]