aboutsummaryrefslogtreecommitdiff
path: root/gcc/ginclude
diff options
context:
space:
mode:
authorThomas Koenig <tkoenig@gcc.gnu.org>2021-01-03 21:40:04 +0100
committerThomas Koenig <tkoenig@gcc.gnu.org>2021-01-03 21:40:04 +0100
commitafae4a55ccaa0de95ea11e5f634084db6ab2f444 (patch)
treed632cc867d10410ba9fb750523be790b86846ac4 /gcc/ginclude
parent9d9a82ec8478ff52c7a9d61f58cd2a7b6295b5f9 (diff)
parentd2eb616a0f7bea78164912aa438c29fe1ef5774a (diff)
downloadgcc-afae4a55ccaa0de95ea11e5f634084db6ab2f444.zip
gcc-afae4a55ccaa0de95ea11e5f634084db6ab2f444.tar.gz
gcc-afae4a55ccaa0de95ea11e5f634084db6ab2f444.tar.bz2
Merge branch 'master' into devel/coarray_native
Diffstat (limited to 'gcc/ginclude')
-rw-r--r--gcc/ginclude/float.h86
-rw-r--r--gcc/ginclude/stdatomic.h14
-rw-r--r--gcc/ginclude/stdbool.h5
3 files changed, 97 insertions, 8 deletions
diff --git a/gcc/ginclude/float.h b/gcc/ginclude/float.h
index 9c4b038..39139ee 100644
--- a/gcc/ginclude/float.h
+++ b/gcc/ginclude/float.h
@@ -248,9 +248,45 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define DBL_NORM_MAX __DBL_NORM_MAX__
#define LDBL_NORM_MAX __LDBL_NORM_MAX__
+/* Whether each type matches an IEC 60559 format (1 for format, 2 for
+ format and operations). */
+#undef FLT_IS_IEC_60559
+#undef DBL_IS_IEC_60559
+#undef LDBL_IS_IEC_60559
+#define FLT_IS_IEC_60559 __FLT_IS_IEC_60559__
+#define DBL_IS_IEC_60559 __DBL_IS_IEC_60559__
+#define LDBL_IS_IEC_60559 __LDBL_IS_IEC_60559__
+
+/* Infinity in type float, or overflow if infinity not supported. */
+#undef INFINITY
+#define INFINITY (__builtin_inff ())
+
+/* Quiet NaN, if supported for float. */
+#if __FLT_HAS_QUIET_NAN__
+#undef NAN
+#define NAN (__builtin_nanf (""))
+#endif
+
+/* Signaling NaN, if supported for each type. All formats supported
+ by GCC support either both quiet and signaling NaNs, or neither
+ kind of NaN. */
+#if __FLT_HAS_QUIET_NAN__
+#undef FLT_SNAN
+#define FLT_SNAN (__builtin_nansf (""))
+#endif
+#if __DBL_HAS_QUIET_NAN__
+#undef DBL_SNAN
+#define DBL_SNAN (__builtin_nans (""))
+#endif
+#if __LDBL_HAS_QUIET_NAN__
+#undef LDBL_SNAN
+#define LDBL_SNAN (__builtin_nansl (""))
+#endif
+
#endif /* C2X */
-#ifdef __STDC_WANT_IEC_60559_BFP_EXT__
+#if (defined __STDC_WANT_IEC_60559_BFP_EXT__ \
+ || defined __STDC_WANT_IEC_60559_EXT__)
/* Number of decimal digits for which conversions between decimal
character strings and binary formats, in both directions, are
correctly rounded. */
@@ -284,6 +320,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define FLT16_DECIMAL_DIG __FLT16_DECIMAL_DIG__
#undef FLT16_TRUE_MIN
#define FLT16_TRUE_MIN __FLT16_DENORM_MIN__
+#if defined __STDC_VERSION__ && __STDC_VERSION__ > 201710L
+#undef FLT16_SNAN
+#define FLT16_SNAN (__builtin_nansf16 (""))
+#endif /* C2X */
#endif /* __FLT16_MANT_DIG__. */
#ifdef __FLT32_MANT_DIG__
@@ -309,6 +349,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define FLT32_DECIMAL_DIG __FLT32_DECIMAL_DIG__
#undef FLT32_TRUE_MIN
#define FLT32_TRUE_MIN __FLT32_DENORM_MIN__
+#if defined __STDC_VERSION__ && __STDC_VERSION__ > 201710L
+#undef FLT32_SNAN
+#define FLT32_SNAN (__builtin_nansf32 (""))
+#endif /* C2X */
#endif /* __FLT32_MANT_DIG__. */
#ifdef __FLT64_MANT_DIG__
@@ -334,6 +378,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define FLT64_DECIMAL_DIG __FLT64_DECIMAL_DIG__
#undef FLT64_TRUE_MIN
#define FLT64_TRUE_MIN __FLT64_DENORM_MIN__
+#if defined __STDC_VERSION__ && __STDC_VERSION__ > 201710L
+#undef FLT64_SNAN
+#define FLT64_SNAN (__builtin_nansf64 (""))
+#endif /* C2X */
#endif /* __FLT64_MANT_DIG__. */
#ifdef __FLT128_MANT_DIG__
@@ -359,6 +407,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define FLT128_DECIMAL_DIG __FLT128_DECIMAL_DIG__
#undef FLT128_TRUE_MIN
#define FLT128_TRUE_MIN __FLT128_DENORM_MIN__
+#if defined __STDC_VERSION__ && __STDC_VERSION__ > 201710L
+#undef FLT128_SNAN
+#define FLT128_SNAN (__builtin_nansf128 (""))
+#endif /* C2X */
#endif /* __FLT128_MANT_DIG__. */
#ifdef __FLT32X_MANT_DIG__
@@ -384,6 +436,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define FLT32X_DECIMAL_DIG __FLT32X_DECIMAL_DIG__
#undef FLT32X_TRUE_MIN
#define FLT32X_TRUE_MIN __FLT32X_DENORM_MIN__
+#if defined __STDC_VERSION__ && __STDC_VERSION__ > 201710L
+#undef FLT32X_SNAN
+#define FLT32X_SNAN (__builtin_nansf32x (""))
+#endif /* C2X */
#endif /* __FLT32X_MANT_DIG__. */
#ifdef __FLT64X_MANT_DIG__
@@ -409,6 +465,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define FLT64X_DECIMAL_DIG __FLT64X_DECIMAL_DIG__
#undef FLT64X_TRUE_MIN
#define FLT64X_TRUE_MIN __FLT64X_DENORM_MIN__
+#if defined __STDC_VERSION__ && __STDC_VERSION__ > 201710L
+#undef FLT64X_SNAN
+#define FLT64X_SNAN (__builtin_nansf64x (""))
+#endif /* C2X */
#endif /* __FLT64X_MANT_DIG__. */
#ifdef __FLT128X_MANT_DIG__
@@ -434,6 +494,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define FLT128X_DECIMAL_DIG __FLT128X_DECIMAL_DIG__
#undef FLT128X_TRUE_MIN
#define FLT128X_TRUE_MIN __FLT128X_DENORM_MIN__
+#if defined __STDC_VERSION__ && __STDC_VERSION__ > 201710L
+#undef FLT128X_SNAN
+#define FLT128X_SNAN (__builtin_nansf128x (""))
+#endif /* C2X */
#endif /* __FLT128X_MANT_DIG__. */
#endif /* __STDC_WANT_IEC_60559_TYPES_EXT__. */
@@ -537,6 +601,26 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#endif /* __STDC_WANT_IEC_60559_DFP_EXT__ || C2X. */
+#if defined __STDC_VERSION__ && __STDC_VERSION__ > 201710L
+
+/* Infinity in type _Decimal32. */
+#undef DEC_INFINITY
+#define DEC_INFINITY (__builtin_infd32 ())
+
+/* Quiet NaN in type _Decimal32. */
+#undef DEC_NAN
+#define DEC_NAN (__builtin_nand32 (""))
+
+/* Signaling NaN in each decimal floating-point type. */
+#undef DEC32_SNAN
+#define DEC32_SNAN (__builtin_nansd32 (""))
+#undef DEC64_SNAN
+#define DEC64_SNAN (__builtin_nansd64 (""))
+#undef DEC128_SNAN
+#define DEC128_SNAN (__builtin_nansd128 (""))
+
+#endif /* C2X */
+
#endif /* __DEC32_MANT_DIG__ */
#endif /* _FLOAT_H___ */
diff --git a/gcc/ginclude/stdatomic.h b/gcc/ginclude/stdatomic.h
index b968164..7c2e08a 100644
--- a/gcc/ginclude/stdatomic.h
+++ b/gcc/ginclude/stdatomic.h
@@ -107,7 +107,7 @@ extern void atomic_signal_fence (memory_order);
#define ATOMIC_POINTER_LOCK_FREE __GCC_ATOMIC_POINTER_LOCK_FREE
-/* Note that these macros require __typeof__ and __auto_type to remove
+/* Note that these macros require __auto_type to remove
_Atomic qualifiers (and const qualifiers, if those are valid on
macro operands).
@@ -122,7 +122,7 @@ extern void atomic_signal_fence (memory_order);
__extension__ \
({ \
__auto_type __atomic_store_ptr = (PTR); \
- __typeof__ (*__atomic_store_ptr) __atomic_store_tmp = (VAL); \
+ __typeof__ ((void)0, *__atomic_store_ptr) __atomic_store_tmp = (VAL); \
__atomic_store (__atomic_store_ptr, &__atomic_store_tmp, (MO)); \
})
@@ -134,7 +134,7 @@ extern void atomic_signal_fence (memory_order);
__extension__ \
({ \
__auto_type __atomic_load_ptr = (PTR); \
- __typeof__ (*__atomic_load_ptr) __atomic_load_tmp; \
+ __typeof__ ((void)0, *__atomic_load_ptr) __atomic_load_tmp; \
__atomic_load (__atomic_load_ptr, &__atomic_load_tmp, (MO)); \
__atomic_load_tmp; \
})
@@ -146,8 +146,8 @@ extern void atomic_signal_fence (memory_order);
__extension__ \
({ \
__auto_type __atomic_exchange_ptr = (PTR); \
- __typeof__ (*__atomic_exchange_ptr) __atomic_exchange_val = (VAL); \
- __typeof__ (*__atomic_exchange_ptr) __atomic_exchange_tmp; \
+ __typeof__ ((void)0, *__atomic_exchange_ptr) __atomic_exchange_val = (VAL); \
+ __typeof__ ((void)0, *__atomic_exchange_ptr) __atomic_exchange_tmp; \
__atomic_exchange (__atomic_exchange_ptr, &__atomic_exchange_val, \
&__atomic_exchange_tmp, (MO)); \
__atomic_exchange_tmp; \
@@ -161,7 +161,7 @@ extern void atomic_signal_fence (memory_order);
__extension__ \
({ \
__auto_type __atomic_compare_exchange_ptr = (PTR); \
- __typeof__ (*__atomic_compare_exchange_ptr) __atomic_compare_exchange_tmp \
+ __typeof__ ((void)0, *__atomic_compare_exchange_ptr) __atomic_compare_exchange_tmp \
= (DES); \
__atomic_compare_exchange (__atomic_compare_exchange_ptr, (VAL), \
&__atomic_compare_exchange_tmp, 0, \
@@ -176,7 +176,7 @@ extern void atomic_signal_fence (memory_order);
__extension__ \
({ \
__auto_type __atomic_compare_exchange_ptr = (PTR); \
- __typeof__ (*__atomic_compare_exchange_ptr) __atomic_compare_exchange_tmp \
+ __typeof__ ((void)0, *__atomic_compare_exchange_ptr) __atomic_compare_exchange_tmp \
= (DES); \
__atomic_compare_exchange (__atomic_compare_exchange_ptr, (VAL), \
&__atomic_compare_exchange_tmp, 1, \
diff --git a/gcc/ginclude/stdbool.h b/gcc/ginclude/stdbool.h
index 1b56498..2355422 100644
--- a/gcc/ginclude/stdbool.h
+++ b/gcc/ginclude/stdbool.h
@@ -31,8 +31,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#ifndef __cplusplus
#define bool _Bool
+#if defined __STDC_VERSION__ && __STDC_VERSION__ > 201710L
+#define true ((_Bool)+1u)
+#define false ((_Bool)+0u)
+#else
#define true 1
#define false 0
+#endif
#else /* __cplusplus */