aboutsummaryrefslogtreecommitdiff
path: root/math/math.h
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2017-10-27 22:43:46 +0000
committerJoseph Myers <joseph@codesourcery.com>2017-10-27 22:43:46 +0000
commit7e9d70736b98950522549e63d5bb7f81ff9eb93b (patch)
tree8fee4e18b9757661f40607f97396402a26bc8086 /math/math.h
parent63d3b468c1b63d04c067eab8d86f0be6bd15bc87 (diff)
downloadglibc-7e9d70736b98950522549e63d5bb7f81ff9eb93b.zip
glibc-7e9d70736b98950522549e63d5bb7f81ff9eb93b.tar.gz
glibc-7e9d70736b98950522549e63d5bb7f81ff9eb93b.tar.bz2
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.
Diffstat (limited to 'math/math.h')
-rw-r--r--math/math.h126
1 files changed, 123 insertions, 3 deletions
diff --git a/math/math.h b/math/math.h
index 22ff23b..3263042 100644
--- a/math/math.h
+++ b/math/math.h
@@ -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