public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Anssi Hannula <anssi.hannula@bitwise.fi>
To: libc-alpha@sourceware.org
Subject: [PATCH 2/2] ieee754: Remove unused __sin32 and __cos32
Date: Mon, 27 Jan 2020 11:25:00 -0000	[thread overview]
Message-ID: <20200127104511.16618-2-anssi.hannula@bitwise.fi> (raw)
In-Reply-To: <20200127104511.16618-1-anssi.hannula@bitwise.fi>

The __sin32 and __cos32 functions were only used in the now removed slow
path of asin and acos.
---
 manual/probes.texi                           | 14 -----
 sysdeps/generic/math_private.h               |  2 -
 sysdeps/ieee754/dbl-64/sincos32.c            | 62 --------------------
 sysdeps/x86_64/fpu/multiarch/e_asin-fma.c    |  2 -
 sysdeps/x86_64/fpu/multiarch/e_asin-fma4.c   |  2 -
 sysdeps/x86_64/fpu/multiarch/sincos32-fma.c  |  2 -
 sysdeps/x86_64/fpu/multiarch/sincos32-fma4.c |  2 -
 7 files changed, 86 deletions(-)

diff --git a/manual/probes.texi b/manual/probes.texi
index 0ea560ed78..61254bc430 100644
--- a/manual/probes.texi
+++ b/manual/probes.texi
@@ -311,20 +311,6 @@ input that results in multiple precision computation with precision
 is the computed result.
 @end deftp
 
-@deftp Probe slowasin (double @var{$arg1}, double @var{$arg2})
-This probe is triggered when the @code{asin} function is called with
-an input that results in multiple precision computation with precision
-32.  Argument @var{$arg1} is the input to the function and @var{$arg2}
-is the computed result.
-@end deftp
-
-@deftp Probe slowacos (double @var{$arg1}, double @var{$arg2})
-This probe is triggered when the @code{acos} function is called with
-an input that results in multiple precision computation with precision
-32.  Argument @var{$arg1} is the input to the function and @var{$arg2}
-is the computed result.
-@end deftp
-
 @deftp Probe slowsin (double @var{$arg1}, double @var{$arg2})
 This probe is triggered when the @code{sin} function is called with an
 input that results in multiple precision computation with precision
diff --git a/sysdeps/generic/math_private.h b/sysdeps/generic/math_private.h
index 9296324d24..10a6fde28d 100644
--- a/sysdeps/generic/math_private.h
+++ b/sysdeps/generic/math_private.h
@@ -202,8 +202,6 @@ extern int __branred (double __x, double *__a, double *__aa);
 extern void __doasin (double __x, double __dx, double __v[]);
 extern void __dubsin (double __x, double __dx, double __v[]);
 extern void __dubcos (double __x, double __dx, double __v[]);
-extern double __sin32 (double __x, double __res, double __res1);
-extern double __cos32 (double __x, double __res, double __res1);
 extern double __mpsin (double __x, double __dx, bool __range_reduce);
 extern double __mpcos (double __x, double __dx, bool __range_reduce);
 extern void __docos (double __x, double __dx, double __v[]);
diff --git a/sysdeps/ieee754/dbl-64/sincos32.c b/sysdeps/ieee754/dbl-64/sincos32.c
index c00e5d1a0f..a28932dffe 100644
--- a/sysdeps/ieee754/dbl-64/sincos32.c
+++ b/sysdeps/ieee754/dbl-64/sincos32.c
@@ -127,68 +127,6 @@ __c32 (mp_no *x, mp_no *y, mp_no *z, int p)
   __cpy (&s, z, p);
 }
 
-/* Receive double x and two double results of sin(x) and return result which is
-   more accurate, computing sin(x) with multi precision routine c32.  */
-double
-SECTION
-__sin32 (double x, double res, double res1)
-{
-  int p;
-  mp_no a, b, c;
-  p = 32;
-  __dbl_mp (res, &a, p);
-  __dbl_mp (0.5 * (res1 - res), &b, p);
-  __add (&a, &b, &c, p);
-  if (x > 0.8)
-    {
-      __sub (&hp, &c, &a, p);
-      __c32 (&a, &b, &c, p);
-    }
-  else
-    __c32 (&c, &a, &b, p);	/* b=sin(0.5*(res+res1))  */
-  __dbl_mp (x, &c, p);		/* c = x  */
-  __sub (&b, &c, &a, p);
-  /* if a > 0 return min (res, res1), otherwise return max (res, res1).  */
-  if ((a.d[0] > 0 && res >= res1) || (a.d[0] <= 0 && res <= res1))
-    res = res1;
-  LIBC_PROBE (slowasin, 2, &res, &x);
-  return res;
-}
-
-/* Receive double x and two double results of cos(x) and return result which is
-   more accurate, computing cos(x) with multi precision routine c32.  */
-double
-SECTION
-__cos32 (double x, double res, double res1)
-{
-  int p;
-  mp_no a, b, c;
-  p = 32;
-  __dbl_mp (res, &a, p);
-  __dbl_mp (0.5 * (res1 - res), &b, p);
-  __add (&a, &b, &c, p);
-  if (x > 2.4)
-    {
-      __sub (&pi, &c, &a, p);
-      __c32 (&a, &b, &c, p);
-      b.d[0] = -b.d[0];
-    }
-  else if (x > 0.8)
-    {
-      __sub (&hp, &c, &a, p);
-      __c32 (&a, &c, &b, p);
-    }
-  else
-    __c32 (&c, &b, &a, p);	/* b=cos(0.5*(res+res1))  */
-  __dbl_mp (x, &c, p);		/* c = x                  */
-  __sub (&b, &c, &a, p);
-  /* if a > 0 return max (res, res1), otherwise return min (res, res1).  */
-  if ((a.d[0] > 0 && res <= res1) || (a.d[0] <= 0 && res >= res1))
-    res = res1;
-  LIBC_PROBE (slowacos, 2, &res, &x);
-  return res;
-}
-
 /* Compute sin() of double-length number (X + DX) as Multi Precision number and
    return result as double.  If REDUCE_RANGE is true, X is assumed to be the
    original input and DX is ignored.  */
diff --git a/sysdeps/x86_64/fpu/multiarch/e_asin-fma.c b/sysdeps/x86_64/fpu/multiarch/e_asin-fma.c
index 50e9c64247..1e3767bf2d 100644
--- a/sysdeps/x86_64/fpu/multiarch/e_asin-fma.c
+++ b/sysdeps/x86_64/fpu/multiarch/e_asin-fma.c
@@ -1,11 +1,9 @@
 #define __ieee754_acos __ieee754_acos_fma
 #define __ieee754_asin __ieee754_asin_fma
-#define __cos32 __cos32_fma
 #define __doasin __doasin_fma
 #define __docos __docos_fma
 #define __dubcos __dubcos_fma
 #define __dubsin __dubsin_fma
-#define __sin32 __sin32_fma
 #define SECTION __attribute__ ((section (".text.fma")))
 
 #include <sysdeps/ieee754/dbl-64/e_asin.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_asin-fma4.c b/sysdeps/x86_64/fpu/multiarch/e_asin-fma4.c
index 2657c31f49..0965556a01 100644
--- a/sysdeps/x86_64/fpu/multiarch/e_asin-fma4.c
+++ b/sysdeps/x86_64/fpu/multiarch/e_asin-fma4.c
@@ -1,11 +1,9 @@
 #define __ieee754_acos __ieee754_acos_fma4
 #define __ieee754_asin __ieee754_asin_fma4
-#define __cos32 __cos32_fma4
 #define __doasin __doasin_fma4
 #define __docos __docos_fma4
 #define __dubcos __dubcos_fma4
 #define __dubsin __dubsin_fma4
-#define __sin32 __sin32_fma4
 #define SECTION __attribute__ ((section (".text.fma4")))
 
 #include <sysdeps/ieee754/dbl-64/e_asin.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/sincos32-fma.c b/sysdeps/x86_64/fpu/multiarch/sincos32-fma.c
index dcd44bc5e8..4152b84835 100644
--- a/sysdeps/x86_64/fpu/multiarch/sincos32-fma.c
+++ b/sysdeps/x86_64/fpu/multiarch/sincos32-fma.c
@@ -1,5 +1,3 @@
-#define __cos32 __cos32_fma
-#define __sin32 __sin32_fma
 #define __c32 __c32_fma
 #define __mpsin __mpsin_fma
 #define __mpsin1 __mpsin1_fma
diff --git a/sysdeps/x86_64/fpu/multiarch/sincos32-fma4.c b/sysdeps/x86_64/fpu/multiarch/sincos32-fma4.c
index ebbfa18cca..643eedf138 100644
--- a/sysdeps/x86_64/fpu/multiarch/sincos32-fma4.c
+++ b/sysdeps/x86_64/fpu/multiarch/sincos32-fma4.c
@@ -1,5 +1,3 @@
-#define __cos32 __cos32_fma4
-#define __sin32 __sin32_fma4
 #define __c32 __c32_fma4
 #define __mpsin __mpsin_fma4
 #define __mpsin1 __mpsin1_fma4
-- 
2.21.1

  reply	other threads:[~2020-01-27 10:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-27 10:45 [PATCH 1/2] ieee754: Remove slow paths from asin and acos Anssi Hannula
2020-01-27 11:25 ` Anssi Hannula [this message]
2020-01-27 13:12 ` Szabolcs Nagy
2020-01-28 10:51   ` Anssi Hannula
2020-03-24 23:15   ` Joseph Myers
2020-12-18  7:09 ` [COMMITTED] " Siddhesh Poyarekar
2020-12-18  8:28   ` Paul Zimmermann
2020-12-18  9:26     ` Siddhesh Poyarekar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200127104511.16618-2-anssi.hannula@bitwise.fi \
    --to=anssi.hannula@bitwise.fi \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).