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.26.9000-722-g4ca70e1


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  4ca70e1a2bb266756692ebfd0a757a960bc8796c (commit)
      from  ba0e6668f4630745378ac7b28732fad785806548 (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=4ca70e1a2bb266756692ebfd0a757a960bc8796c

commit 4ca70e1a2bb266756692ebfd0a757a960bc8796c
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Fri Nov 3 23:50:00 2017 +0000

    Handle more _FloatN, _FloatNx types in __MATH_TG.
    
    Continuing the preparation for additional _FloatN / _FloatNx type
    support, this patch prepares __MATH_TG to handle more such types.
    
    Various unhandled cases, which do not correspond to any current glibc
    configuration, have explicit #errors added.  _Float32 and _Float64x
    are then handled appropriately in the _Generic case, which is the only
    one, other than the cases where use of sizeof is sufficient, where
    they should ever be explicit types at the language level instead of
    typedefs.  There is no need to handle _Float64 or _Float32x explicitly
    there because the default case calling a double function is correct
    for those types.
    
    Tested for x86_64.
    
    	* math/math.h [__HAVE_DISTINCT_FLOAT16
    	|| __HAVE_DISTINCT_FLOAT32 || __HAVE_DISTINCT_FLOAT64
    	|| __HAVE_DISTINCT_FLOAT32X || __HAVE_DISTINCT_FLOAT64X
    	|| __HAVE_DISTINCT_FLOAT128X]: Use #error.
    	[__NO_LONG_DOUBLE_MATH && __HAVE_DISTINCT_FLOAT128]: Likewise.
    	[__HAVE_DISTINCT_FLOAT128 && !__HAVE_GENERIC_SELECTION
    	&& __HAVE_FLOATN_NOT_TYPEDEF]: Likewise.
    	[__HAVE_DISTINCT_FLOAT128 && __HAVE_GENERIC_SELECTION]
    	(__MATH_TG_F32): New macro.
    	[__HAVE_DISTINCT_FLOAT128 && __HAVE_GENERIC_SELECTION]
    	(__MATH_TG_F64X): Likewise.
    	[__HAVE_DISTINCT_FLOAT128 && __HAVE_GENERIC_SELECTION]
    	(__MATH_TG): Use __MATH_TG_F32 and __MATH_TG_F64X.

diff --git a/ChangeLog b/ChangeLog
index f862d9c..44d5518 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2017-11-03  Joseph Myers  <joseph@codesourcery.com>
+
+	* math/math.h [__HAVE_DISTINCT_FLOAT16
+	|| __HAVE_DISTINCT_FLOAT32 || __HAVE_DISTINCT_FLOAT64
+	|| __HAVE_DISTINCT_FLOAT32X || __HAVE_DISTINCT_FLOAT64X
+	|| __HAVE_DISTINCT_FLOAT128X]: Use #error.
+	[__NO_LONG_DOUBLE_MATH && __HAVE_DISTINCT_FLOAT128]: Likewise.
+	[__HAVE_DISTINCT_FLOAT128 && !__HAVE_GENERIC_SELECTION
+	&& __HAVE_FLOATN_NOT_TYPEDEF]: Likewise.
+	[__HAVE_DISTINCT_FLOAT128 && __HAVE_GENERIC_SELECTION]
+	(__MATH_TG_F32): New macro.
+	[__HAVE_DISTINCT_FLOAT128 && __HAVE_GENERIC_SELECTION]
+	(__MATH_TG_F64X): Likewise.
+	[__HAVE_DISTINCT_FLOAT128 && __HAVE_GENERIC_SELECTION]
+	(__MATH_TG): Use __MATH_TG_F32 and __MATH_TG_F64X.
+
 2017-11-03  Dmitry V. Levin  <ldv@altlinux.org>
 
 	* po/de.po: Update translations.
diff --git a/math/math.h b/math/math.h
index 326fd8e..f6d1fee 100644
--- a/math/math.h
+++ b/math/math.h
@@ -489,6 +489,14 @@ extern long double __REDIRECT_NTH (nexttowardl,
 extern int signgam;
 #endif
 
+#if (__HAVE_DISTINCT_FLOAT16			\
+     || __HAVE_DISTINCT_FLOAT32			\
+     || __HAVE_DISTINCT_FLOAT64			\
+     || __HAVE_DISTINCT_FLOAT32X		\
+     || __HAVE_DISTINCT_FLOAT64X		\
+     || __HAVE_DISTINCT_FLOAT128X)
+# error "Unsupported _FloatN or _FloatNx types for <math.h>."
+#endif
 
 /* Depending on the type of TG_ARG, call an appropriately suffixed
    version of FUNC with arguments (including parentheses) ARGS.
@@ -500,17 +508,39 @@ extern int signgam;
    return the same type (FUNC may include a cast if necessary rather
    than being a single identifier).  */
 #ifdef __NO_LONG_DOUBLE_MATH
+# if __HAVE_DISTINCT_FLOAT128
+#  error "Distinct _Float128 without distinct long double not supported."
+# endif
 # 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)		\
+#  if __HAVE_FLOATN_NOT_TYPEDEF && __HAVE_FLOAT32
+#   define __MATH_TG_F32(FUNC, ARGS) _Float32: FUNC ## f ARGS,
+#  else
+#   define __MATH_TG_F32(FUNC, ARGS)
+#  endif
+#  if __HAVE_FLOATN_NOT_TYPEDEF && __HAVE_FLOAT64X
+#   if __HAVE_FLOAT64X_LONG_DOUBLE
+#    define __MATH_TG_F64X(FUNC, ARGS) _Float64x: FUNC ## l ARGS,
+#   else
+#    define __MATH_TG_F64X(FUNC, ARGS) _Float64x: FUNC ## f128 ARGS,
+#   endif
+#  else
+#   define __MATH_TG_F64X(FUNC, ARGS)
+#  endif
+#  define __MATH_TG(TG_ARG, FUNC, ARGS)	\
      _Generic ((TG_ARG),			\
 	       float: FUNC ## f ARGS,		\
+	       __MATH_TG_F32 (FUNC, ARGS)	\
 	       default: FUNC ARGS,		\
 	       long double: FUNC ## l ARGS,	\
+	       __MATH_TG_F64X (FUNC, ARGS)	\
 	       _Float128: FUNC ## f128 ARGS)
 # else
+#  if __HAVE_FLOATN_NOT_TYPEDEF
+#   error "Non-typedef _FloatN but no _Generic."
+#  endif
 #  define __MATH_TG(TG_ARG, FUNC, ARGS)					\
      __builtin_choose_expr						\
      (__builtin_types_compatible_p (__typeof (TG_ARG), float),		\

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

Summary of changes:
 ChangeLog   |   16 ++++++++++++++++
 math/math.h |   32 +++++++++++++++++++++++++++++++-
 2 files changed, 47 insertions(+), 1 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]