+2018-05-09 Joseph Myers <joseph@codesourcery.com>
+
+ * include/math-narrow-eval.h: New file. Contents moved from ....
+ * sysdeps/generic/math_private.h: ... here.
+ (math_narrow_eval): Remove macro. Moved to math-narrow-eval.h.
+ [FLT_EVAL_METHOD != 0] (excess_precision): Likewise.
+ * math/s_fdim_template.c: Include <math-narrow-eval.h>.
+ * stdlib/strtod_l.c: Likewise.
+ * sysdeps/i386/fpu/s_f32xaddf64.c: Likewise.
+ * sysdeps/i386/fpu/s_f32xsubf64.c: Likewise.
+ * sysdeps/i386/fpu/s_fdim.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_cosh.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_gamma_r.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_j1.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_jn.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_lgamma_r.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_sinh.c: Likewise.
+ * sysdeps/ieee754/dbl-64/gamma_productf.c: Likewise.
+ * sysdeps/ieee754/dbl-64/k_rem_pio2.c: Likewise.
+ * sysdeps/ieee754/dbl-64/lgamma_neg.c: Likewise.
+ * sysdeps/ieee754/dbl-64/s_erf.c: Likewise.
+ * sysdeps/ieee754/dbl-64/s_llrint.c: Likewise.
+ * sysdeps/ieee754/dbl-64/s_lrint.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_coshf.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_exp2f.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_expf.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_gammaf_r.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_j1f.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_jnf.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_lgammaf_r.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_sinhf.c: Likewise.
+ * sysdeps/ieee754/flt-32/k_rem_pio2f.c: Likewise.
+ * sysdeps/ieee754/flt-32/lgamma_negf.c: Likewise.
+ * sysdeps/ieee754/flt-32/s_erff.c: Likewise.
+ * sysdeps/ieee754/flt-32/s_llrintf.c: Likewise.
+ * sysdeps/ieee754/flt-32/s_lrintf.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/gamma_product.c: Likewise.
+
2018-05-08 Andreas Schwab <schwab@suse.de>
* sysdeps/nptl/internaltypes.h: Fix comment.
--- /dev/null
+/* Narrow floating-point values to their semantic type.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _MATH_NARROW_EVAL_H
+#define _MATH_NARROW_EVAL_H 1
+
+#include <float.h>
+
+/* math_narrow_eval reduces its floating-point argument to the range
+ and precision of its semantic type. (The original evaluation may
+ still occur with excess range and precision, so the result may be
+ affected by double rounding.) */
+#if FLT_EVAL_METHOD == 0
+# define math_narrow_eval(x) (x)
+#else
+# if FLT_EVAL_METHOD == 1
+# define excess_precision(type) __builtin_types_compatible_p (type, float)
+# else
+# define excess_precision(type) (__builtin_types_compatible_p (type, float) \
+ || __builtin_types_compatible_p (type, \
+ double))
+# endif
+# define math_narrow_eval(x) \
+ ({ \
+ __typeof (x) math_narrow_eval_tmp = (x); \
+ if (excess_precision (__typeof (math_narrow_eval_tmp))) \
+ __asm__ ("" : "+m" (math_narrow_eval_tmp)); \
+ math_narrow_eval_tmp; \
+ })
+#endif
+
+#endif /* math-narrow-eval.h */
#include <errno.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
FLOAT
#include <float.h>
#include "../locale/localeinfo.h"
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
#include <stdlib.h>
#include <string.h>
({ __typeof (x) __x = (x); __asm __volatile__ ("" : : "m" (__x)); })
#endif
-/* math_narrow_eval reduces its floating-point argument to the range
- and precision of its semantic type. (The original evaluation may
- still occur with excess range and precision, so the result may be
- affected by double rounding.) */
-#if FLT_EVAL_METHOD == 0
-# define math_narrow_eval(x) (x)
-#else
-# if FLT_EVAL_METHOD == 1
-# define excess_precision(type) __builtin_types_compatible_p (type, float)
-# else
-# define excess_precision(type) (__builtin_types_compatible_p (type, float) \
- || __builtin_types_compatible_p (type, \
- double))
-# endif
-# define math_narrow_eval(x) \
- ({ \
- __typeof (x) math_narrow_eval_tmp = (x); \
- if (excess_precision (__typeof (math_narrow_eval_tmp))) \
- __asm__ ("" : "+m" (math_narrow_eval_tmp)); \
- math_narrow_eval_tmp; \
- })
-#endif
-
#define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
/* These must be function-like macros because some __MATH_TG
#include <math.h>
#include <fpu_control.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
#include <math-narrow.h>
#include <math.h>
#include <fpu_control.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
#include <math-narrow.h>
#include <errno.h>
#include <fpu_control.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
#include <libm-alias-double.h>
*/
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
static const double one = 1.0, half = 0.5, huge = 1.0e300;
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
#include <float.h>
#include <errno.h>
#include <float.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
static double pone (double), qone (double);
#include <errno.h>
#include <float.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
static const double
*/
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
#include <libc-diag.h>
#include <float.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
static const double one = 1.0, shuge = 1.0e307;
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
#include <float.h>
*/
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
#include <libc-diag.h>
#include <float.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
static const double lgamma_zeros[][2] =
#include <errno.h>
#include <float.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
#include <libm-alias-double.h>
#include <fix-int-fp-convert-zero.h>
#include <limits.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
#include <libm-alias-double.h>
#include <fix-fp-int-convert-overflow.h>
#include <limits.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
#include <libm-alias-double.h>
#include <fix-fp-int-convert-overflow.h>
*/
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
static const float huge = 1.0e30;
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <math-narrow-eval.h>
#include <stdint.h>
#include <shlib-compat.h>
#include <libm-alias-float.h>
#endif
#include <math.h>
+#include <math-narrow-eval.h>
#include <stdint.h>
#include <shlib-compat.h>
#include <libm-alias-float.h>
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
#include <float.h>
#include <errno.h>
#include <float.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
static float ponef(float), qonef(float);
#include <errno.h>
#include <float.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
static const float
*/
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
#include <libc-diag.h>
#include <float.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
static const float one = 1.0, shuge = 1.0e37;
#endif
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
#include <libc-diag.h>
#include <float.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
static const float lgamma_zeros[][2] =
#include <errno.h>
#include <float.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
#include <libm-alias-float.h>
#include <fix-int-fp-convert-zero.h>
#include <limits.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
#include <libm-alias-float.h>
#include <fix-fp-int-convert-overflow.h>
#include <limits.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
#include <libm-alias-float.h>
#include <fix-fp-int-convert-overflow.h>
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
#include <float.h>