Include bits/mathcalls.h for more _FloatN, _FloatNx types.

Continuing the preparation for additional _FloatN / _FloatNx type
support, this patch arranges for <bits/mathcalls.h> and
<bits/mathcalls-helper-functions.h> to be included for each such type
under conditions and with macros defined corresponding to those
already present for _Float128.

Tested for x86_64.

	* math/math.h [__HAVE_DISTINCT_FLOAT16 || (__HAVE_FLOAT16 && !_LIBC)]:
	Include <bits/mathcalls-helper-functions.h> and <bits/mathcalls.h>
	with appropriate macros defined and undefined.
	[__HAVE_DISTINCT_FLOAT32 || (__HAVE_FLOAT32 && !_LIBC)]: Likewise.
	[__HAVE_DISTINCT_FLOAT64 || (__HAVE_FLOAT64 && !_LIBC)]: Likewise.
	[__HAVE_DISTINCT_FLOAT32X || (__HAVE_FLOAT32X && !_LIBC)]: Likewise.
	[__HAVE_DISTINCT_FLOAT64X || (__HAVE_FLOAT64X && !_LIBC)]: Likewise.
	[__HAVE_DISTINCT_FLOAT128X || (__HAVE_FLOAT128X && !_LIBC)]: Likewise.
This commit is contained in:
Joseph Myers 2017-10-27 22:43:46 +00:00
parent 63d3b468c1
commit 7e9d70736b
2 changed files with 134 additions and 3 deletions

View file

@ -1,3 +1,14 @@
2017-10-27 Joseph Myers <joseph@codesourcery.com>
* math/math.h [__HAVE_DISTINCT_FLOAT16 || (__HAVE_FLOAT16 && !_LIBC)]:
Include <bits/mathcalls-helper-functions.h> and <bits/mathcalls.h>
with appropriate macros defined and undefined.
[__HAVE_DISTINCT_FLOAT32 || (__HAVE_FLOAT32 && !_LIBC)]: Likewise.
[__HAVE_DISTINCT_FLOAT64 || (__HAVE_FLOAT64 && !_LIBC)]: Likewise.
[__HAVE_DISTINCT_FLOAT32X || (__HAVE_FLOAT32X && !_LIBC)]: Likewise.
[__HAVE_DISTINCT_FLOAT64X || (__HAVE_FLOAT64X && !_LIBC)]: Likewise.
[__HAVE_DISTINCT_FLOAT128X || (__HAVE_FLOAT128X && !_LIBC)]: Likewise.
2017-10-27 H.J. Lu <hongjiu.lu@intel.com>
* sysdeps/i386/fpu/libm-test-ulps: Regenerated for GCC 7 with

View file

@ -363,8 +363,68 @@ extern long double __REDIRECT_NTH (nexttowardl,
#endif /* Use ISO C99. */
/* Include the file of declarations again, this time using `_Float128'
instead of `double' and appending f128 to each function name. */
/* Include the file of declarations for _FloatN and _FloatNx
types. */
#if __HAVE_DISTINCT_FLOAT16 || (__HAVE_FLOAT16 && !defined _LIBC)
# ifndef _Mfloat16_
# define _Mfloat16_ _Float16
# endif
# define _Mdouble_ _Mfloat16_
# define __MATH_PRECNAME(name,r) name##f16##r
# define __MATH_DECLARING_DOUBLE 0
# define __MATH_DECLARING_FLOATN 1
# if __HAVE_DISTINCT_FLOAT16
# include <bits/mathcalls-helper-functions.h>
# endif
# if __GLIBC_USE (IEC_60559_TYPES_EXT)
# include <bits/mathcalls.h>
# endif
# undef _Mdouble_
# undef __MATH_PRECNAME
# undef __MATH_DECLARING_DOUBLE
# undef __MATH_DECLARING_FLOATN
#endif /* __HAVE_DISTINCT_FLOAT16 || (__HAVE_FLOAT16 && !_LIBC). */
#if __HAVE_DISTINCT_FLOAT32 || (__HAVE_FLOAT32 && !defined _LIBC)
# ifndef _Mfloat32_
# define _Mfloat32_ _Float32
# endif
# define _Mdouble_ _Mfloat32_
# define __MATH_PRECNAME(name,r) name##f32##r
# define __MATH_DECLARING_DOUBLE 0
# define __MATH_DECLARING_FLOATN 1
# if __HAVE_DISTINCT_FLOAT32
# include <bits/mathcalls-helper-functions.h>
# endif
# if __GLIBC_USE (IEC_60559_TYPES_EXT)
# include <bits/mathcalls.h>
# endif
# undef _Mdouble_
# undef __MATH_PRECNAME
# undef __MATH_DECLARING_DOUBLE
# undef __MATH_DECLARING_FLOATN
#endif /* __HAVE_DISTINCT_FLOAT32 || (__HAVE_FLOAT32 && !_LIBC). */
#if __HAVE_DISTINCT_FLOAT64 || (__HAVE_FLOAT64 && !defined _LIBC)
# ifndef _Mfloat64_
# define _Mfloat64_ _Float64
# endif
# define _Mdouble_ _Mfloat64_
# define __MATH_PRECNAME(name,r) name##f64##r
# define __MATH_DECLARING_DOUBLE 0
# define __MATH_DECLARING_FLOATN 1
# if __HAVE_DISTINCT_FLOAT64
# include <bits/mathcalls-helper-functions.h>
# endif
# if __GLIBC_USE (IEC_60559_TYPES_EXT)
# include <bits/mathcalls.h>
# endif
# undef _Mdouble_
# undef __MATH_PRECNAME
# undef __MATH_DECLARING_DOUBLE
# undef __MATH_DECLARING_FLOATN
#endif /* __HAVE_DISTINCT_FLOAT64 || (__HAVE_FLOAT64 && !_LIBC). */
#if __HAVE_DISTINCT_FLOAT128 || (__HAVE_FLOAT128 && !defined _LIBC)
# ifndef _Mfloat128_
@ -384,7 +444,67 @@ extern long double __REDIRECT_NTH (nexttowardl,
# undef __MATH_PRECNAME
# undef __MATH_DECLARING_DOUBLE
# undef __MATH_DECLARING_FLOATN
#endif /* __HAVE_DISTINCT_FLOAT128. */
#endif /* __HAVE_DISTINCT_FLOAT128 || (__HAVE_FLOAT128 && !_LIBC). */
#if __HAVE_DISTINCT_FLOAT32X || (__HAVE_FLOAT32X && !defined _LIBC)
# ifndef _Mfloat32x_
# define _Mfloat32x_ _Float32x
# endif
# define _Mdouble_ _Mfloat32x_
# define __MATH_PRECNAME(name,r) name##f32x##r
# define __MATH_DECLARING_DOUBLE 0
# define __MATH_DECLARING_FLOATN 1
# if __HAVE_DISTINCT_FLOAT32X
# include <bits/mathcalls-helper-functions.h>
# endif
# if __GLIBC_USE (IEC_60559_TYPES_EXT)
# include <bits/mathcalls.h>
# endif
# undef _Mdouble_
# undef __MATH_PRECNAME
# undef __MATH_DECLARING_DOUBLE
# undef __MATH_DECLARING_FLOATN
#endif /* __HAVE_DISTINCT_FLOAT32X || (__HAVE_FLOAT32X && !_LIBC). */
#if __HAVE_DISTINCT_FLOAT64X || (__HAVE_FLOAT64X && !defined _LIBC)
# ifndef _Mfloat64x_
# define _Mfloat64x_ _Float64x
# endif
# define _Mdouble_ _Mfloat64x_
# define __MATH_PRECNAME(name,r) name##f64x##r
# define __MATH_DECLARING_DOUBLE 0
# define __MATH_DECLARING_FLOATN 1
# if __HAVE_DISTINCT_FLOAT64X
# include <bits/mathcalls-helper-functions.h>
# endif
# if __GLIBC_USE (IEC_60559_TYPES_EXT)
# include <bits/mathcalls.h>
# endif
# undef _Mdouble_
# undef __MATH_PRECNAME
# undef __MATH_DECLARING_DOUBLE
# undef __MATH_DECLARING_FLOATN
#endif /* __HAVE_DISTINCT_FLOAT64X || (__HAVE_FLOAT64X && !_LIBC). */
#if __HAVE_DISTINCT_FLOAT128X || (__HAVE_FLOAT128X && !defined _LIBC)
# ifndef _Mfloat128x_
# define _Mfloat128x_ _Float128x
# endif
# define _Mdouble_ _Mfloat128x_
# define __MATH_PRECNAME(name,r) name##f128x##r
# define __MATH_DECLARING_DOUBLE 0
# define __MATH_DECLARING_FLOATN 1
# if __HAVE_DISTINCT_FLOAT128X
# include <bits/mathcalls-helper-functions.h>
# endif
# if __GLIBC_USE (IEC_60559_TYPES_EXT)
# include <bits/mathcalls.h>
# endif
# undef _Mdouble_
# undef __MATH_PRECNAME
# undef __MATH_DECLARING_DOUBLE
# undef __MATH_DECLARING_FLOATN
#endif /* __HAVE_DISTINCT_FLOAT128X || (__HAVE_FLOAT128X && !_LIBC). */
#undef __MATHDECL_1
#undef __MATHDECL