diff mbox

[v2,1/3] Remove unneeded declarations from math_private.h

Message ID 1490733875-20087-2-git-send-email-gftg@linux.vnet.ibm.com
State New
Headers show

Commit Message

Gabriel F. T. Gomes March 28, 2017, 8:44 p.m. UTC
The declarations of many functions in math_private.h are not required
since __MATHDECL and __MATHDECLX, in math.h, already provide the
declarations for these functions.  This patch removes the declarations
from math_private.h. It also adds the inclusion of math.h to the files
which depended on the declaration of functions in math_private.h.

Tested for powerpc64le and s390x.

2017-03-17  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>

	* sysdeps/generic/math_private.h: Remove declarations of
	many functions that are already declared in math.h.
	* sysdeps/ieee754/ldbl-128/e_logl.c: Include math.h to get the
	declaration for __frexpl.
	* sysdeps/ieee754/ldbl-128ibm/e_logl.c: Include math.h to get
	the declarations for __scalbnl and fabsl.
---
 sysdeps/generic/math_private.h       | 26 --------------------------
 sysdeps/ieee754/ldbl-128/e_logl.c    |  1 +
 sysdeps/ieee754/ldbl-128ibm/e_logl.c |  1 +
 3 files changed, 2 insertions(+), 26 deletions(-)

Comments

Joseph Myers March 29, 2017, 2:25 p.m. UTC | #1
On Tue, 28 Mar 2017, Gabriel F. T. Gomes wrote:

> The declarations of many functions in math_private.h are not required
> since __MATHDECL and __MATHDECLX, in math.h, already provide the
> declarations for these functions.  This patch removes the declarations
> from math_private.h. It also adds the inclusion of math.h to the files
> which depended on the declaration of functions in math_private.h.
> 
> Tested for powerpc64le and s390x.

OK apart from the removal of the inline definition of __copysignl.  That 
inline definition is still relevant in the absence of changing all calls 
to __copysign* to call copysign* directly so the compiler can inline them 
(and if changed to call copysign*, which I think would make sense, it 
would be desirable to run build-many-glibcs.py tests to make sure this 
doesn't introduce linknamespace issues).
Gabriel F. T. Gomes April 10, 2017, 6:02 p.m. UTC | #2
On Wed, 29 Mar 2017 14:25:20 +0000
Joseph Myers <joseph@codesourcery.com> wrote:

> OK apart from the removal of the inline definition of __copysignl.  That 
> inline definition is still relevant in the absence of changing all calls 
> to __copysign* to call copysign* directly so the compiler can inline them 
> (and if changed to call copysign*, which I think would make sense, it 
> would be desirable to run build-many-glibcs.py tests to make sure this 
> doesn't introduce linknamespace issues).

Thanks.  Now committed without the removal of __copysignl (v3).
diff mbox

Patch

diff --git a/sysdeps/generic/math_private.h b/sysdeps/generic/math_private.h
index be65b94..2d22552 100644
--- a/sysdeps/generic/math_private.h
+++ b/sysdeps/generic/math_private.h
@@ -318,32 +318,6 @@  extern long double __kernel_tanl (long double,long double,int);
 extern void __kernel_sincosl (long double,long double,
 			      long double *,long double *, int);
 
-#ifndef NO_LONG_DOUBLE
-/* prototypes required to compile the ldbl-96 support without warnings */
-extern int __finitel (long double);
-extern int __ilogbl (long double);
-extern int __isinfl (long double);
-extern int __isnanl (long double);
-extern long double __atanl (long double);
-extern long double __copysignl (long double, long double);
-extern long double __expm1l (long double);
-extern long double __floorl (long double);
-extern long double __frexpl (long double, int *);
-extern long double __ldexpl (long double, int);
-extern long double __log1pl (long double);
-extern long double __nanl (const char *);
-extern long double __rintl (long double);
-extern long double __scalbnl (long double, int);
-extern long double __sqrtl (long double x);
-extern long double fabsl (long double x);
-extern void __sincosl (long double, long double *, long double *);
-extern long double __logbl (long double x);
-extern long double __significandl (long double x);
-
-extern inline long double __copysignl (long double x, long double y)
-{ return __builtin_copysignl (x, y); }
-
-#endif
 
 /* Prototypes for functions of the IBM Accurate Mathematical Library.  */
 extern double __exp1 (double __x, double __xx, double __error);
diff --git a/sysdeps/ieee754/ldbl-128/e_logl.c b/sysdeps/ieee754/ldbl-128/e_logl.c
index 78061a9..8672047 100644
--- a/sysdeps/ieee754/ldbl-128/e_logl.c
+++ b/sysdeps/ieee754/ldbl-128/e_logl.c
@@ -58,6 +58,7 @@ 
     License along with this library; if not, see
     <http://www.gnu.org/licenses/>.  */
 
+#include <math.h>
 #include <math_private.h>
 
 /* log(1+x) = x - .5 x^2 + x^3 l(x)
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_logl.c b/sysdeps/ieee754/ldbl-128ibm/e_logl.c
index 14acfc2..c44feca 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_logl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_logl.c
@@ -58,6 +58,7 @@ 
     License along with this library; if not, see
     <http://www.gnu.org/licenses/>.  */
 
+#include <math.h>
 #include <math_private.h>
 
 /* log(1+x) = x - .5 x^2 + x^3 l(x)