]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/generic/math-type-macros.h
Prefer https to http for gnu.org and fsf.org URLs
[thirdparty/glibc.git] / sysdeps / generic / math-type-macros.h
index b4c2aee6aa5981abb4711f18bfe1e25e38ef83aa..6cd88c8879a4e5361379dd0eb7f4ece9fb8f0554 100644 (file)
@@ -1,5 +1,5 @@
 /* Helper macros for type generic function implementations within libm.
-   Copyright (C) 2016-2017 Free Software Foundation, Inc.
+   Copyright (C) 2016-2019 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
@@ -14,7 +14,7 @@
 
    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/>.  */
+   <https://www.gnu.org/licenses/>.  */
 
 #ifndef _MATH_TYPE_MACROS
 #define _MATH_TYPE_MACROS
                converts a string into the appropriate FLOAT nan
                value.
 
-  Optionally, these headers may inject a non-standard
-  definition for the following:
-
   declare_mgen_alias(from,to)
       This exposes the appropriate symbol(s) for a
       function f of type FLOAT.
 
-  declare_mgen_alias_2(from,to,to2)
+  declare_mgen_alias_r(from,to)
       This exposes the appropriate symbol(s) for a
-      function f of type FLOAT when it is aliased
-      to two symbols.
-
-  M_LIBM_NEED_COMPAT(func)
-      This is utilized in macro context to indicate
-      whether func should declare compat symbols.
+      function f_r of type FLOAT.
 
-  declare_mgen_libm_compat(from,to)
-      This is used in conjunction with the above macro
-      outside of macro context to paste whatever is
-      required to generate a compat symbol. */
+  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 CFLOAT
 # error "CFLOAT must be defined."
 #endif
+#ifndef declare_mgen_alias
+# error "declare_mgen_alias must be defined."
+#endif
+#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
+
+#ifndef declare_mgen_finite_alias_x
+#define declare_mgen_finite_alias_x(from, to)  \
+  strong_alias (from, to ## _finite)
+#endif
+
+#ifndef declare_mgen_finite_alias_s
+# define declare_mgen_finite_alias_s(from,to)  \
+  declare_mgen_finite_alias_x (from, to)
+#endif
+
+#ifndef declare_mgen_finite_alias
+# define declare_mgen_finite_alias(from, to)   \
+  declare_mgen_finite_alias_s (M_SUF (from), M_SUF (to))
+#endif
 
 #define __M_CONCAT(a,b) a ## b
 #define __M_CONCATX(a,b) __M_CONCAT(a,b)
 #define M_HUGE_VAL (M_SUF (__builtin_huge_val) ())
 
 /* Helper macros for commonly used functions.  */
-#define M_COPYSIGN M_SUF (__copysign)
+#define M_COPYSIGN M_SUF (copysign)
 #define M_FABS M_SUF (fabs)
 #define M_SINCOS M_SUF (__sincos)
 #define M_SCALBN M_SUF (__scalbn)
 #define M_HYPOT M_SUF (__ieee754_hypot)
 #define M_LOG M_SUF (__ieee754_log)
 #define M_SINH M_SUF (__ieee754_sinh)
-#define M_SQRT M_SUF (__ieee754_sqrt)
+#define M_SQRT M_SUF (sqrt)
 
 /* Needed to evaluate M_MANT_DIG below.  */
 #include <float.h>
 # define M_DECL_FUNC(f) M_SUF (f)
 #endif
 
-/* If the type does not declare special aliasing, use the default.  */
-#ifndef declare_mgen_alias
-# define declare_mgen_alias(from, to) weak_alias (M_SUF (from), M_SUF (to))
-#endif
-
-/* Likewise, if two aliases are derived from the same symbol.  */
-#ifndef declare_mgen_alias_2
-# define declare_mgen_alias_2(from, to, to2)  \
- declare_mgen_alias (from, to)               \
- declare_mgen_alias (from, to2)
-#endif
-
-/* Do not generate anything for compat symbols by default.  */
-#ifndef M_LIBM_NEED_COMPAT
-# define M_LIBM_NEED_COMPAT(func) 0
-# define declare_mgen_libm_compat(from, to)
-#endif
-
 #endif /* _MATH_TYPE_MACROS */