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.25-329-g477bf19


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  477bf19a590b6e6de65f326cb00dcb8999fa8b26 (commit)
      from  b2980e3c545294d71b3960ce74b6148e274d2488 (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=477bf19a590b6e6de65f326cb00dcb8999fa8b26

commit 477bf19a590b6e6de65f326cb00dcb8999fa8b26
Author: Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Date:   Fri Dec 9 11:41:55 2016 -0200

    float128: Extend __MATH_TG for float128 support
    
    	* math/math.h (__MATH_TG): Extend the conditions to add
    	_Float128 support.
    	* misc/sys/cdefs.h (__HAVE_GENERIC_SELECTION): New macro.

diff --git a/ChangeLog b/ChangeLog
index 6c03b36..d1b4523 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2017-05-17  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
+	    Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>
+
+	* math/math.h (__MATH_TG): Extend the conditions to add
+	_Float128 support.
+	* misc/sys/cdefs.h (__HAVE_GENERIC_SELECTION): New macro.
+
 2017-05-17  Paul A. Clarke  <pc@us.ibm.com>
 
 	* sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
diff --git a/math/math.h b/math/math.h
index 3b0bcad..5f006a8 100644
--- a/math/math.h
+++ b/math/math.h
@@ -340,6 +340,27 @@ extern int signgam;
 #ifdef __NO_LONG_DOUBLE_MATH
 # define __MATH_TG(TG_ARG, FUNC, ARGS)					\
   (sizeof (TG_ARG) == sizeof (float) ? FUNC ## f ARGS : FUNC ARGS)
+#elif __HAVE_DISTINCT_FLOAT128
+# if __HAVE_GENERIC_SELECTION
+#  define __MATH_TG(TG_ARG, FUNC, ARGS)		\
+     _Generic ((TG_ARG),			\
+	       float: FUNC ## f ARGS,		\
+	       default: FUNC ARGS,		\
+	       long double: FUNC ## l ARGS,	\
+	       _Float128: FUNC ## f128 ARGS)
+# else
+#  define __MATH_TG(TG_ARG, FUNC, ARGS)					\
+     __builtin_choose_expr						\
+     (__builtin_types_compatible_p (__typeof (TG_ARG), float),		\
+      FUNC ## f ARGS,							\
+      __builtin_choose_expr						\
+      (__builtin_types_compatible_p (__typeof (TG_ARG), double),	\
+       FUNC ARGS,							\
+       __builtin_choose_expr						\
+       (__builtin_types_compatible_p (__typeof (TG_ARG), long double),	\
+	FUNC ## l ARGS,							\
+	FUNC ## f128 ARGS)))
+# endif
 #else
 # define __MATH_TG(TG_ARG, FUNC, ARGS)		\
   (sizeof (TG_ARG) == sizeof (float)		\
diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
index 74f9a49..06523bf 100644
--- a/misc/sys/cdefs.h
+++ b/misc/sys/cdefs.h
@@ -464,4 +464,20 @@
 # define __glibc_macro_warning(msg)
 #endif
 
+/* Support for generic selection (ISO C11) is available in GCC since
+   version 4.9.  Previous versions do not provide generic selection,
+   even though they might set __STDC_VERSION__ to 201112L, when in
+   -std=c11 mode.  Thus, we must check for !defined __GNUC__ when
+   testing __STDC_VERSION__ for generic selection support.
+   On the other hand, Clang also defines __GNUC__, so a clang-specific
+   check is required to enable the use of generic selection.  */
+#if __GNUC_PREREQ (4, 9) \
+    || __glibc_clang_has_extension (c_generic_selections) \
+    || (!defined __GNUC__ && defined __STDC_VERSION__ \
+	&& __STDC_VERSION__ >= 201112L)
+# define __HAVE_GENERIC_SELECTION 1
+#else
+# define __HAVE_GENERIC_SELECTION 0
+#endif
+
 #endif	 /* sys/cdefs.h */

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

Summary of changes:
 ChangeLog        |    7 +++++++
 math/math.h      |   21 +++++++++++++++++++++
 misc/sys/cdefs.h |   16 ++++++++++++++++
 3 files changed, 44 insertions(+), 0 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]