This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch master updated. glibc-2.26.9000-719-g86ec486
- From: jsm28 at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 3 Nov 2017 21:12:16 -0000
- Subject: GNU C Library master sources branch master updated. glibc-2.26.9000-719-g86ec486
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 86ec486597056f93ebc215fc6a7f3bf5431d91f1 (commit)
from 9725517070c1dda41aa3676cf1cf61daa527e14e (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=86ec486597056f93ebc215fc6a7f3bf5431d91f1
commit 86ec486597056f93ebc215fc6a7f3bf5431d91f1
Author: Joseph Myers <joseph@codesourcery.com>
Date: Fri Nov 3 21:11:50 2017 +0000
Handle more _FloatN, _FloatNx types in tgmath.h.
Continuing the preparation for additional _FloatN / _FloatNx type
support, this patch improves how <tgmath.h> handles such types.
Use of #error is added for cases of distinct types that are not
supported by the header, to indicate that additional work on the
header would be needed if, for example, _Float16 support were added to
glibc. Given that #error, types with the same format as other types
are handled automatically by the sizeof-based logic, so the only case
needing special handling is that where _Float64x exists, has the same
format as _Float128, does not have the same format as long double, and
is not a typedef for _Float128. In this case (which will apply for
powerpc64le once _Float64x support is added to glibc), the
__builtin_types_compatible_p calls testing for _Float128 need
corresponding calls testing for _Float64x, which this patch adds.
Tested for x86_64.
* math/tgmath.h [__HAVE_DISTINCT_FLOAT16
|| __HAVE_DISTINCT_FLOAT32 || __HAVE_DISTINCT_FLOAT64
|| __HAVE_DISTINCT_FLOAT32X || __HAVE_DISTINCT_FLOAT64X
|| __HAVE_DISTINCT_FLOAT128X]: Use #error.
[__HAVE_DISTINCT_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
&& __HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE
&& __HAVE_FLOATN_NOT_TYPEDEF] (__TGMATH_F128): Handle _Float64x
the same as _Float128.
[__HAVE_DISTINCT_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
&& __HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE
&& __HAVE_FLOATN_NOT_TYPEDEF] (__TGMATH_CF128): Likewise.
diff --git a/ChangeLog b/ChangeLog
index aa115b6..e8913ba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
2017-11-03 Joseph Myers <joseph@codesourcery.com>
+ * math/tgmath.h [__HAVE_DISTINCT_FLOAT16
+ || __HAVE_DISTINCT_FLOAT32 || __HAVE_DISTINCT_FLOAT64
+ || __HAVE_DISTINCT_FLOAT32X || __HAVE_DISTINCT_FLOAT64X
+ || __HAVE_DISTINCT_FLOAT128X]: Use #error.
+ [__HAVE_DISTINCT_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
+ && __HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE
+ && __HAVE_FLOATN_NOT_TYPEDEF] (__TGMATH_F128): Handle _Float64x
+ the same as _Float128.
+ [__HAVE_DISTINCT_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
+ && __HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE
+ && __HAVE_FLOATN_NOT_TYPEDEF] (__TGMATH_CF128): Likewise.
+
* stdlib/stdlib.h
[__HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strtof16):
Declare.
diff --git a/math/tgmath.h b/math/tgmath.h
index 243813c..108c1a1 100644
--- a/math/tgmath.h
+++ b/math/tgmath.h
@@ -115,18 +115,45 @@
__real_integer_type (__typeof__ (+(expr))), \
__complex_integer_type (__typeof__ (+(expr))))
+# 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 <tgmath.h>."
+# endif
+
/* Expand to text that checks if ARG_COMB has type _Float128, and if
so calls the appropriately suffixed FCT (which may include a cast),
or FCT and CFCT for complex functions, with arguments ARG_CALL. */
# if __HAVE_DISTINCT_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
-# define __TGMATH_F128(arg_comb, fct, arg_call) \
+# if (!__HAVE_FLOAT64X \
+ || __HAVE_FLOAT64X_LONG_DOUBLE \
+ || !__HAVE_FLOATN_NOT_TYPEDEF)
+# define __TGMATH_F128(arg_comb, fct, arg_call) \
__builtin_types_compatible_p (__typeof (+(arg_comb)), _Float128) \
? fct ## f128 arg_call :
-# define __TGMATH_CF128(arg_comb, fct, cfct, arg_call) \
+# define __TGMATH_CF128(arg_comb, fct, cfct, arg_call) \
__builtin_types_compatible_p (__typeof (+__real__ (arg_comb)), _Float128) \
? (__expr_is_real (arg_comb) \
? fct ## f128 arg_call \
: cfct ## f128 arg_call) :
+# else
+/* _Float64x is a distinct type at the C language level, which must be
+ handled like _Float128. */
+# define __TGMATH_F128(arg_comb, fct, arg_call) \
+ (__builtin_types_compatible_p (__typeof (+(arg_comb)), _Float128) \
+ || __builtin_types_compatible_p (__typeof (+(arg_comb)), _Float64x)) \
+ ? fct ## f128 arg_call :
+# define __TGMATH_CF128(arg_comb, fct, cfct, arg_call) \
+ (__builtin_types_compatible_p (__typeof (+__real__ (arg_comb)), _Float128) \
+ || __builtin_types_compatible_p (__typeof (+__real__ (arg_comb)), \
+ _Float64x)) \
+ ? (__expr_is_real (arg_comb) \
+ ? fct ## f128 arg_call \
+ : cfct ## f128 arg_call) :
+# endif
# else
# define __TGMATH_F128(arg_comb, fct, arg_call) /* Nothing. */
# define __TGMATH_CF128(arg_comb, fct, cfct, arg_call) /* Nothing. */
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 12 ++++++++++++
math/tgmath.h | 31 +++++++++++++++++++++++++++++--
2 files changed, 41 insertions(+), 2 deletions(-)
hooks/post-receive
--
GNU C Library master sources