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.22-536-g463ac90


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  463ac90dab7b90ba6089c1cadd980b6185d3cceb (commit)
      from  b7665e51633b98c316f0f8ffccc3278d6b10d14d (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=463ac90dab7b90ba6089c1cadd980b6185d3cceb

commit 463ac90dab7b90ba6089c1cadd980b6185d3cceb
Author: Siddhesh Poyarekar <siddhesh.poyarekar@linaro.org>
Date:   Tue Nov 17 16:20:20 2015 +0530

    Include s_sin.c in s_sincos.c
    
    Include the __sin and __cos functions as local static copies to allow
    deper optimization of the functions.  This change shows an improvement
    of about 17% in the min case and 12.5% in the mean case for the sincos
    microbenchmark on x86_64.
    
    	* sysdeps/ieee754/dbl-64/s_sin.c (__sin)[IN_SINCOS]: Mark function
    	static and don't set or restore rounding.
    	(__cos)[IN_SINCOS]: Likewise.
    	* sysdeps/ieee754/dbl-64/s_sincos.c: Include s_sin.c.
    	(__sincos): Set and restore rounding mode.  Remove check for infinite
    	or NaN input.

diff --git a/ChangeLog b/ChangeLog
index 1d223b3..a915653 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2015-11-17  Siddhesh Poyarekar  <siddhesh.poyarekar@linaro.org>
 
+	* sysdeps/ieee754/dbl-64/s_sin.c (__sin)[IN_SINCOS]: Mark function
+	static and don't set or restore rounding.
+	(__cos)[IN_SINCOS]: Likewise.
+	* sysdeps/ieee754/dbl-64/s_sincos.c: Include s_sin.c.
+	(__sincos): Set and restore rounding mode.  Remove check for infinite
+	or NaN input.
+
 	* sysdeps/ieee754/dbl-64/s_sin.c: Remove redundant else clauses.
 
 	* benchtests/scripts/bench.py (_print_arg_data): Mark output variables
diff --git a/sysdeps/ieee754/dbl-64/s_sin.c b/sysdeps/ieee754/dbl-64/s_sin.c
index b8d49e2..a635a86 100644
--- a/sysdeps/ieee754/dbl-64/s_sin.c
+++ b/sysdeps/ieee754/dbl-64/s_sin.c
@@ -280,8 +280,12 @@ reduce_and_compute (double x, unsigned int k)
 /* An ultimate sin routine. Given an IEEE double machine number x   */
 /* it computes the correctly rounded (to nearest) value of sin(x)  */
 /*******************************************************************/
+#ifdef IN_SINCOS
+static double
+#else
 double
 SECTION
+#endif
 __sin (double x)
 {
   double xx, res, t, cor, y, s, c, sn, ssn, cs, ccs, xn, a, da, db, eps, xn1,
@@ -290,7 +294,9 @@ __sin (double x)
   int4 k, m, n;
   double retval = 0;
 
+#ifndef IN_SINCOS
   SET_RESTORE_ROUND_53BIT (FE_TONEAREST);
+#endif
 
   u.x = x;
   m = u.i[HIGH_HALF];
@@ -512,8 +518,12 @@ __sin (double x)
 /* it computes the correctly rounded (to nearest) value of cos(x)  */
 /*******************************************************************/
 
+#ifdef IN_SINCOS
+static double
+#else
 double
 SECTION
+#endif
 __cos (double x)
 {
   double y, xx, res, t, cor, xn, a, da, db, eps, xn1,
@@ -523,7 +533,9 @@ __cos (double x)
 
   double retval = 0;
 
+#ifndef IN_SINCOS
   SET_RESTORE_ROUND_53BIT (FE_TONEAREST);
+#endif
 
   u.x = x;
   m = u.i[HIGH_HALF];
diff --git a/sysdeps/ieee754/dbl-64/s_sincos.c b/sysdeps/ieee754/dbl-64/s_sincos.c
index d7431b7..2a3fc06 100644
--- a/sysdeps/ieee754/dbl-64/s_sincos.c
+++ b/sysdeps/ieee754/dbl-64/s_sincos.c
@@ -22,29 +22,18 @@
 
 #include <math_private.h>
 
+#define __sin __sin_local
+#define __cos __cos_local
+#define IN_SINCOS 1
+#include "s_sin.c"
 
 void
 __sincos (double x, double *sinx, double *cosx)
 {
-  int32_t ix;
-
-  /* High word of x. */
-  GET_HIGH_WORD (ix, x);
-
-  /* |x| ~< pi/4 */
-  ix &= 0x7fffffff;
-  if (ix >= 0x7ff00000)
-    {
-      /* sin(Inf or NaN) is NaN */
-      *sinx = *cosx = x - x;
-      if (isinf (x))
-	__set_errno (EDOM);
-    }
-  else
-    {
-      *sinx = __sin (x);
-      *cosx = __cos (x);
-    }
+  SET_RESTORE_ROUND_53BIT (FE_TONEAREST);
+
+  *sinx = __sin (x);
+  *cosx = __cos (x);
 }
 weak_alias (__sincos, sincos)
 #ifdef NO_LONG_DOUBLE

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

Summary of changes:
 ChangeLog                         |    7 +++++++
 sysdeps/ieee754/dbl-64/s_sin.c    |   12 ++++++++++++
 sysdeps/ieee754/dbl-64/s_sincos.c |   27 ++++++++-------------------
 3 files changed, 27 insertions(+), 19 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]