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.17-235-g4709fe7


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  4709fe7602b56e9f6ee1ab6afb4067409a784f29 (commit)
      from  2d0e0f29f85036d1189231cb7c1f19f27ba14a89 (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=4709fe7602b56e9f6ee1ab6afb4067409a784f29

commit 4709fe7602b56e9f6ee1ab6afb4067409a784f29
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Sat Feb 16 00:09:29 2013 +0530

    Use intermediate variable to compute exponent in __mul

diff --git a/ChangeLog b/ChangeLog
index 012fce4..607433b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,8 @@
-2013-02-15  Siddhesh Poyarekar  <siddhesh@redhat.com>
+2013-02-16  Siddhesh Poyarekar  <siddhesh@redhat.com>
+
+	* sysdeps/ieee754/dbl-64/mpa.c (__mul): Use intermediate
+	variable to calculate EZ.
+	(__sqr): Likewise.
 
 	* sysdeps/ieee754/dbl-64/mpa.c (__mul): Fix determination of
 	the lower precision input.
diff --git a/sysdeps/ieee754/dbl-64/mpa.c b/sysdeps/ieee754/dbl-64/mpa.c
index 25f52f6..9da4257 100644
--- a/sysdeps/ieee754/dbl-64/mpa.c
+++ b/sysdeps/ieee754/dbl-64/mpa.c
@@ -693,15 +693,20 @@ __mul (const mp_no *x, const mp_no *y, mp_no *z, int p)
     }
   Z[k] = zk;
 
-  EZ = EX + EY;
+  /* Get the exponent sum into an intermediate variable.  This is a subtle
+     optimization, where given enough registers, all operations on the exponent
+     happen in registers and the result is written out only once into EZ.  */
+  int e = EX + EY;
+
   /* Is there a carry beyond the most significant digit?  */
   if (__glibc_unlikely (Z[1] == ZERO))
     {
       for (i = 1; i <= p; i++)
 	Z[i] = Z[i + 1];
-      EZ--;
+      e--;
     }
 
+  EZ = e;
   Z[0] = X[0] * Y[0];
 }
 
@@ -786,14 +791,20 @@ __sqr (const mp_no *x, mp_no *y, int p)
   /* Squares are always positive.  */
   Y[0] = 1.0;
 
-  EY = 2 * EX;
+  /* Get the exponent sum into an intermediate variable.  This is a subtle
+     optimization, where given enough registers, all operations on the exponent
+     happen in registers and the result is written out only once into EZ.  */
+  int e = EX * 2;
+
   /* Is there a carry beyond the most significant digit?  */
   if (__glibc_unlikely (Y[1] == ZERO))
     {
       for (i = 1; i <= p; i++)
 	Y[i] = Y[i + 1];
-      EY--;
+      e--;
     }
+
+  EY = e;
 }
 
 /* Invert *X and store in *Y.  Relative error bound:

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

Summary of changes:
 ChangeLog                    |    6 +++++-
 sysdeps/ieee754/dbl-64/mpa.c |   19 +++++++++++++++----
 2 files changed, 20 insertions(+), 5 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]