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-158-g2c46d11


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  2c46d1148650edf5d02051c3794227d52618db0c (commit)
       via  fc7f4691d331acb206c9be2643fc2572eabac0e1 (commit)
       via  9f9834f582f87cc84bfaa11cff5f98fb661c288d (commit)
      from  8837917cf17b083ac4178352c740b0bfeada4d7f (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=2c46d1148650edf5d02051c3794227d52618db0c

commit 2c46d1148650edf5d02051c3794227d52618db0c
Author: Paul E. Murphy <murphyp@linux.vnet.ibm.com>
Date:   Mon Sep 12 17:32:07 2016 -0500

    Build s_nan* objects from a generic template
    
    This requires adding a macro to synthesize the call
    to __strto*_nan.  Since this is likely to be the only
    usage ever for strto* functions in generated libm
    calls, a dedicated macro is defined for it.

diff --git a/ChangeLog b/ChangeLog
index 8423f60..338777b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,29 @@
 2016-09-20  Paul E. Murphy  <murphyp@linux.vnet.ibm.com>
 
+	* math/Makefile (libm-calls): Remove s_nanF.
+	(gen-libm-calls): Add s_nanF.
+
+	* math/s_nan.c: Refactor into ...
+	* math/s_nan_template.c: New file.
+
+	* math/s_nanf.c: Removed.
+	* math/s_nanl.c: Removed.
+	* sysdeps/ieee754/ldbl-opt/s_nan.c: Removed.
+	* sysdeps/ieee754/ldbl-opt/s_nanl.c: Removed.
+
+	* sysdeps/ieee754/ldbl-opt/math-type-macros-double.h:
+	(LDOUBLE_nanl_libm_version): New macro.
+
+	* sysdeps/generic/math-type-macros-double.h:
+	(M_STRTO_NAN): New macro.
+	* sysdeps/generic/math-type-macros-float.h: Likewise.
+	* sysdeps/generic/math-type-macros-ldouble.h: Likewise.
+
+	* sysdeps/generic/math-type-macros.h: Document
+	M_STRTO_NAN.
+
+2016-09-20  Paul E. Murphy  <murphyp@linux.vnet.ibm.com>
+
 	* math/s_nanf.c: Remove __nanf undef.
 	* math/s_nan.c: Remove __nan undef.
 	* math/s_nanl.c: Remove __nanl undef.
diff --git a/math/Makefile b/math/Makefile
index 367f73e..6c58b97 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -50,7 +50,8 @@ gen-libm-calls = cargF conjF cimagF crealF cabsF s_cacosF		  \
 	         s_cacoshF s_ccosF s_ccoshF s_casinF s_csinF s_casinhF	  \
 		 k_casinhF s_csinhF k_casinhF s_csinhF s_catanhF s_catanF \
 		 s_ctanF s_ctanhF s_cexpF s_clogF s_cprojF s_csqrtF	  \
-		 s_cpowF s_clog10F s_fdimF s_nextdownF s_fmaxF s_fminF
+		 s_cpowF s_clog10F s_fdimF s_nextdownF s_fmaxF s_fminF	  \
+		 s_nanF
 
 libm-calls =								  \
 	e_acosF e_acoshF e_asinF e_atan2F e_atanhF e_coshF e_expF e_fmodF \
@@ -66,7 +67,7 @@ libm-calls =								  \
 	w_tgammaF w_hypotF w_j0F w_j1F w_jnF w_lgammaF w_lgammaF_r	  \
 	w_logF w_log10F w_powF w_remainderF w_scalbF w_sinhF w_sqrtF	  \
 	w_ilogbF							  \
-	s_fpclassifyF s_nanF s_truncF		  	  	          \
+	s_fpclassifyF s_truncF						  \
 	s_remquoF e_log2F e_exp2F s_roundF s_nearbyintF s_sincosF	  \
 	s_fmaF s_lrintF s_llrintF s_lroundF s_llroundF e_exp10F w_log2F	  \
 	s_issignalingF $(calls:s_%=m_%) x2y2m1F				  \
diff --git a/math/s_nan.c b/math/s_nan_template.c
similarity index 84%
rename from math/s_nan.c
rename to math/s_nan_template.c
index 03e95f5..cf47a2f 100644
--- a/math/s_nan.c
+++ b/math/s_nan_template.c
@@ -24,13 +24,14 @@
 #include <ieee754.h>
 
 
-double
-__nan (const char *tagp)
+FLOAT
+M_DECL_FUNC (__nan) (const char *tagp)
 {
-  return __strtod_nan (tagp, NULL, 0);
+  return M_STRTO_NAN (tagp, NULL, 0);
 }
-weak_alias (__nan, nan)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__nan, __nanl)
-weak_alias (__nan, nanl)
+
+declare_mgen_alias (__nan, nan)
+
+#if M_LIBM_NEED_COMPAT (nan)
+declare_mgen_libm_compat (__nan, nan)
 #endif
diff --git a/math/s_nanf.c b/math/s_nanf.c
deleted file mode 100644
index 3046720..0000000
--- a/math/s_nanf.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Return quiet nan.
-   Copyright (C) 1997-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ieee754.h>
-
-
-float
-__nanf (const char *tagp)
-{
-  return __strtof_nan (tagp, NULL, 0);
-}
-weak_alias (__nanf, nanf)
diff --git a/math/s_nanl.c b/math/s_nanl.c
deleted file mode 100644
index 4b7b3d5..0000000
--- a/math/s_nanl.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Return quiet nan.
-   Copyright (C) 1997-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ieee754.h>
-
-
-long double
-__nanl (const char *tagp)
-{
-  return __strtold_nan (tagp, NULL, 0);
-}
-weak_alias (__nanl, nanl)
diff --git a/sysdeps/generic/math-type-macros-double.h b/sysdeps/generic/math-type-macros-double.h
index 284a6a4..6d0f206 100644
--- a/sysdeps/generic/math-type-macros-double.h
+++ b/sysdeps/generic/math-type-macros-double.h
@@ -25,6 +25,7 @@
 #define M_SUF(c) c
 #define FLOAT double
 #define CFLOAT _Complex double
+#define M_STRTO_NAN __strtod_nan
 
 /* Machines without a distinct long double type
    alias long double functions to their double
diff --git a/sysdeps/generic/math-type-macros-float.h b/sysdeps/generic/math-type-macros-float.h
index aab88fd..33f5130 100644
--- a/sysdeps/generic/math-type-macros-float.h
+++ b/sysdeps/generic/math-type-macros-float.h
@@ -24,6 +24,7 @@
 #define M_SUF(c) c ## f
 #define FLOAT float
 #define CFLOAT _Complex float
+#define M_STRTO_NAN __strtof_nan
 
 /* Standard/GNU macro literals do not exist for the float type.  Use
    the double macro constants.  */
diff --git a/sysdeps/generic/math-type-macros-ldouble.h b/sysdeps/generic/math-type-macros-ldouble.h
index 90773fa..4f959da 100644
--- a/sysdeps/generic/math-type-macros-ldouble.h
+++ b/sysdeps/generic/math-type-macros-ldouble.h
@@ -25,6 +25,7 @@
 #define M_SUF(c) c ## l
 #define FLOAT long double
 #define CFLOAT _Complex long double
+#define M_STRTO_NAN __strtold_nan
 
 /* Supply the generic macros.  */
 #include <math-type-macros.h>
diff --git a/sysdeps/generic/math-type-macros.h b/sysdeps/generic/math-type-macros.h
index 78b883c..c2488ec 100644
--- a/sysdeps/generic/math-type-macros.h
+++ b/sysdeps/generic/math-type-macros.h
@@ -30,6 +30,9 @@
 		i.e expf expl exp.
    FLOAT      - Resolves to the C typename of M_TYPE.
    CFLOAT     - Resolves to the complex typename of M_TYPE.
+   M_STRTO_NAN - Resolves to the internal libc function which
+		converts a string into the appropriate FLOAT nan
+		value.
 
   Optionally, these headers may inject a non-standard
   definition for the following:
diff --git a/sysdeps/ieee754/ldbl-opt/math-type-macros-double.h b/sysdeps/ieee754/ldbl-opt/math-type-macros-double.h
index f627264..2569607 100644
--- a/sysdeps/ieee754/ldbl-opt/math-type-macros-double.h
+++ b/sysdeps/ieee754/ldbl-opt/math-type-macros-double.h
@@ -47,6 +47,7 @@
 #define LDOUBLE_fdiml_libm_version GLIBC_2_1
 #define LDOUBLE_fmaxl_libm_version GLIBC_2_1
 #define LDOUBLE_fminl_libm_version GLIBC_2_1
+#define LDOUBLE_nanl_libm_version GLIBC_2_1
 
 /* Define compat symbols for long double on platforms
    where it was not always a distinct type.  */
diff --git a/sysdeps/ieee754/ldbl-opt/s_nan.c b/sysdeps/ieee754/ldbl-opt/s_nan.c
deleted file mode 100644
index 418aad2..0000000
--- a/sysdeps/ieee754/ldbl-opt/s_nan.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/s_nan.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __nan, nanl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_nanl.c b/sysdeps/ieee754/ldbl-opt/s_nanl.c
deleted file mode 100644
index 9496e0b..0000000
--- a/sysdeps/ieee754/ldbl-opt/s_nanl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_nanl.c>
-long_double_symbol (libm, __nanl, nanl);

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

commit fc7f4691d331acb206c9be2643fc2572eabac0e1
Author: Paul E. Murphy <murphyp@linux.vnet.ibm.com>
Date:   Mon Sep 12 17:11:45 2016 -0500

    Remove __nan{f,,l} macros
    
    Use the GCC builtin instead.  With the exception of the
    files built from a template, they are unused.  This
    is preparation for making the s_nanF objects generated.

diff --git a/ChangeLog b/ChangeLog
index d68dfed..8423f60 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2016-09-20  Paul E. Murphy  <murphyp@linux.vnet.ibm.com>
 
+	* math/s_nanf.c: Remove __nanf undef.
+	* math/s_nan.c: Remove __nan undef.
+	* math/s_nanl.c: Remove __nanl undef.
+
+	* sysdeps/generic/math_private.h (__nan): Remove macro
+	override.
+	(__nanf): Likewise.
+	(__nanl): Likewise.
+
+2016-09-20  Paul E. Murphy  <murphyp@linux.vnet.ibm.com>
+
 	* math/Makefile (gen-all-calls): New variable.
 	(generated): Replace gen-libm-calls with gen-all-calls.
 	(gen-libm-templates.stmp): Likewise.  Also, ensure
diff --git a/math/s_nan.c b/math/s_nan.c
index d9af775..03e95f5 100644
--- a/math/s_nan.c
+++ b/math/s_nan.c
@@ -24,7 +24,6 @@
 #include <ieee754.h>
 
 
-#undef __nan
 double
 __nan (const char *tagp)
 {
diff --git a/math/s_nanf.c b/math/s_nanf.c
index 0dd6778..3046720 100644
--- a/math/s_nanf.c
+++ b/math/s_nanf.c
@@ -24,7 +24,6 @@
 #include <ieee754.h>
 
 
-#undef __nanf
 float
 __nanf (const char *tagp)
 {
diff --git a/math/s_nanl.c b/math/s_nanl.c
index e6149bc..4b7b3d5 100644
--- a/math/s_nanl.c
+++ b/math/s_nanl.c
@@ -24,7 +24,6 @@
 #include <ieee754.h>
 
 
-#undef __nanl
 long double
 __nanl (const char *tagp)
 {
diff --git a/sysdeps/generic/math-type-macros.h b/sysdeps/generic/math-type-macros.h
index bd9e25a..78b883c 100644
--- a/sysdeps/generic/math-type-macros.h
+++ b/sysdeps/generic/math-type-macros.h
@@ -74,7 +74,7 @@
 #define __M_CONCAT(a,b) a ## b
 #define __M_CONCATX(a,b) __M_CONCAT(a,b)
 
-#define M_NAN M_SUF (__nan) ("")
+#define M_NAN M_SUF (__builtin_nan) ("")
 #define M_MAX_EXP __M_CONCATX (M_PFX, _MAX_EXP)
 #define M_MIN __M_CONCATX (M_PFX, _MIN)
 #define M_MAX __M_CONCATX (M_PFX, _MAX)
diff --git a/sysdeps/generic/math_private.h b/sysdeps/generic/math_private.h
index 24adcfb..28e5df0 100644
--- a/sysdeps/generic/math_private.h
+++ b/sysdeps/generic/math_private.h
@@ -775,11 +775,4 @@ libc_feresetround_noex_ctx (struct rm_ctx *ctx)
   SET_RESTORE_ROUND_GENERIC (RM, libc_feholdsetround_53bit,	      \
 			     libc_feresetround_53bit)
 
-#define __nan(str) \
-  (__builtin_constant_p (str) && str[0] == '\0' ? NAN : __nan (str))
-#define __nanf(str) \
-  (__builtin_constant_p (str) && str[0] == '\0' ? NAN : __nan (str))
-#define __nanl(str) \
-  (__builtin_constant_p (str) && str[0] == '\0' ? NAN : __nan (str))
-
 #endif /* _MATH_PRIVATE_H_ */

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

commit 9f9834f582f87cc84bfaa11cff5f98fb661c288d
Author: Paul E. Murphy <murphyp@linux.vnet.ibm.com>
Date:   Thu Sep 8 08:48:08 2016 -0500

    Make ldexpF generic.
    
    This one is a little more tricky since it is built both for
    libm and libc, and exports multiple aliases.
    
    To simplify aliasing, a new macro is introduced which handles
    aliasing to two symbols.  By default, it just applies
    declare_mgen_alias to both target symbols.
    
    Likewise, the makefile is tweaked a little to generate
    templates for shared files too, and a new rule is added
    to build m_*.c objects from the objpfx directory.
    
    Verified there are no symbol or code changes using a script
    to diff the *_ldexp* object files on s390x, aarch64, arm,
    x86_64, and ppc64.

diff --git a/ChangeLog b/ChangeLog
index 3223527..d68dfed 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,29 @@
+2016-09-20  Paul E. Murphy  <murphyp@linux.vnet.ibm.com>
+
+	* math/Makefile (gen-all-calls): New variable.
+	(generated): Replace gen-libm-calls with gen-all-calls.
+	(gen-libm-templates.stmp): Likewise.  Also, ensure
+	the output directory exists or is created and add
+	dependency on the Makefile.
+	(calls): Move s_ldexpF into gen-calls.
+	(gen-calls): New variable.
+
+	* math/s_ldexpf.c: Removed.
+	* math/s_ldexpl.c: Removed.
+	* math/s_ldexp.c: Refactored into ...
+	* math/s_ldexp_template.c: New file.
+
+	* sysdeps/generic/math-type-macros-double.h: Remove
+	redundant fall-through definition of declare_mgen_alias.
+	(declare_mgen_alias_2): New macro.
+
+	* sysdeps/generc/math-type-macros.h (declare_mgen_alias_2):
+	New macro for function aliased to two exported symbols.
+
+	* sysdeps/ieee754/ldbl-opt/s_ldexp.c: Update to use
+	new template file.
+	sysdeps/ieee754/ldbl-opt/s_ldexpl.c: Likewise.
+
 2016-09-20  Florian Weimer  <fweimer@redhat.com>
 
 	* Makeconfig (all-object-suffixes): Remove .og.
diff --git a/math/Makefile b/math/Makefile
index fc48960..367f73e 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -120,7 +120,8 @@ libm-routines = $(strip $(libm-support) $(libm-compat-calls)		\
 # In libm-calls (above), list m_foo in place of s_foo for any
 # routine that should be compiled separately for its libc and libm versions.
 calls = s_isinfF s_isnanF s_finiteF s_copysignF s_modfF s_scalbnF s_frexpF \
-	s_ldexpF s_signbitF
+	s_signbitF $(gen-calls)
+gen-calls = s_ldexpF
 generated += $(foreach s,.c .S,$(call type-foreach, $(calls:s_%=m_%$(s))))
 routines = $(call type-foreach, $(calls))
 
@@ -272,12 +273,15 @@ extra-objs += libieee.a ieee-math.o
 
 include ../Rules
 
-generated += $(addsuffix .c,$(call type-foreach,$(gen-libm-calls))) \
+gen-all-calls = $(gen-libm-calls) $(gen-calls)
+
+generated += $(addsuffix .c,$(call type-foreach,$(gen-all-calls))) \
 	     gen-libm-templates.stmp
 
 # Create wrappers in the math build directory.
-$(objpfx)gen-libm-templates.stmp:
-	for gcall in $(gen-libm-calls); do                                \
+$(objpfx)gen-libm-templates.stmp: Makefile
+	$(make-target-directory)
+	for gcall in $(gen-all-calls); do                                 \
 	  func=$${gcall%F*}$${gcall#*F};                                  \
 	  for type in $(foreach t,$(types),$(t)__$(type-$(t)-suffix)); do \
 	    suff=$${type#*__};                                            \
@@ -292,7 +296,7 @@ $(objpfx)gen-libm-templates.stmp:
 	echo > $(@)
 
 # Add dependency to ensure the generator runs prior.
-$(foreach t, $(call type-foreach, $(gen-libm-calls)), \
+$(foreach t, $(call type-foreach, $(gen-all-calls)), \
              $(objpfx)$(t).c): $(objpfx)gen-libm-templates.stmp
 
 ifneq (no,$(PERL))
@@ -334,6 +338,12 @@ endef
 object-suffixes-left := $(all-object-suffixes)
 include $(o-iterator)
 
+# Likewise, for those generated files shared with libc.
+define o-iterator-doit
+$(objpfx)m_%$o: $(objpfx)s_%.c $(before-compile); $$(compile-command.c)
+endef
+object-suffixes-left := $(all-object-suffixes)
+include $(o-iterator)
 
 # This file defines the default _LIB_VERSION variable that controls
 # the error return conventions for the math functions.
diff --git a/math/s_ldexp.c b/math/s_ldexp_template.c
similarity index 63%
rename from math/s_ldexp.c
rename to math/s_ldexp_template.c
index ee53695..42a8333 100644
--- a/math/s_ldexp.c
+++ b/math/s_ldexp_template.c
@@ -18,17 +18,15 @@ static char rcsid[] = "$NetBSD: s_ldexp.c,v 1.6 1995/05/10 20:47:40 jtc Exp $";
 #include <math_private.h>
 #include <errno.h>
 
-double __ldexp(double value, int exp)
+FLOAT
+M_SUF (__ldexp) (FLOAT value, int exp)
 {
-	if(!isfinite(value)||value==0.0) return value + value;
-	value = __scalbn(value,exp);
-	if(!isfinite(value)||value==0.0) __set_errno (ERANGE);
+	if(!isfinite(value)||value==0) return value + value;
+	value = M_SCALBN(value,exp);
+	if(!isfinite(value)||value==0) __set_errno (ERANGE);
 	return value;
 }
-weak_alias (__ldexp, ldexp)
-weak_alias (__ldexp, scalbn)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__ldexp, __ldexpl)
-weak_alias (__ldexp, ldexpl)
-weak_alias (__ldexp, scalbnl)
-#endif
+
+declare_mgen_alias_2 (__ldexp, ldexp, scalbn);
+
+/* Note, versioning issues are punted to ldbl-opt in this case.  */
diff --git a/math/s_ldexpf.c b/math/s_ldexpf.c
deleted file mode 100644
index b83062f..0000000
--- a/math/s_ldexpf.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* s_ldexpf.c -- float version of s_ldexp.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
- */
-
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: s_ldexpf.c,v 1.3 1995/05/10 20:47:42 jtc Exp $";
-#endif
-
-#include <math.h>
-#include <math_private.h>
-#include <errno.h>
-
-float __ldexpf(float value, int exp)
-{
-	if(!isfinite(value)||value==(float)0.0) return value + value;
-	value = __scalbnf(value,exp);
-	if(!isfinite(value)||value==(float)0.0) __set_errno (ERANGE);
-	return value;
-}
-weak_alias (__ldexpf, ldexpf)
-weak_alias (__ldexpf, scalbnf)
diff --git a/math/s_ldexpl.c b/math/s_ldexpl.c
deleted file mode 100644
index 52fb093..0000000
--- a/math/s_ldexpl.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* s_ldexpl.c -- long double version of s_ldexp.c.
- * Conversion to long double by Ulrich Drepper,
- * Cygnus Support, drepper@cygnus.com.
- */
-
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
-
-#include <math.h>
-#include <math_private.h>
-#include <errno.h>
-
-long double __ldexpl(long double value, int exp)
-{
-	if(!isfinite(value)||value==0.0) return value + value;
-	value = __scalbnl(value,exp);
-	if(!isfinite(value)||value==0.0) __set_errno (ERANGE);
-	return value;
-}
-weak_alias (__ldexpl, ldexpl)
-weak_alias (__ldexpl, scalbnl)
diff --git a/sysdeps/generic/math-type-macros-double.h b/sysdeps/generic/math-type-macros-double.h
index 154f416..284a6a4 100644
--- a/sysdeps/generic/math-type-macros-double.h
+++ b/sysdeps/generic/math-type-macros-double.h
@@ -34,9 +34,13 @@
    weak_alias (from, to)		    \
    strong_alias (from, from ## l)	    \
    weak_alias (from, to ## l)
-#elif !defined declare_mgen_alias
-# define declare_mgen_alias(from, to)	    \
-   weak_alias (M_SUF (from), M_SUF (to))
+#endif
+
+#if defined NO_LONG_DOUBLE && !defined declare_mgen_alias_2
+# define declare_mgen_alias_2(from, to, to2) \
+   declare_mgen_alias (from, to)	     \
+   weak_alias (from, to2)		     \
+   weak_alias (from, to2 ## l)
 #endif
 
 /* Supply the generic macros.  */
diff --git a/sysdeps/generic/math-type-macros.h b/sysdeps/generic/math-type-macros.h
index 259cb94..bd9e25a 100644
--- a/sysdeps/generic/math-type-macros.h
+++ b/sysdeps/generic/math-type-macros.h
@@ -38,6 +38,11 @@
       This exposes the appropriate symbol(s) for a
       function f of type FLOAT.
 
+  declare_mgen_alias_2(from,to,to2)
+      This exposes the appropriate symbol(s) for a
+      function f of type FLOAT when it is aliased
+      to two symbols.
+
   M_LIBM_NEED_COMPAT(func)
       This is utilized in macro context to indicate
       whether func should declare compat symbols.
@@ -112,6 +117,13 @@
 # define declare_mgen_alias(from, to) weak_alias (M_SUF (from), M_SUF (to))
 #endif
 
+/* Likewise, if two aliases are derived from the same symbol.  */
+#ifndef declare_mgen_alias_2
+# define declare_mgen_alias_2(from, to, to2)  \
+ declare_mgen_alias (from, to)		      \
+ declare_mgen_alias (from, to2)
+#endif
+
 /* Do not generate anything for compat symbols by default.  */
 #ifndef M_LIBM_NEED_COMPAT
 # define M_LIBM_NEED_COMPAT(func) 0
diff --git a/sysdeps/ieee754/ldbl-opt/s_ldexp.c b/sysdeps/ieee754/ldbl-opt/s_ldexp.c
index 20e107b..65f96e0 100644
--- a/sysdeps/ieee754/ldbl-opt/s_ldexp.c
+++ b/sysdeps/ieee754/ldbl-opt/s_ldexp.c
@@ -1,5 +1,26 @@
-#include <math_ldbl_opt.h>
-#include <math/s_ldexp.c>
+/* ldexp alias overrides for platforms where long double
+   was previously not unique.
+   Copyright (C) 2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define M_LIBM_NEED_COMPAT(f) 0
+#include <math-type-macros-double.h>
+#include <s_ldexp_template.c>
+
 #if IS_IN (libm)
 # if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
 compat_symbol (libm, __ldexp, ldexpl, GLIBC_2_0);
diff --git a/sysdeps/ieee754/ldbl-opt/s_ldexpl.c b/sysdeps/ieee754/ldbl-opt/s_ldexpl.c
index ed87a92..7a26437 100644
--- a/sysdeps/ieee754/ldbl-opt/s_ldexpl.c
+++ b/sysdeps/ieee754/ldbl-opt/s_ldexpl.c
@@ -1,7 +1,26 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_ldexpl.c>
+/* ldexpl alias overrides for platforms where long double
+   was previously not unique.
+   Copyright (C) 2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define declare_mgen_alias(f,t)
+#include <math-type-macros-ldouble.h>
+#include <s_ldexp_template.c>
+
 strong_alias (__ldexpl, __ldexpl_2)
 #if IS_IN (libm)
 long_double_symbol (libm, __ldexpl, ldexpl);

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

Summary of changes:
 ChangeLog                                          |   61 ++++++++++++++++++++
 math/Makefile                                      |   25 ++++++--
 math/{s_ldexp.c => s_ldexp_template.c}             |   20 +++----
 math/s_ldexpf.c                                    |   32 ----------
 math/s_ldexpl.c                                    |   33 -----------
 math/{s_nan.c => s_nan_template.c}                 |   16 +++---
 math/s_nanf.c                                      |   33 -----------
 math/s_nanl.c                                      |   33 -----------
 sysdeps/generic/math-type-macros-double.h          |   11 +++-
 sysdeps/generic/math-type-macros-float.h           |    1 +
 sysdeps/generic/math-type-macros-ldouble.h         |    1 +
 sysdeps/generic/math-type-macros.h                 |   17 +++++-
 sysdeps/generic/math_private.h                     |    7 --
 sysdeps/ieee754/ldbl-opt/math-type-macros-double.h |    1 +
 sysdeps/ieee754/ldbl-opt/s_ldexp.c                 |   25 +++++++-
 sysdeps/ieee754/ldbl-opt/s_ldexpl.c                |   27 +++++++-
 sysdeps/ieee754/ldbl-opt/s_nan.c                   |    5 --
 sysdeps/ieee754/ldbl-opt/s_nanl.c                  |    5 --
 18 files changed, 169 insertions(+), 184 deletions(-)
 rename math/{s_ldexp.c => s_ldexp_template.c} (63%)
 delete mode 100644 math/s_ldexpf.c
 delete mode 100644 math/s_ldexpl.c
 rename math/{s_nan.c => s_nan_template.c} (84%)
 delete mode 100644 math/s_nanf.c
 delete mode 100644 math/s_nanl.c
 delete mode 100644 sysdeps/ieee754/ldbl-opt/s_nan.c
 delete mode 100644 sysdeps/ieee754/ldbl-opt/s_nanl.c


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]