]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Eliminate redundant sign extensions in pow()
authorAnton Blanchard <anton@samba.org>
Mon, 4 Jan 2016 15:28:52 +0000 (13:28 -0200)
committerTulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
Mon, 4 Jan 2016 16:55:38 +0000 (14:55 -0200)
When looking at the code generated for pow() on ppc64 I noticed quite
a few sign extensions. Making the array indices unsigned reduces the
number of sign extensions from 24 to 7.

Tested for powerpc64le and x86_64.

ChangeLog
sysdeps/ieee754/dbl-64/e_pow.c

index bea73e358247be3a68c93f53eaede9fab0823aff..de8a1bcb656e550bc250291f1e1e22534409a390 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-01-04  Anton Blanchard  <anton@samba.org>
+
+       * sysdeps/ieee754/dbl-64/e_pow.c (log1): Use unsigned int
+       for array indices.
+       * sysdeps/ieee754/dbl-64/e_pow.c (my_log2): Likewise.
+
 2016-01-04  Joseph Myers  <joseph@codesourcery.com>
 
        * NEWS: Update copyright dates.
index 2ff2bb6e5698b01cfd08c929394d056a55aaf4fd..663fa392c29bba640ad9ac87d1964976dee846a9 100644 (file)
@@ -245,7 +245,8 @@ static double
 SECTION
 log1 (double x, double *delta, double *error)
 {
-  int i, j, m;
+  unsigned int i, j;
+  int m;
   double uu, vv, eps, nx, e, e1, e2, t, t1, t2, res, add = 0;
   mynumber u, v;
 #ifdef BIG_ENDI
@@ -344,7 +345,8 @@ static double
 SECTION
 my_log2 (double x, double *delta, double *error)
 {
-  int i, j, m;
+  unsigned int i, j;
+  int m;
   double uu, vv, eps, nx, e, e1, e2, t, t1, t2, res, add = 0;
   double ou1, ou2, lu1, lu2, ov, lv1, lv2, a, a1, a2;
   double y, yy, z, zz, j1, j2, j7, j8;