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.24-243-g36ee03e


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  36ee03e6a8e0e59e055988f61fc8517096a62fdb (commit)
       via  9cb069308c833d98b1ba9c78cb41cff0e90f323d (commit)
       via  ead1ef37d2c3cd998dffb803c43a4fc2d08537ff (commit)
      from  5455692aaf604e68d974524f18fc7bbcc97598f2 (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=36ee03e6a8e0e59e055988f61fc8517096a62fdb

commit 36ee03e6a8e0e59e055988f61fc8517096a62fdb
Author: Siddhesh Poyarekar <siddhesh@sourceware.org>
Date:   Thu Oct 6 13:09:02 2016 +0530

    Update comments for some functions in s_sin.c
    
    Update comments for some functions to bring them in sync with what the
    functions are actually doing.

diff --git a/ChangeLog b/ChangeLog
index 4a9676f..d221a03 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2016-10-06  Siddhesh Poyarekar  <siddhesh@sourceware.org>
 
+	* sysdeps/ieee754/dbl-64/s_sin.c (reduce_and_compute, do_sincos_1,
+	do_sincos_2, sloww, sloww1): Update comments.
+
 	* sysdeps/ieee754/dbl-64/s_sincos.c (__sincos): Adjust calls to
 	do_sincos_1 and do_sincos_2 to pass a boolean shift_quadrant.
 
diff --git a/sysdeps/ieee754/dbl-64/s_sin.c b/sysdeps/ieee754/dbl-64/s_sin.c
index 26b984d..96b21cf 100644
--- a/sysdeps/ieee754/dbl-64/s_sin.c
+++ b/sysdeps/ieee754/dbl-64/s_sin.c
@@ -263,9 +263,9 @@ do_sin_slow (double x, double dx, double eps, double *corp)
   return res;
 }
 
-/* Reduce range of X and compute sin of a + da.  K is the amount by which to
-   rotate the quadrants.  This allows us to use the same routine to compute cos
-   by simply rotating the quadrants by 1.  */
+/* Reduce range of X and compute sin of a + da. When SHIFT_QUADRANT is true,
+   the routine returns the cosine of a + da by rotating the quadrant once and
+   computing the sine of the result.  */
 static inline double
 __always_inline
 reduce_and_compute (double x, bool shift_quadrant)
@@ -315,8 +315,8 @@ reduce_sincos_1 (double x, double *a, double *da)
   return n;
 }
 
-/* Compute sin (A + DA).  cos can be computed by shifting the quadrant N
-   clockwise.  */
+/* Compute sin (A + DA).  cos can be computed by passing SHIFT_QUADRANT as
+   true, which results in shifting the quadrant N clockwise.  */
 static double
 __always_inline
 do_sincos_1 (double a, double da, double x, int4 n, bool shift_quadrant)
@@ -387,8 +387,8 @@ reduce_sincos_2 (double x, double *a, double *da)
   return n;
 }
 
-/* Compute sin (A + DA).  cos can be computed by shifting the quadrant N
-   clockwise.  */
+/* Compute sin (A + DA).  cos can be computed by passing SHIFT_QUADRANT as
+   true, which results in shifting the quadrant N clockwise.  */
 static double
 __always_inline
 do_sincos_2 (double a, double da, double x, int4 n, bool shift_quadrant)
@@ -686,14 +686,11 @@ slow2 (double x)
   return __mpsin (fabs (x), 0, false);
 }
 
-/***************************************************************************/
-/*  Routine compute sin(x+dx) (Double-Length number) where x is small enough*/
-/* to use Taylor series around zero and   (x+dx)                            */
-/* in first or third quarter of unit circle.Routine receive also            */
-/* (right argument) the  original   value of x for computing error of      */
-/* result.And if result not accurate enough routine calls mpsin1 or dubsin */
-/***************************************************************************/
-
+/* Compute sin(x + dx) where X is small enough to use Taylor series around zero
+   and (x + dx) in the first or third quarter of the unit circle.  ORIG is the
+   original value of X for computing error of the result.  If the result is not
+   accurate enough, the routine calls mpsin or dubsin.  SHIFT_QUADRANT rotates
+   the unit circle by 1 to compute the cosine instead of sine.  */
 static inline double
 __always_inline
 sloww (double x, double dx, double orig, bool shift_quadrant)
@@ -748,13 +745,11 @@ sloww (double x, double dx, double orig, bool shift_quadrant)
   return shift_quadrant ? __mpcos (orig, 0, true) : __mpsin (orig, 0, true);
 }
 
-/***************************************************************************/
-/*  Routine compute sin(x+dx)   (Double-Length number) where x in first or  */
-/*  third quarter of unit circle.Routine receive also (right argument) the  */
-/*  original   value of x for computing error of result.And if result not  */
-/* accurate enough routine calls  mpsin1   or dubsin                       */
-/***************************************************************************/
-
+/* Compute sin(x + dx) where X is in the first or third quarter of the unit
+   circle.  ORIG is the original value of X for computing error of the result.
+   If the result is not accurate enough, the routine calls mpsin or dubsin.
+   SHIFT_QUADRANT rotates the unit circle by 1 to compute the cosine instead of
+   sine.  */
 static inline double
 __always_inline
 sloww1 (double x, double dx, double orig, bool shift_quadrant)

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

commit 9cb069308c833d98b1ba9c78cb41cff0e90f323d
Author: Siddhesh Poyarekar <siddhesh@sourceware.org>
Date:   Thu Oct 6 12:57:07 2016 +0530

    Adjust calls to do_sincos_1 and do_sincos_2 in s_sincos.c
    
    Adjust calls to do_sincos_1 and do_sincos_2 to pass a boolean
    shift_quadrant instead of the numeric 0 and 1.
    
    This does not affect codegen.

diff --git a/ChangeLog b/ChangeLog
index d0cb39c..4a9676f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2016-10-06  Siddhesh Poyarekar  <siddhesh@sourceware.org>
 
+	* sysdeps/ieee754/dbl-64/s_sincos.c (__sincos): Adjust calls to
+	do_sincos_1 and do_sincos_2 to pass a boolean shift_quadrant.
+
 	* sysdeps/ieee754/dbl-64/s_sin.c (reduce_and_compute): Make
 	K boolean and rename it.
 	(__sin): Adjust.
diff --git a/sysdeps/ieee754/dbl-64/s_sincos.c b/sysdeps/ieee754/dbl-64/s_sincos.c
index c389226..ca44b90 100644
--- a/sysdeps/ieee754/dbl-64/s_sincos.c
+++ b/sysdeps/ieee754/dbl-64/s_sincos.c
@@ -80,8 +80,8 @@ __sincos (double x, double *sinx, double *cosx)
       double a, da;
       int4 n = reduce_sincos_1 (x, &a, &da);
 
-      *sinx = do_sincos_1 (a, da, x, n, 0);
-      *cosx = do_sincos_1 (a, da, x, n, 1);
+      *sinx = do_sincos_1 (a, da, x, n, false);
+      *cosx = do_sincos_1 (a, da, x, n, true);
 
       return;
     }
@@ -90,8 +90,8 @@ __sincos (double x, double *sinx, double *cosx)
       double a, da;
       int4 n = reduce_sincos_2 (x, &a, &da);
 
-      *sinx = do_sincos_2 (a, da, x, n, 0);
-      *cosx = do_sincos_2 (a, da, x, n, 1);
+      *sinx = do_sincos_2 (a, da, x, n, false);
+      *cosx = do_sincos_2 (a, da, x, n, true);
 
       return;
     }

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

commit ead1ef37d2c3cd998dffb803c43a4fc2d08537ff
Author: Siddhesh Poyarekar <siddhesh@sourceware.org>
Date:   Thu Oct 6 12:54:04 2016 +0530

    Make quadrant shift a boolean in reduce_and_compute in s_sin.c
    
    Like the previous change, make the quadrant shift a boolean to make it
    clearer that we will do at most a single rotation of the quadrants to
    compute the cosine from the sine function.
    
    This does not affect codegen.

diff --git a/ChangeLog b/ChangeLog
index 34f3bf4..d0cb39c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2016-10-06  Siddhesh Poyarekar  <siddhesh@sourceware.org>
+
+	* sysdeps/ieee754/dbl-64/s_sin.c (reduce_and_compute): Make
+	K boolean and rename it.
+	(__sin): Adjust.
+	(__cos): Adjust.
+
 2016-10-06  Rical Jasan  <ricaljasan@pacific.net>
 	    Siddhesh Poyarekar  <siddhesh@sourceware.org>
 
diff --git a/sysdeps/ieee754/dbl-64/s_sin.c b/sysdeps/ieee754/dbl-64/s_sin.c
index 67bdebf..26b984d 100644
--- a/sysdeps/ieee754/dbl-64/s_sin.c
+++ b/sysdeps/ieee754/dbl-64/s_sin.c
@@ -268,11 +268,11 @@ do_sin_slow (double x, double dx, double eps, double *corp)
    by simply rotating the quadrants by 1.  */
 static inline double
 __always_inline
-reduce_and_compute (double x, unsigned int k)
+reduce_and_compute (double x, bool shift_quadrant)
 {
   double retval = 0, a, da;
   unsigned int n = __branred (x, &a, &da);
-  k = (n + k) % 4;
+  int4 k = (n + shift_quadrant) % 4;
   switch (k)
     {
     case 2:
@@ -512,7 +512,7 @@ __sin (double x)
 
 /* -----------------281474976710656 <|x| <2^1024----------------------------*/
   else if (k < 0x7ff00000)
-    retval = reduce_and_compute (x, 0);
+    retval = reduce_and_compute (x, false);
 
 /*--------------------- |x| > 2^1024 ----------------------------------*/
   else
@@ -605,7 +605,7 @@ __cos (double x)
 
   /* 281474976710656 <|x| <2^1024 */
   else if (k < 0x7ff00000)
-    retval = reduce_and_compute (x, 1);
+    retval = reduce_and_compute (x, true);
 
   else
     {

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

Summary of changes:
 ChangeLog                         |   13 ++++++++++
 sysdeps/ieee754/dbl-64/s_sin.c    |   47 ++++++++++++++++--------------------
 sysdeps/ieee754/dbl-64/s_sincos.c |    8 +++---
 3 files changed, 38 insertions(+), 30 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]