+2018-05-16 Florian Weimer <fweimer@redhat.com>
+
+ * stdlib/strtod_nan.c: Include <math-type-macros-double.h> instead
+ of <strtod_nan_double.h>.
+ * stdlib/strtod_nan_main.c (STRTOD_NAN): Use SET_NAN_PAYLOAD
+ instead of SET_MANTISSA.
+ * stdlib/strtof_nan.c: Include <math-type-macros-float.h> instead
+ of include <strtod_nan_float.h>.
+ * stdlib/strtold_nan.c: Include <math-type-macros-ldouble.h>
+ instead of <strtod_nan_ldouble.h>.
+ * stdlib/strtod_nan_double.h: Move to ...
+ * sysdeps/generic/math-nan-payload-double.h: ... here.
+ (FLOAT): Remove definition.
+ (SET_MANTISSA): Rename to ...
+ (SET_NAN_PAYLOAD): ... this.
+ * stdlib/strtod_nan_float.h: Move to ...
+ * sysdeps/generic/math-nan-payload-float.h: ... here.
+ (FLOAT): Remove definition.
+ (SET_MANTISSA): Rename to ...
+ (SET_NAN_PAYLOAD): ... this.
+ * sysdeps/generic/math-type-macros-double.h: Include
+ <math-nan-payload-double.h>. Include <math/math-svid-compat.h>
+ instead of <math-svid-compat.h>.
+ * sysdeps/generic/math-type-macros-float.h: Include
+ <math-nan-payload-float.h>. Include <math/math-svid-compat.h>
+ instead of <math-svid-compat.h>.
+ * sysdeps/generic/math-type-macros-float128.h: Include
+ <math-nan-payload-float128.h>.
+ * sysdeps/generic/math-type-macros-ldouble.h: Include
+ <math-nan-payload-ldouble.h>. Include <math/math-svid-compat.h>
+ instead of <math-svid-compat.h>.
+ * sysdeps/generic/math-type-macros.h: Document SET_NAN_PAYLOAD and
+ check for definition.
+ * sysdeps/ieee754/float128/strtod_nan_float128.h: Move to ...
+ * sysdeps/ieee754/float128/math-nan-payload-float128.h: ... here.
+ Include <ieee754_float128.h>.
+ (FLOAT): Remove definition.
+ (SET_MANTISSA): Rename to ...
+ (SET_NAN_PAYLOAD): ... this.
+ * sysdeps/ieee754/float128/strtof128_nan.c: Include
+ <math-type-macros-float128.h> instead of <strtod_nan_float128.h>.
+ Do not include <float128_private.h>.
+ * sysdeps/ieee754/float128/wcstof128_nan.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/strtod_nan_ldouble.h: Move to ...
+ * sysdeps/ieee754/ldbl-128/math-nan-payload-ldouble.h: ... here.
+ (FLOAT): Remove definition.
+ (SET_MANTISSA): Rename to ...
+ (SET_NAN_PAYLOAD): ... this.
+ * sysdeps/ieee754/ldbl-128ibm/strtod_nan_ldouble.h: Move to ...
+ * sysdeps/ieee754/ldbl-128ibm/math-nan-payload-ldouble.h: ... here.
+ (FLOAT): Remove definition.
+ (SET_MANTISSA): Rename to ...
+ (SET_NAN_PAYLOAD): ... this.
+ * sysdeps/ieee754/ldbl-96/strtod_nan_ldouble.h: Move to ...
+ * sysdeps/ieee754/ldbl-96/math-nan-payload-ldouble.h: ... here.
+ (FLOAT): Remove definition.
+ (SET_MANTISSA): Rename to ...
+ (SET_NAN_PAYLOAD): ... this.
+ * wcsmbs/wcstod_nan.c: Include <math-type-macros-double.h> instead
+ of "../stdlib/strtod_nan_double.h".
+ * wcsmbs/wcstof_nan.c: Include <math-type-macros-float.h> instead
+ of "../stdlib/strtod_nan_float.h".
+ * wcsmbs/wcstold_nan.c: Include <math-type-macros-ldouble.h>
+ instead of "../stdlib/strtod_nan_ldouble.h".
+ * manual/arith.texi (Parsing of Floats): Adjust comment.
+
2018-05-16 Joseph Myers <joseph@codesourcery.com>
* math/Makefile (libm-narrow-fns): Add mul.
@c mpn_lshift_1 -> mpn_lshift ok
@c STRTOF_INTERNAL
@c MPN_VAR ok
-@c SET_MANTISSA ok
+@c SET_NAN_PAYLOAD ok
@c STRNCASECMP ok, wide and narrow
@c round_and_return ok
@c mpn_mul ok
<http://www.gnu.org/licenses/>. */
#include <strtod_nan_narrow.h>
-#include <strtod_nan_double.h>
+#include <math-type-macros-double.h>
#define STRTOD_NAN __strtod_nan
#include <strtod_nan_main.c>
mant = STRTOULL (str, &endp, 0);
if (endp == cp)
- SET_MANTISSA (retval, mant);
+ SET_NAN_PAYLOAD (retval, mant);
out:
if (endptr != NULL)
<http://www.gnu.org/licenses/>. */
#include <strtod_nan_narrow.h>
-#include <strtod_nan_float.h>
+#include <math-type-macros-float.h>
#define STRTOD_NAN __strtof_nan
#include <strtod_nan_main.c>
representation. */
#ifndef __NO_LONG_DOUBLE_MATH
# include <strtod_nan_narrow.h>
-# include <strtod_nan_ldouble.h>
+# include <math-type-macros-ldouble.h>
# define STRTOD_NAN __strtold_nan
# include <strtod_nan_main.c>
-/* Convert string for NaN payload to corresponding NaN. For double.
+/* NaN payload handling for double.
Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FLOAT double
-#define SET_MANTISSA(flt, mant) \
+#define SET_NAN_PAYLOAD(flt, mant) \
do \
{ \
union ieee754_double u; \
-/* Convert string for NaN payload to corresponding NaN. For float.
+/* NaN payload handling for float.
Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FLOAT float
-#define SET_MANTISSA(flt, mant) \
+#define SET_NAN_PAYLOAD(flt, mant) \
do \
{ \
union ieee754_float u; \
#define CFLOAT _Complex double
#define M_STRTO_NAN __strtod_nan
+#include <math-nan-payload-double.h>
#include <libm-alias-double.h>
#ifndef declare_mgen_alias
/* Do not use the type-generic wrapper templates if compatibility with
SVID error handling is needed. */
-#include <math-svid-compat.h>
+#include <math/math-svid-compat.h>
#define __USE_WRAPPER_TEMPLATE !LIBM_SVID_COMPAT
#endif
the double macro constants. */
#define M_MLIT(c) c
+#include <math-nan-payload-float.h>
#include <libm-alias-float.h>
#ifndef declare_mgen_alias
/* Do not use the type-generic wrapper templates if compatibility with
SVID error handling is needed. */
-#include <math-svid-compat.h>
+#include <math/math-svid-compat.h>
#define __USE_WRAPPER_TEMPLATE !LIBM_SVID_COMPAT
#endif
#define M_MLIT(c) c ## f128
+#include <math-nan-payload-float128.h>
#include <libm-alias-float128.h>
#ifndef declare_mgen_alias
#define CFLOAT _Complex long double
#define M_STRTO_NAN __strtold_nan
+#include <math-nan-payload-ldouble.h>
#include <libm-alias-ldouble.h>
#ifndef declare_mgen_alias
/* Do not use the type-generic wrapper templates if compatibility with
SVID error handling is needed. */
-#include <math-svid-compat.h>
+#include <math/math-svid-compat.h>
#define __USE_WRAPPER_TEMPLATE !LIBM_SVID_COMPAT
#endif
declare_mgen_alias_r(from,to)
This exposes the appropriate symbol(s) for a
- function f_r of type FLOAT. */
+ function f_r of type FLOAT.
+
+ SET_NAN_PAYLOAD(flt, mant)
+ Set the NaN payload bits of the variable FLT of type FLOAT to
+ the mantissa MANT. */
#ifndef M_PFX
# error "M_PFX must be defined."
#ifndef declare_mgen_alias_r
# error "declare_mgen_alias_r must be defined."
#endif
+#ifndef SET_NAN_PAYLOAD
+# error "SET_NAN_PAYLOAD must be defined."
+#endif
#define __M_CONCAT(a,b) a ## b
#define __M_CONCATX(a,b) __M_CONCAT(a,b)
-/* Convert string for NaN payload to corresponding NaN. For _Float128.
+/* NaN payload handling for _Float128.
Copyright (C) 2017-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FLOAT _Float128
-#define SET_MANTISSA(flt, mant) \
+#include <ieee754_float128.h>
+
+#define SET_NAN_PAYLOAD(flt, mant) \
do \
{ \
union ieee854_float128 u; \
#include <math.h>
-#include <float128_private.h>
-
#include <strtod_nan_narrow.h>
-#include <strtod_nan_float128.h>
+#include <math-type-macros-float128.h>
#define STRTOD_NAN __strtof128_nan
#include <stdlib/strtod_nan_main.c>
<http://www.gnu.org/licenses/>. */
#include <stdlib/strtod_nan_wide.h>
-#include <float128_private.h>
-#include <strtod_nan_float128.h>
+#include <math-type-macros-float128.h>
#define STRTOD_NAN __wcstof128_nan
#include <stdlib/strtod_nan_main.c>
-/* Convert string for NaN payload to corresponding NaN. For ldbl-128.
+/* NaN payload handling for ldbl-128.
Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FLOAT long double
-#define SET_MANTISSA(flt, mant) \
+#define SET_NAN_PAYLOAD(flt, mant) \
do \
{ \
union ieee854_long_double u; \
-/* Convert string for NaN payload to corresponding NaN. For ldbl-128ibm.
+/* NaN payload handling or ldbl-128ibm.
Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FLOAT long double
-#define SET_MANTISSA(flt, mant) \
+#define SET_NAN_PAYLOAD(flt, mant) \
do \
{ \
union ibm_extended_long_double u; \
-/* Convert string for NaN payload to corresponding NaN. For ldbl-96.
+/* NaN payload handling for ldbl-96.
Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FLOAT long double
-#define SET_MANTISSA(flt, mant) \
+#define SET_NAN_PAYLOAD(flt, mant) \
do \
{ \
union ieee854_long_double u; \
<http://www.gnu.org/licenses/>. */
#include "../stdlib/strtod_nan_wide.h"
-#include "../stdlib/strtod_nan_double.h"
+#include <math-type-macros-double.h>
#define STRTOD_NAN __wcstod_nan
#include "../stdlib/strtod_nan_main.c"
<http://www.gnu.org/licenses/>. */
#include "../stdlib/strtod_nan_wide.h"
-#include "../stdlib/strtod_nan_float.h"
+#include <math-type-macros-float.h>
#define STRTOD_NAN __wcstof_nan
#include "../stdlib/strtod_nan_main.c"
representation. */
#ifndef __NO_LONG_DOUBLE_MATH
# include "../stdlib/strtod_nan_wide.h"
-# include <strtod_nan_ldouble.h>
+# include <math-type-macros-ldouble.h>
# define STRTOD_NAN __wcstold_nan
# include "../stdlib/strtod_nan_main.c"