2019-08-13 Joseph Myers <joseph@codesourcery.com>
+ * bits/libc-header-start.h (__GLIBC_USE_IEC_60559_BFP_EXT): Update
+ comment.
+ (__GLIBC_USE_IEC_60559_BFP_EXT_C2X): New macro.
+ * bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]: Change to
+ [__GLIBC_USE (IEC_60559_BFP_EXT_C2X)].
+ * include/limits.h [__GLIBC_USE (IEC_60559_BFP_EXT)]: Likewise.
+ * math/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]: Likewise.
+ * math/math.h [__GLIBC_USE (IEC_60559_BFP_EXT)]: Likewise.
+ * stdlib/bits/stdlib-ldbl.h [__GLIBC_USE (IEC_60559_BFP_EXT)]:
+ Likewise.
+ * stdlib/stdint.h [__GLIBC_USE (IEC_60559_BFP_EXT)]: Likewise.
+ * stdlib/stdlib.h [__GLIBC_USE (IEC_60559_BFP_EXT)]: Likewise.
+ * sysdeps/aarch64/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]:
+ Likewise.
+ * sysdeps/alpha/fpu/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]:
+ Likewise.
+ * sysdeps/arm/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]:
+ Likewise.
+ * sysdeps/csky/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]:
+ Likewise.
+ * sysdeps/hppa/fpu/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]:
+ Likewise.
+ * sysdeps/ia64/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]:
+ Likewise.
+ * sysdeps/m68k/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]:
+ Likewise.
+ * sysdeps/microblaze/bits/fenv.h [__GLIBC_USE
+ (IEC_60559_BFP_EXT)]: Likewise.
+ * sysdeps/mips/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]:
+ Likewise.
+ * sysdeps/nios2/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]:
+ Likewise.
+ * sysdeps/powerpc/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]:
+ Likewise.
+ * sysdeps/riscv/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]:
+ Likewise.
+ * sysdeps/s390/fpu/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]:
+ Likewise.
+ * sysdeps/sh/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]:
+ Likewise.
+ * sysdeps/sparc/fpu/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]:
+ Likewise.
+ * sysdeps/x86/fpu/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]:
+ Likewise.
+ * math/bits/mathcalls.h [__GLIBC_USE (IEC_60559_BFP_EXT)]:
+ Likewise, except for totalorder, totalordermag, getpayload,
+ setpayload and setpayloadsig.
+ * math/tgmath.h [__GLIBC_USE (IEC_60559_BFP_EXT)]: Likewise,
+ except for totalorder and totalordermag.
+
* string/string.h (memccpy): Also declare if [__GLIBC_USE (ISOC2X)].
(strdup): Likewise.
(strndup): Likewise.
/* If the default argument is used we use this value. */
#define FE_DFL_ENV ((const fenv_t *) -1l)
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
/* Type representing floating-point control modes. */
typedef unsigned int femode_t;
#endif
/* ISO/IEC TS 18661-1:2014 defines the __STDC_WANT_IEC_60559_BFP_EXT__
- macro. */
+ macro. Most but not all symbols enabled by that macro in TS
+ 18661-1 are enabled unconditionally in C2X; the symbols in Annex F
+ still require that macro in C2X. */
#undef __GLIBC_USE_IEC_60559_BFP_EXT
#if defined __USE_GNU || defined __STDC_WANT_IEC_60559_BFP_EXT__
# define __GLIBC_USE_IEC_60559_BFP_EXT 1
#else
# define __GLIBC_USE_IEC_60559_BFP_EXT 0
#endif
+#undef __GLIBC_USE_IEC_60559_BFP_EXT_C2X
+#if __GLIBC_USE (IEC_60559_BFP_EXT) || __GLIBC_USE (ISOC2X)
+# define __GLIBC_USE_IEC_60559_BFP_EXT_C2X 1
+#else
+# define __GLIBC_USE_IEC_60559_BFP_EXT_C2X 0
+#endif
/* ISO/IEC TS 18661-4:2015 defines the
__STDC_WANT_IEC_60559_FUNCS_EXT__ macro. */
/* The integer width macros are not defined by GCC's <limits.h> before
GCC 7, or if _GNU_SOURCE rather than
__STDC_WANT_IEC_60559_BFP_EXT__ is used to enable this feature. */
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
# ifndef CHAR_WIDTH
# define CHAR_WIDTH 8
# endif
__MATHCALL (nexttoward,, (_Mdouble_ __x, long double __y));
# endif
-# if __GLIBC_USE (IEC_60559_BFP_EXT) || __MATH_DECLARING_FLOATN
+# if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) || __MATH_DECLARING_FLOATN
/* Return X - epsilon. */
__MATHCALL (nextdown,, (_Mdouble_ __x));
/* Return X + epsilon. */
__MATHDECL (int,ilogb,, (_Mdouble_ __x));
#endif
-#if __GLIBC_USE (IEC_60559_BFP_EXT) || __MATH_DECLARING_FLOATN
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) || __MATH_DECLARING_FLOATN
/* Like ilogb, but returning long int. */
__MATHDECL (long int, llogb,, (_Mdouble_ __x));
#endif
__MATHCALL (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z));
#endif /* Use ISO C99. */
-#if __GLIBC_USE (IEC_60559_BFP_EXT) || __MATH_DECLARING_FLOATN
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) || __MATH_DECLARING_FLOATN
/* Round X to nearest integer value, rounding halfway cases to even. */
__MATHCALLX (roundeven,, (_Mdouble_ __x), (__const__));
/* Return value with minimum magnitude. */
__MATHCALLX (fminmag,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
+/* Canonicalize floating-point representation. */
+__MATHDECL_1 (int, canonicalize,, (_Mdouble_ *__cx, const _Mdouble_ *__x));
+#endif
+
+#if __GLIBC_USE (IEC_60559_BFP_EXT) || __MATH_DECLARING_FLOATN
/* Total order operation. */
__MATHDECL_1 (int, totalorder,, (_Mdouble_ __x, _Mdouble_ __y))
__attribute__ ((__const__));
__MATHDECL_1 (int, totalordermag,, (_Mdouble_ __x, _Mdouble_ __y))
__attribute__ ((__const__));
-/* Canonicalize floating-point representation. */
-__MATHDECL_1 (int, canonicalize,, (_Mdouble_ *__cx, const _Mdouble_ *__x));
-
/* Get NaN payload. */
__MATHCALL (getpayload,, (const _Mdouble_ *__x));
/* Raise the supported exceptions represented by EXCEPTS. */
extern int feraiseexcept (int __excepts) __THROW;
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
/* Set the supported exception flags represented by EXCEPTS, without
causing enabled traps to be taken. */
extern int fesetexcept (int __excepts) __THROW;
currently set. */
extern int fetestexcept (int __excepts) __THROW;
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
/* Determine which of subset of the exceptions specified by EXCEPTS
are set in *FLAGP. */
extern int fetestexceptflag (const fexcept_t *__flagp, int __excepts) __THROW;
/* Control modes. */
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
/* Store the current floating-point control modes in the object
pointed to by MODEP. */
extern int fegetmode (femode_t *__modep) __THROW;
/* NaN support. */
-#if (__GLIBC_USE (IEC_60559_BFP_EXT) \
+#if (__GLIBC_USE (IEC_60559_BFP_EXT_C2X) \
&& defined FE_INVALID \
&& defined __SUPPORT_SNAN__)
# define FE_SNANS_ALWAYS_SIGNAL 1
# endif
#endif /* __USE_ISOC99 */
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
/* Signaling NaN macros, if supported. */
# if __GNUC_PREREQ (3, 3)
# define SNANF (__builtin_nansf (""))
# define FP_ILOGBNAN 2147483647
# endif
#endif
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
# if __WORDSIZE == 32
# define __FP_LONG_MAX 0x7fffffffL
# else
#include <bits/fp-fast.h>
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
/* Rounding direction macros for fromfp functions. */
enum
{
#define __MATHCALL_NARROW(func, redir, nargs) \
__MATHCALL_NARROW_NORMAL (func, nargs)
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
# define _Mret_ float
# define _Marg_ double
#endif /* Use ISO C99. */
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
# include <bits/iscanonical.h>
/* Return nonzero value if X is a signaling NaN. */
#endif /* __FINITE_MATH_ONLY__ > 0. */
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
/* An expression whose type has the widest of the evaluation formats
of X and Y (which are of floating-point types). */
# if __FLT_EVAL_METHOD__ == 2 || __FLT_EVAL_METHOD__ > 64
prevailing rounding mode. */
#define rint(Val) __TGMATH_UNARY_REAL_ONLY (Val, rint)
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
/* Return X - epsilon. */
# define nextdown(Val) __TGMATH_UNARY_REAL_ONLY (Val, nextdown)
/* Return X + epsilon. */
#define fma(Val1, Val2, Val3) \
__TGMATH_TERNARY_REAL_ONLY (Val1, Val2, Val3, fma)
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
/* Round X to nearest integer value, rounding halfway cases to even. */
# define roundeven(Val) __TGMATH_UNARY_REAL_ONLY (Val, roundeven)
/* Return value with minimum magnitude. */
# define fminmag(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, fminmag)
+#endif
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
/* Total order operation. */
# define totalorder(Val1, Val2) \
__TGMATH_BINARY_REAL_RET_ONLY (Val1, Val2, totalorder)
__LDBL_REDIR1_DECL (strtold_l, strtod_l)
#endif
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
__LDBL_REDIR1_DECL (strfroml, strfromd)
#endif
# define UINTMAX_C(c) c ## ULL
# endif
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
# define INT8_WIDTH 8
# define UINT8_WIDTH 8
#endif /* ISO C99 or use MISC. */
/* Convert a floating-point number to a string. */
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
extern int strfromd (char *__dest, size_t __size, const char *__format,
double __f)
__THROW __nonnull ((3));
# define FE_NOMASK_ENV ((const fenv_t *) -2)
#endif
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
/* Type representing floating-point control modes. */
typedef unsigned int femode_t;
extern unsigned long int __ieee_get_fp_control (void) __THROW;
extern void __ieee_set_fp_control (unsigned long int __value) __THROW;
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
/* Type representing floating-point control modes. */
typedef unsigned long int femode_t;
# define FE_NOMASK_ENV ((const fenv_t *) -2)
#endif
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
/* Type representing floating-point control modes. */
typedef unsigned int femode_t;
# define FE_NOMASK_ENV ((const fenv_t *) -2)
#endif
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
/* Type representing floating-point control modes. */
typedef unsigned int femode_t;
# define FE_NOMASK_ENV ((const fenv_t *) -2)
#endif
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
/* Type representing floating-point control modes. */
typedef unsigned int femode_t;
# define FE_NONIEEE_ENV ((const fenv_t *) 0xc009a04d0270037fUL)
#endif
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
/* Type representing floating-point control modes. */
typedef unsigned long int femode_t;
# define FE_NOMASK_ENV ((const fenv_t *) -2)
#endif
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
/* Type representing floating-point control modes. */
typedef unsigned int femode_t;
/* If the default argument is used we use this value. */
#define FE_DFL_ENV ((const fenv_t *) -1l)
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
/* Type representing floating-point control modes. */
typedef unsigned int femode_t;
# define FE_NOMASK_ENV ((const fenv_t *) -2)
#endif
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
/* Type representing floating-point control modes. */
typedef unsigned int femode_t;
/* If the default argument is used we use this value. */
#define FE_DFL_ENV ((const fenv_t *) -1)
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
/* Type representing floating-point control modes. */
typedef unsigned int femode_t;
#endif
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
/* Type representing floating-point control modes. */
typedef double femode_t;
/* If the default argument is used we use this value. */
#define FE_DFL_ENV ((__const fenv_t *) -1)
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
/* Type representing floating-point control modes. */
typedef unsigned int femode_t;
# define FE_NOMASK_ENV ((const fenv_t *) -2)
#endif
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
/* Type representing floating-point control modes. */
typedef unsigned int femode_t;
/* If the default argument is used we use this value. */
#define FE_DFL_ENV ((const fenv_t *) -1)
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
/* Type representing floating-point control modes. */
typedef unsigned int femode_t;
# define __fenv_ldfsr(X) __asm__ __volatile__ ("ld %0,%%fsr" : : "m" (X))
#endif
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
/* Type representing floating-point control modes. */
typedef unsigned long int femode_t;
# define FE_NOMASK_ENV ((const fenv_t *) -2)
#endif
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X)
/* Type representing floating-point control modes. */
typedef struct
{