GNU C Library master sources branch master updated. glibc-2.22-535-gb7665e5

siddhesh@sourceware.org siddhesh@sourceware.org
Tue Nov 17 11:15:00 GMT 2015


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  b7665e51633b98c316f0f8ffccc3278d6b10d14d (commit)
       via  4916acd87b22351c9d77babf5be71fb8c53d67bd (commit)
      from  b43e85786f6a6954c3d750aa2914b6ceecade378 (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://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b7665e51633b98c316f0f8ffccc3278d6b10d14d

commit b7665e51633b98c316f0f8ffccc3278d6b10d14d
Author: Siddhesh Poyarekar <siddhesh.poyarekar@linaro.org>
Date:   Tue Nov 17 16:03:11 2015 +0530

    Remove redundant else clauses in s_sin.c
    
    Makes the code easier to read due to the reduced nesting.  The
    generated binary is unchanged.

diff --git a/ChangeLog b/ChangeLog
index 2d53b2b..1d223b3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2015-11-17  Siddhesh Poyarekar  <siddhesh.poyarekar@linaro.org>
 
+	* sysdeps/ieee754/dbl-64/s_sin.c: Remove redundant else clauses.
+
 	* benchtests/scripts/bench.py (_print_arg_data): Mark output variables
 	as used.
 
diff --git a/sysdeps/ieee754/dbl-64/s_sin.c b/sysdeps/ieee754/dbl-64/s_sin.c
index 48c924c..b8d49e2 100644
--- a/sysdeps/ieee754/dbl-64/s_sin.c
+++ b/sysdeps/ieee754/dbl-64/s_sin.c
@@ -744,14 +744,12 @@ slow (double x)
   res = TAYLOR_SLOW (x, 0, cor);
   if (res == res + 1.0007 * cor)
     return res;
-  else
-    {
-      __dubsin (fabs (x), 0, w);
-      if (w[0] == w[0] + 1.000000001 * w[1])
-	return (x > 0) ? w[0] : -w[0];
-      else
-	return (x > 0) ? __mpsin (x, 0, false) : -__mpsin (-x, 0, false);
-    }
+
+  __dubsin (fabs (x), 0, w);
+  if (w[0] == w[0] + 1.000000001 * w[1])
+    return (x > 0) ? w[0] : -w[0];
+
+  return (x > 0) ? __mpsin (x, 0, false) : -__mpsin (-x, 0, false);
 }
 
 /*******************************************************************************/
@@ -771,14 +769,12 @@ slow1 (double x)
   res = do_sin_slow (u, y, 0, 0, &cor);
   if (res == res + cor)
     return (x > 0) ? res : -res;
-  else
-    {
-      __dubsin (fabs (x), 0, w);
-      if (w[0] == w[0] + 1.000000005 * w[1])
-	return (x > 0) ? w[0] : -w[0];
-      else
-	return (x > 0) ? __mpsin (x, 0, false) : -__mpsin (-x, 0, false);
-    }
+
+  __dubsin (fabs (x), 0, w);
+  if (w[0] == w[0] + 1.000000005 * w[1])
+    return (x > 0) ? w[0] : -w[0];
+
+  return (x > 0) ? __mpsin (x, 0, false) : -__mpsin (-x, 0, false);
 }
 
 /**************************************************************************/
@@ -809,17 +805,15 @@ slow2 (double x)
   res = do_cos_slow (u, y, del, 0, &cor);
   if (res == res + cor)
     return (x > 0) ? res : -res;
-  else
-    {
-      y = fabs (x) - hp0;
-      y1 = y - hp1;
-      y2 = (y - y1) - hp1;
-      __docos (y1, y2, w);
-      if (w[0] == w[0] + 1.000000005 * w[1])
-	return (x > 0) ? w[0] : -w[0];
-      else
-	return (x > 0) ? __mpsin (x, 0, false) : -__mpsin (-x, 0, false);
-    }
+
+  y = fabs (x) - hp0;
+  y1 = y - hp1;
+  y2 = (y - y1) - hp1;
+  __docos (y1, y2, w);
+  if (w[0] == w[0] + 1.000000005 * w[1])
+    return (x > 0) ? w[0] : -w[0];
+
+  return (x > 0) ? __mpsin (x, 0, false) : -__mpsin (-x, 0, false);
 }
 
 /***************************************************************************/
@@ -845,46 +839,42 @@ sloww (double x, double dx, double orig)
 
   if (res == res + cor)
     return res;
+
+  (x > 0) ? __dubsin (x, dx, w) : __dubsin (-x, -dx, w);
+  if (w[1] > 0)
+    cor = 1.000000001 * w[1] + fabs (orig) * 1.1e-30;
   else
+    cor = 1.000000001 * w[1] - fabs (orig) * 1.1e-30;
+
+  if (w[0] == w[0] + cor)
+    return (x > 0) ? w[0] : -w[0];
+
+  t = (orig * hpinv + toint);
+  xn = t - toint;
+  v.x = t;
+  y = (orig - xn * mp1) - xn * mp2;
+  n = v.i[LOW_HALF] & 3;
+  da = xn * pp3;
+  t = y - da;
+  da = (y - t) - da;
+  y = xn * pp4;
+  a = t - y;
+  da = ((t - a) - y) + da;
+  if (n & 2)
     {
-      (x > 0) ? __dubsin (x, dx, w) : __dubsin (-x, -dx, w);
-      if (w[1] > 0)
-	cor = 1.000000001 * w[1] + fabs (orig) * 1.1e-30;
-      else
-	cor = 1.000000001 * w[1] - fabs (orig) * 1.1e-30;
+      a = -a;
+      da = -da;
+    }
+  (a > 0) ? __dubsin (a, da, w) : __dubsin (-a, -da, w);
+  if (w[1] > 0)
+    cor = 1.000000001 * w[1] + fabs (orig) * 1.1e-40;
+  else
+    cor = 1.000000001 * w[1] - fabs (orig) * 1.1e-40;
 
-      if (w[0] == w[0] + cor)
-	return (x > 0) ? w[0] : -w[0];
-      else
-	{
-	  t = (orig * hpinv + toint);
-	  xn = t - toint;
-	  v.x = t;
-	  y = (orig - xn * mp1) - xn * mp2;
-	  n = v.i[LOW_HALF] & 3;
-	  da = xn * pp3;
-	  t = y - da;
-	  da = (y - t) - da;
-	  y = xn * pp4;
-	  a = t - y;
-	  da = ((t - a) - y) + da;
-	  if (n & 2)
-	    {
-	      a = -a;
-	      da = -da;
-	    }
-	  (a > 0) ? __dubsin (a, da, w) : __dubsin (-a, -da, w);
-	  if (w[1] > 0)
-	    cor = 1.000000001 * w[1] + fabs (orig) * 1.1e-40;
-	  else
-	    cor = 1.000000001 * w[1] - fabs (orig) * 1.1e-40;
+  if (w[0] == w[0] + cor)
+    return (a > 0) ? w[0] : -w[0];
 
-	  if (w[0] == w[0] + cor)
-	    return (a > 0) ? w[0] : -w[0];
-	  else
-	    return __mpsin (orig, 0, true);
-	}
-    }
+  return __mpsin (orig, 0, true);
 }
 
 /***************************************************************************/
@@ -907,20 +897,18 @@ sloww1 (double x, double dx, double orig, int m)
 
   if (res == res + cor)
     return (m > 0) ? res : -res;
+
+  __dubsin (x, dx, w);
+
+  if (w[1] > 0)
+    cor = 1.000000005 * w[1] + 1.1e-30 * fabs (orig);
   else
-    {
-      __dubsin (x, dx, w);
+    cor = 1.000000005 * w[1] - 1.1e-30 * fabs (orig);
 
-      if (w[1] > 0)
-	cor = 1.000000005 * w[1] + 1.1e-30 * fabs (orig);
-      else
-	cor = 1.000000005 * w[1] - 1.1e-30 * fabs (orig);
+  if (w[0] == w[0] + cor)
+    return (m > 0) ? w[0] : -w[0];
 
-      if (w[0] == w[0] + cor)
-	return (m > 0) ? w[0] : -w[0];
-      else
-	return __mpsin (orig, 0, true);
-    }
+  return __mpsin (orig, 0, true);
 }
 
 /***************************************************************************/
@@ -943,20 +931,18 @@ sloww2 (double x, double dx, double orig, int n)
 
   if (res == res + cor)
     return (n & 2) ? -res : res;
+
+  __docos (x, dx, w);
+
+  if (w[1] > 0)
+    cor = 1.000000005 * w[1] + 1.1e-30 * fabs (orig);
   else
-    {
-      __docos (x, dx, w);
+    cor = 1.000000005 * w[1] - 1.1e-30 * fabs (orig);
 
-      if (w[1] > 0)
-	cor = 1.000000005 * w[1] + 1.1e-30 * fabs (orig);
-      else
-	cor = 1.000000005 * w[1] - 1.1e-30 * fabs (orig);
+  if (w[0] == w[0] + cor)
+    return (n & 2) ? -w[0] : w[0];
 
-      if (w[0] == w[0] + cor)
-	return (n & 2) ? -w[0] : w[0];
-      else
-	return __mpsin (orig, 0, true);
-    }
+  return __mpsin (orig, 0, true);
 }
 
 /***************************************************************************/
@@ -977,18 +963,17 @@ bsloww (double x, double dx, double orig, int n)
   cor = (cor > 0) ? 1.0005 * cor + 1.1e-24 : 1.0005 * cor - 1.1e-24;
   if (res == res + cor)
     return res;
+
+  (x > 0) ? __dubsin (x, dx, w) : __dubsin (-x, -dx, w);
+  if (w[1] > 0)
+    cor = 1.000000001 * w[1] + 1.1e-24;
   else
-    {
-      (x > 0) ? __dubsin (x, dx, w) : __dubsin (-x, -dx, w);
-      if (w[1] > 0)
-	cor = 1.000000001 * w[1] + 1.1e-24;
-      else
-	cor = 1.000000001 * w[1] - 1.1e-24;
-      if (w[0] == w[0] + cor)
-	return (x > 0) ? w[0] : -w[0];
-      else
-	return (n & 1) ? __mpcos (orig, 0, true) : __mpsin (orig, 0, true);
-    }
+    cor = 1.000000001 * w[1] - 1.1e-24;
+
+  if (w[0] == w[0] + cor)
+    return (x > 0) ? w[0] : -w[0];
+
+  return (n & 1) ? __mpcos (orig, 0, true) : __mpsin (orig, 0, true);
 }
 
 /***************************************************************************/
@@ -1012,20 +997,18 @@ bsloww1 (double x, double dx, double orig, int n)
   res = do_sin_slow (u, y, dx, 1.1e-24, &cor);
   if (res == res + cor)
     return (x > 0) ? res : -res;
+
+  __dubsin (fabs (x), dx, w);
+
+  if (w[1] > 0)
+    cor = 1.000000005 * w[1] + 1.1e-24;
   else
-    {
-      __dubsin (fabs (x), dx, w);
+    cor = 1.000000005 * w[1] - 1.1e-24;
 
-      if (w[1] > 0)
-	cor = 1.000000005 * w[1] + 1.1e-24;
-      else
-	cor = 1.000000005 * w[1] - 1.1e-24;
+  if (w[0] == w[0] + cor)
+    return (x > 0) ? w[0] : -w[0];
 
-      if (w[0] == w[0] + cor)
-	return (x > 0) ? w[0] : -w[0];
-      else
-	return (n & 1) ? __mpcos (orig, 0, true) : __mpsin (orig, 0, true);
-    }
+  return (n & 1) ? __mpcos (orig, 0, true) : __mpsin (orig, 0, true);
 }
 
 /***************************************************************************/
@@ -1049,20 +1032,18 @@ bsloww2 (double x, double dx, double orig, int n)
   res = do_cos_slow (u, y, dx, 1.1e-24, &cor);
   if (res == res + cor)
     return (n & 2) ? -res : res;
+
+  __docos (fabs (x), dx, w);
+
+  if (w[1] > 0)
+    cor = 1.000000005 * w[1] + 1.1e-24;
   else
-    {
-      __docos (fabs (x), dx, w);
+    cor = 1.000000005 * w[1] - 1.1e-24;
 
-      if (w[1] > 0)
-	cor = 1.000000005 * w[1] + 1.1e-24;
-      else
-	cor = 1.000000005 * w[1] - 1.1e-24;
+  if (w[0] == w[0] + cor)
+    return (n & 2) ? -w[0] : w[0];
 
-      if (w[0] == w[0] + cor)
-	return (n & 2) ? -w[0] : w[0];
-      else
-	return (n & 1) ? __mpsin (orig, 0, true) : __mpcos (orig, 0, true);
-    }
+  return (n & 1) ? __mpsin (orig, 0, true) : __mpcos (orig, 0, true);
 }
 
 /************************************************************************/
@@ -1083,15 +1064,13 @@ cslow2 (double x)
   res = do_cos_slow (u, y, 0, 0, &cor);
   if (res == res + cor)
     return res;
-  else
-    {
-      y = fabs (x);
-      __docos (y, 0, w);
-      if (w[0] == w[0] + 1.000000005 * w[1])
-	return w[0];
-      else
-	return __mpcos (x, 0, false);
-    }
+
+  y = fabs (x);
+  __docos (y, 0, w);
+  if (w[0] == w[0] + 1.000000005 * w[1])
+    return w[0];
+
+  return __mpcos (x, 0, false);
 }
 
 /***************************************************************************/
@@ -1120,48 +1099,44 @@ csloww (double x, double dx, double orig)
 
   if (res == res + cor)
     return res;
+
+  (x > 0) ? __dubsin (x, dx, w) : __dubsin (-x, -dx, w);
+
+  if (w[1] > 0)
+    cor = 1.000000001 * w[1] + fabs (orig) * 1.1e-30;
   else
+    cor = 1.000000001 * w[1] - fabs (orig) * 1.1e-30;
+
+  if (w[0] == w[0] + cor)
+    return (x > 0) ? w[0] : -w[0];
+
+  t = (orig * hpinv + toint);
+  xn = t - toint;
+  v.x = t;
+  y = (orig - xn * mp1) - xn * mp2;
+  n = v.i[LOW_HALF] & 3;
+  da = xn * pp3;
+  t = y - da;
+  da = (y - t) - da;
+  y = xn * pp4;
+  a = t - y;
+  da = ((t - a) - y) + da;
+  if (n == 1)
     {
-      (x > 0) ? __dubsin (x, dx, w) : __dubsin (-x, -dx, w);
-
-      if (w[1] > 0)
-	cor = 1.000000001 * w[1] + fabs (orig) * 1.1e-30;
-      else
-	cor = 1.000000001 * w[1] - fabs (orig) * 1.1e-30;
+      a = -a;
+      da = -da;
+    }
+  (a > 0) ? __dubsin (a, da, w) : __dubsin (-a, -da, w);
 
-      if (w[0] == w[0] + cor)
-	return (x > 0) ? w[0] : -w[0];
-      else
-	{
-	  t = (orig * hpinv + toint);
-	  xn = t - toint;
-	  v.x = t;
-	  y = (orig - xn * mp1) - xn * mp2;
-	  n = v.i[LOW_HALF] & 3;
-	  da = xn * pp3;
-	  t = y - da;
-	  da = (y - t) - da;
-	  y = xn * pp4;
-	  a = t - y;
-	  da = ((t - a) - y) + da;
-	  if (n == 1)
-	    {
-	      a = -a;
-	      da = -da;
-	    }
-	  (a > 0) ? __dubsin (a, da, w) : __dubsin (-a, -da, w);
+  if (w[1] > 0)
+    cor = 1.000000001 * w[1] + fabs (orig) * 1.1e-40;
+  else
+    cor = 1.000000001 * w[1] - fabs (orig) * 1.1e-40;
 
-	  if (w[1] > 0)
-	    cor = 1.000000001 * w[1] + fabs (orig) * 1.1e-40;
-	  else
-	    cor = 1.000000001 * w[1] - fabs (orig) * 1.1e-40;
+  if (w[0] == w[0] + cor)
+    return (a > 0) ? w[0] : -w[0];
 
-	  if (w[0] == w[0] + cor)
-	    return (a > 0) ? w[0] : -w[0];
-	  else
-	    return __mpcos (orig, 0, true);
-	}
-    }
+  return __mpcos (orig, 0, true);
 }
 
 /***************************************************************************/
@@ -1184,18 +1159,17 @@ csloww1 (double x, double dx, double orig, int m)
 
   if (res == res + cor)
     return (m > 0) ? res : -res;
+
+  __dubsin (x, dx, w);
+  if (w[1] > 0)
+    cor = 1.000000005 * w[1] + 1.1e-30 * fabs (orig);
   else
-    {
-      __dubsin (x, dx, w);
-      if (w[1] > 0)
-	cor = 1.000000005 * w[1] + 1.1e-30 * fabs (orig);
-      else
-	cor = 1.000000005 * w[1] - 1.1e-30 * fabs (orig);
-      if (w[0] == w[0] + cor)
-	return (m > 0) ? w[0] : -w[0];
-      else
-	return __mpcos (orig, 0, true);
-    }
+    cor = 1.000000005 * w[1] - 1.1e-30 * fabs (orig);
+
+  if (w[0] == w[0] + cor)
+    return (m > 0) ? w[0] : -w[0];
+
+  return __mpcos (orig, 0, true);
 }
 
 
@@ -1219,18 +1193,16 @@ csloww2 (double x, double dx, double orig, int n)
 
   if (res == res + cor)
     return (n) ? -res : res;
+
+  __docos (x, dx, w);
+  if (w[1] > 0)
+    cor = 1.000000005 * w[1] + 1.1e-30 * fabs (orig);
   else
-    {
-      __docos (x, dx, w);
-      if (w[1] > 0)
-	cor = 1.000000005 * w[1] + 1.1e-30 * fabs (orig);
-      else
-	cor = 1.000000005 * w[1] - 1.1e-30 * fabs (orig);
-      if (w[0] == w[0] + cor)
-	return (n) ? -w[0] : w[0];
-      else
-	return __mpcos (orig, 0, true);
-    }
+    cor = 1.000000005 * w[1] - 1.1e-30 * fabs (orig);
+  if (w[0] == w[0] + cor)
+    return (n) ? -w[0] : w[0];
+
+  return __mpcos (orig, 0, true);
 }
 
 #ifndef __cos

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=4916acd87b22351c9d77babf5be71fb8c53d67bd

commit 4916acd87b22351c9d77babf5be71fb8c53d67bd
Author: Siddhesh Poyarekar <siddhesh.poyarekar@linaro.org>
Date:   Tue Nov 17 16:01:15 2015 +0530

    benchtests: Mark output variables as used
    
    Prevent function calls that don't return anything from being optimized
    out by the compiler by marking its input variables as used.
    
    This prevents the sincos function call from being optimized out in the
    benchmark.

diff --git a/ChangeLog b/ChangeLog
index dd5a2b5..2d53b2b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-11-17  Siddhesh Poyarekar  <siddhesh.poyarekar@linaro.org>
+
+	* benchtests/scripts/bench.py (_print_arg_data): Mark output variables
+	as used.
+
 2015-11-16  Florian Weimer  <fweimer@redhat.com>
 
 	* math/test-signgam-finite-c99.c (_Mlong_double_): Undefine.
diff --git a/benchtests/scripts/bench.py b/benchtests/scripts/bench.py
index ee856db..7752c8a 100755
--- a/benchtests/scripts/bench.py
+++ b/benchtests/scripts/bench.py
@@ -164,7 +164,7 @@ def _print_arg_data(func, directives, all_vals):
             if pos == -1:
                 die('Output argument must be a pointer type')
 
-            outargs.append('static %s out%d;' % (arg[1:pos], i))
+            outargs.append('static %s out%d __attribute__((used));' % (arg[1:pos], i))
             func_args.append(' &out%d' % i)
         else:
             arg_struct.append('  %s volatile arg%d;' % (arg, i))

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

Summary of changes:
 ChangeLog                      |    7 +
 benchtests/scripts/bench.py    |    2 +-
 sysdeps/ieee754/dbl-64/s_sin.c |  344 ++++++++++++++++++----------------------
 3 files changed, 166 insertions(+), 187 deletions(-)


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



More information about the Glibc-cvs mailing list