@@ -676,5 +676,6 @@ libm {
acosf;
asinf;
acoshf;
+ atan2f;
}
}
new file mode 100644
@@ -0,0 +1,8 @@
+#include <math-type-macros-float.h>
+#undef __USE_WRAPPER_TEMPLATE
+#define __USE_WRAPPER_TEMPLATE 1
+#undef declare_mgen_alias
+#define declare_mgen_alias(a, b)
+#include <w_atan2_template.c>
+versioned_symbol (libm, __atan2f, atan2f, GLIBC_2_41);
+libm_alias_float_other (__atan2f, atan2f)
@@ -26,9 +26,9 @@
#include <libm-alias-float.h>
-#if LIBM_SVID_COMPAT
+#if LIBM_SVID_COMPAT && SHLIB_COMPAT (libm, GLIBC_2_0, GLIBC_2_41)
float
-__atan2f (float y, float x)
+__atan2_compatf (float y, float x)
{
float z;
@@ -40,5 +40,10 @@ __atan2f (float y, float x)
__set_errno (ERANGE);
return z;
}
-libm_alias_float (__atan2, atan2)
+# ifdef NO_COMPAT_NEEDED
+strong_alias (__atan2_compatf, __atan2f)
+libm_alias_float (__atan2_compat, atan2)
+# else
+compat_symbol (libm, __atan2_compatf, atan2f, GLIBC_2_0);
+# endif
#endif
@@ -3,7 +3,7 @@
Copyright (c) 2022-2024 Alexei Sibidanov and Paul Zimmermann.
The original version of this file was copied from the CORE-MATH
-project (file src/binary32/atan2/atan2f.c, revision 7835c5d).
+project (file src/binary32/atan2/atan2f.c, revision 9b28a4a).
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -25,9 +25,12 @@ SOFTWARE.
*/
+#include <errno.h>
#include <math.h>
#include <stdint.h>
#include <libm-alias-finite.h>
+#include <libm-alias-float.h>
+#include <math-svid-compat.h>
#include "math_config.h"
static inline double
@@ -89,7 +92,7 @@ cr_atan2f_tiny (float y, float x)
}
float
-__ieee754_atan2f (float y, float x)
+__atan2f (float y, float x)
{
static const double cn[] =
{
@@ -269,6 +272,16 @@ __ieee754_atan2f (float y, float x)
}
r = th + tm;
}
- return r;
+ float rf = r;
+ if (__glibc_unlikely (rf == 0 && y != 0))
+ __set_errno (ERANGE);
+ return rf;
}
+strong_alias (__atan2f, __ieee754_atan2f)
+#if LIBM_SVID_COMPAT
+versioned_symbol (libm, __atan2f, atan2f, GLIBC_2_41);
+libm_alias_float_other (__atan2, atan2)
+#else
+libm_alias_float (__atan2, atan2)
+#endif
libm_alias_finite (__ieee754_atan2f, __atan2f)
new file mode 100644
@@ -0,0 +1 @@
+/* Not needed. */
new file mode 100644
@@ -0,0 +1,8 @@
+/* m68k provides an optimized __ieee754_atan2f. */
+#ifdef SHARED
+# define NO_COMPAT_NEEDED 1
+# include <math/w_atan2f_compat.c>
+#else
+# include <math-type-macros-float.h>
+# include <w_atan2_template.c>
+#endif
@@ -1240,6 +1240,7 @@ GLIBC_2.41 asinpif32x F
GLIBC_2.41 asinpif64 F
GLIBC_2.41 asinpif64x F
GLIBC_2.41 asinpil F
+GLIBC_2.41 atan2f F
GLIBC_2.41 atan2pi F
GLIBC_2.41 atan2pif F
GLIBC_2.41 atan2pif128 F
@@ -1208,6 +1208,7 @@ GLIBC_2.41 asinpif32x F
GLIBC_2.41 asinpif64 F
GLIBC_2.41 asinpif64x F
GLIBC_2.41 asinpil F
+GLIBC_2.41 atan2f F
GLIBC_2.41 atan2pi F
GLIBC_2.41 atan2pif F
GLIBC_2.41 atan2pif128 F
@@ -1367,6 +1367,7 @@ GLIBC_2.41 asinpif32x F
GLIBC_2.41 asinpif64 F
GLIBC_2.41 asinpif64x F
GLIBC_2.41 asinpil F
+GLIBC_2.41 atan2f F
GLIBC_2.41 atan2pi F
GLIBC_2.41 atan2pif F
GLIBC_2.41 atan2pif128 F
@@ -893,6 +893,7 @@ GLIBC_2.41 asinpif32 F
GLIBC_2.41 asinpif32x F
GLIBC_2.41 asinpif64 F
GLIBC_2.41 asinpil F
+GLIBC_2.41 atan2f F
GLIBC_2.41 atan2pi F
GLIBC_2.41 atan2pif F
GLIBC_2.41 atan2pif32 F
@@ -893,6 +893,7 @@ GLIBC_2.41 asinpif32 F
GLIBC_2.41 asinpif32x F
GLIBC_2.41 asinpif64 F
GLIBC_2.41 asinpil F
+GLIBC_2.41 atan2f F
GLIBC_2.41 atan2pi F
GLIBC_2.41 atan2pif F
GLIBC_2.41 atan2pif32 F
@@ -893,6 +893,7 @@ GLIBC_2.41 asinpif32 F
GLIBC_2.41 asinpif32x F
GLIBC_2.41 asinpif64 F
GLIBC_2.41 asinpil F
+GLIBC_2.41 atan2f F
GLIBC_2.41 atan2pi F
GLIBC_2.41 atan2pif F
GLIBC_2.41 atan2pif32 F
@@ -1247,6 +1247,7 @@ GLIBC_2.41 asinpif32x F
GLIBC_2.41 asinpif64 F
GLIBC_2.41 asinpif64x F
GLIBC_2.41 asinpil F
+GLIBC_2.41 atan2f F
GLIBC_2.41 atan2pi F
GLIBC_2.41 atan2pif F
GLIBC_2.41 atan2pif128 F
@@ -893,6 +893,7 @@ GLIBC_2.41 asinpif32 F
GLIBC_2.41 asinpif32x F
GLIBC_2.41 asinpif64 F
GLIBC_2.41 asinpil F
+GLIBC_2.41 atan2f F
GLIBC_2.41 atan2pi F
GLIBC_2.41 atan2pif F
GLIBC_2.41 atan2pif32 F
@@ -893,6 +893,7 @@ GLIBC_2.41 asinpif32 F
GLIBC_2.41 asinpif32x F
GLIBC_2.41 asinpif64 F
GLIBC_2.41 asinpil F
+GLIBC_2.41 atan2f F
GLIBC_2.41 atan2pi F
GLIBC_2.41 atan2pif F
GLIBC_2.41 atan2pif32 F
@@ -893,6 +893,7 @@ GLIBC_2.41 asinpif32 F
GLIBC_2.41 asinpif32x F
GLIBC_2.41 asinpif64 F
GLIBC_2.41 asinpil F
+GLIBC_2.41 atan2f F
GLIBC_2.41 atan2pi F
GLIBC_2.41 atan2pif F
GLIBC_2.41 atan2pif32 F
@@ -893,6 +893,7 @@ GLIBC_2.41 asinpif32 F
GLIBC_2.41 asinpif32x F
GLIBC_2.41 asinpif64 F
GLIBC_2.41 asinpil F
+GLIBC_2.41 atan2f F
GLIBC_2.41 atan2pi F
GLIBC_2.41 atan2pif F
GLIBC_2.41 atan2pif32 F
@@ -1208,6 +1208,7 @@ GLIBC_2.41 asinpif32x F
GLIBC_2.41 asinpif64 F
GLIBC_2.41 asinpif64x F
GLIBC_2.41 asinpil F
+GLIBC_2.41 atan2f F
GLIBC_2.41 atan2pi F
GLIBC_2.41 atan2pif F
GLIBC_2.41 atan2pif128 F
@@ -1040,6 +1040,7 @@ GLIBC_2.41 asinpif32 F
GLIBC_2.41 asinpif32x F
GLIBC_2.41 asinpif64 F
GLIBC_2.41 asinpil F
+GLIBC_2.41 atan2f F
GLIBC_2.41 atan2pi F
GLIBC_2.41 atan2pif F
GLIBC_2.41 atan2pif32 F
@@ -1039,6 +1039,7 @@ GLIBC_2.41 asinpif32 F
GLIBC_2.41 asinpif32x F
GLIBC_2.41 asinpif64 F
GLIBC_2.41 asinpil F
+GLIBC_2.41 atan2f F
GLIBC_2.41 atan2pi F
GLIBC_2.41 atan2pif F
GLIBC_2.41 atan2pif32 F
@@ -1033,6 +1033,7 @@ GLIBC_2.41 asinpif32 F
GLIBC_2.41 asinpif32x F
GLIBC_2.41 asinpif64 F
GLIBC_2.41 asinpil F
+GLIBC_2.41 atan2f F
GLIBC_2.41 atan2pi F
GLIBC_2.41 atan2pif F
GLIBC_2.41 atan2pif32 F
@@ -1392,6 +1392,7 @@ GLIBC_2.41 asinpif32x F
GLIBC_2.41 asinpif64 F
GLIBC_2.41 asinpif64x F
GLIBC_2.41 asinpil F
+GLIBC_2.41 atan2f F
GLIBC_2.41 atan2pi F
GLIBC_2.41 atan2pif F
GLIBC_2.41 atan2pif128 F
@@ -1311,6 +1311,7 @@ GLIBC_2.41 asinpif32x F
GLIBC_2.41 asinpif64 F
GLIBC_2.41 asinpif64x F
GLIBC_2.41 asinpil F
+GLIBC_2.41 atan2f F
GLIBC_2.41 atan2pi F
GLIBC_2.41 atan2pif F
GLIBC_2.41 atan2pif128 F
@@ -1311,6 +1311,7 @@ GLIBC_2.41 asinpif32x F
GLIBC_2.41 asinpif64 F
GLIBC_2.41 asinpif64x F
GLIBC_2.41 asinpil F
+GLIBC_2.41 atan2f F
GLIBC_2.41 atan2pi F
GLIBC_2.41 atan2pif F
GLIBC_2.41 atan2pif128 F
@@ -893,6 +893,7 @@ GLIBC_2.41 asinpif32 F
GLIBC_2.41 asinpif32x F
GLIBC_2.41 asinpif64 F
GLIBC_2.41 asinpil F
+GLIBC_2.41 atan2f F
GLIBC_2.41 atan2pi F
GLIBC_2.41 atan2pif F
GLIBC_2.41 atan2pif32 F
@@ -893,6 +893,7 @@ GLIBC_2.41 asinpif32 F
GLIBC_2.41 asinpif32x F
GLIBC_2.41 asinpif64 F
GLIBC_2.41 asinpil F
+GLIBC_2.41 atan2f F
GLIBC_2.41 atan2pi F
GLIBC_2.41 atan2pif F
GLIBC_2.41 atan2pif32 F
@@ -1318,6 +1318,7 @@ GLIBC_2.41 asinpif32x F
GLIBC_2.41 asinpif64 F
GLIBC_2.41 asinpif64x F
GLIBC_2.41 asinpil F
+GLIBC_2.41 atan2f F
GLIBC_2.41 atan2pi F
GLIBC_2.41 atan2pif F
GLIBC_2.41 atan2pif128 F
@@ -1208,6 +1208,7 @@ GLIBC_2.41 asinpif32x F
GLIBC_2.41 asinpif64 F
GLIBC_2.41 asinpif64x F
GLIBC_2.41 asinpil F
+GLIBC_2.41 atan2f F
GLIBC_2.41 atan2pi F
GLIBC_2.41 atan2pif F
GLIBC_2.41 atan2pif128 F
@@ -1241,6 +1241,7 @@ GLIBC_2.41 asinpif32x F
GLIBC_2.41 asinpif64 F
GLIBC_2.41 asinpif64x F
GLIBC_2.41 asinpil F
+GLIBC_2.41 atan2f F
GLIBC_2.41 atan2pi F
GLIBC_2.41 atan2pif F
GLIBC_2.41 atan2pif128 F
@@ -1241,6 +1241,7 @@ GLIBC_2.41 asinpif32x F
GLIBC_2.41 asinpif64 F
GLIBC_2.41 asinpif64x F
GLIBC_2.41 asinpil F
+GLIBC_2.41 atan2f F
GLIBC_2.41 atan2pi F
GLIBC_2.41 atan2pif F
GLIBC_2.41 atan2pif128 F