2017-11-30 Joseph Myers <joseph@codesourcery.com>
+ * sysdeps/m68k/m680x0/fpu/s_atan_template.c: New file.
+ * sysdeps/m68k/m680x0/fpu/s_ceil_template.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_cos_template.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_expm1_template.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_fabs_template.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_floor_template.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_frexp_template.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_lrint_template.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_modf_template.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_nearbyint_template.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_remquo_template.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_rint_template.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_sin_template.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_sincos_template.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_tan_template.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_tanh_template.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_trunc_template.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_atan.c: Reimplement to use
+ s_atan_template.c.
+ * sysdeps/m68k/m680x0/fpu/s_atanf.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_atanl.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_ceil.c: Reimplement to use
+ s_ceil_template.c.
+ * sysdeps/m68k/m680x0/fpu/s_ceilf.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_ceill.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_cos.c: Reimplement to use
+ s_cos_template.c.
+ * sysdeps/m68k/m680x0/fpu/s_cosf.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_cosl.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_expm1.c: Reimplement to use
+ s_expm1_template.c.
+ * sysdeps/m68k/m680x0/fpu/s_expm1f.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_expm1l.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_fabs.c: Reimplement to use
+ s_fabs_template.c.
+ * sysdeps/m68k/m680x0/fpu/s_fabsf.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_fabsl.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_floor.c: Reimplement to use
+ s_floor_template.c.
+ * sysdeps/m68k/m680x0/fpu/s_floorf.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_floorl.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_frexp.c: Reimplement to use
+ s_frexp_template.c.
+ * sysdeps/m68k/m680x0/fpu/s_frexpf.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_lrint.c: Reimplement to use
+ s_lrint_template.c.
+ * sysdeps/m68k/m680x0/fpu/s_lrintf.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_lrintl.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_modf.c: Reimplement to use
+ s_modf_template.c.
+ * sysdeps/m68k/m680x0/fpu/s_modff.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_modfl.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_nearbyint.c: Reimplement to use
+ s_nearbyint_template.c.
+ * sysdeps/m68k/m680x0/fpu/s_nearbyintf.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_nearbyintl.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_remquo.c: Reimplement to use
+ s_remquo_template.c.
+ * sysdeps/m68k/m680x0/fpu/s_remquof.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_remquol.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_rint.c: Reimplement to use
+ s_rint_template.c.
+ * sysdeps/m68k/m680x0/fpu/s_rintf.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_rintl.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_sin.c: Reimplement to use
+ s_sin_template.c.
+ * sysdeps/m68k/m680x0/fpu/s_sinf.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_sinl.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_sincos.c: Reimplement to use
+ s_sincos_template.c.
+ * sysdeps/m68k/m680x0/fpu/s_sincosf.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_sincosl.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_tan.c: Reimplement to use
+ s_tan_template.c.
+ * sysdeps/m68k/m680x0/fpu/s_tanf.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_tanl.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_tanh.c: Reimplement to use
+ s_tanh_template.c.
+ * sysdeps/m68k/m680x0/fpu/s_tanhf.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_tanhl.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_trunc.c: Reimplement to use
+ s_trunc_template.c.
+ * sysdeps/m68k/m680x0/fpu/s_truncf.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_truncl.c: Likewise.
+ * sysdeps/m68k/m680x0/fpu/s_significand.c: Reimplement based on
+ s_atan.c instead of including s_atan.c.
+ * sysdeps/m68k/m680x0/fpu/s_significandf.c: Reimplement based on
+ s_atanf.c instead of including s_atanf.c.
+ * sysdeps/m68k/m680x0/fpu/s_significandl.c: Reimplement based on
+ s_atanl.c instead of including s_atanl.c.
+ * sysdeps/m68k/m680x0/fpu/s_log1p.c: Include s_significand.c
+ instead of s_atan.c.
+ * sysdeps/m68k/m680x0/fpu/s_log1pf.c: Include s_significandf.c
+ instead of s_atanf.c.
+ * sysdeps/m68k/m680x0/fpu/s_log1pl.c: Include s_significandl.c
+ instead of s_atanl.c.
+
* scripts/update-copyrights: Do not handle intl/plural.c
specially.
-/* Copyright (C) 1996-2017 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/>. */
-
-#include <math.h>
-
-#ifndef FUNC
-#define FUNC atan
-#endif
-#ifndef float_type
-#define float_type double
-#endif
-
-#define __CONCATX(a,b) __CONCAT(a,b)
-
-float_type
-__CONCATX(__,FUNC) (float_type x)
-{
- return __m81_u(__CONCATX(__,FUNC))(x);
-}
-weak_alias (__CONCATX(__,FUNC), FUNC)
+#include <math-type-macros-double.h>
+#include <s_atan_template.c>
--- /dev/null
+/* Implement atan for m68k.
+ Copyright (C) 1996-2017 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/>. */
+
+#include <math.h>
+
+FLOAT
+M_DECL_FUNC (__atan) (FLOAT x)
+{
+ return __m81_u(M_SUF (__atan)) (x);
+}
+declare_mgen_alias (__atan, atan)
-#ifndef FUNC
-#define FUNC atanf
-#endif
-#define float_type float
-#include <s_atan.c>
+#include <math-type-macros-float.h>
+#include <s_atan_template.c>
-#ifndef FUNC
-#define FUNC atanl
-#endif
-#define float_type long double
-#include <s_atan.c>
+#include <math-type-macros-ldouble.h>
+#include <s_atan_template.c>
-#define FUNC ceil
-#include <s_atan.c>
+#include <math-type-macros-double.h>
+#include <s_ceil_template.c>
--- /dev/null
+/* Implement ceil for m68k.
+ Copyright (C) 1996-2017 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/>. */
+
+#include <math.h>
+
+FLOAT
+M_DECL_FUNC (__ceil) (FLOAT x)
+{
+ return __m81_u(M_SUF (__ceil)) (x);
+}
+declare_mgen_alias (__ceil, ceil)
-#define FUNC ceilf
-#include <s_atanf.c>
+#include <math-type-macros-float.h>
+#include <s_ceil_template.c>
-#define FUNC ceill
-#include <s_atanl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_ceil_template.c>
-#define FUNC cos
-#include <s_sin.c>
+#include <math-type-macros-double.h>
+#include <s_cos_template.c>
--- /dev/null
+/* Implement cos for m68k.
+ Copyright (C) 2012-2017 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/>. */
+
+#include <math.h>
+#include <errno.h>
+#include "mathimpl.h"
+
+FLOAT
+M_DECL_FUNC (__cos) (FLOAT x)
+{
+ if (__m81_test (x) & __M81_COND_INF)
+ __set_errno (EDOM);
+ return __m81_u(M_SUF (__cos)) (x);
+}
+declare_mgen_alias (__cos, cos)
-#define FUNC cosf
-#include <s_sinf.c>
+#include <math-type-macros-float.h>
+#include <s_cos_template.c>
-#define FUNC cosl
-#include <s_sinl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_cos_template.c>
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-#include <math.h>
-#include <errno.h>
-#include "mathimpl.h"
-
-#ifndef FUNC
-# define FUNC expm1
-#endif
-#ifndef float_type
-# define float_type double
-#endif
-#ifndef o_threshold
-# define o_threshold 7.09782712893383973096e+02
-#endif
-
-#define CONCATX(a,b) __CONCAT(a,b)
-
-float_type
-CONCATX(__,FUNC) (float_type x)
-{
- if ((__m81_test (x) & __M81_COND_INF) == 0 && isgreater (x, o_threshold))
- __set_errno (ERANGE);
- return __m81_u(CONCATX(__, FUNC)) (x);
-}
-weak_alias (CONCATX(__, FUNC), FUNC)
+#include <math-type-macros-double.h>
+#define o_threshold 7.09782712893383973096e+02
+#include <s_expm1_template.c>
--- /dev/null
+/* Implement expm1 for m68k.
+ Copyright (C) 2012-2017 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/>. */
+
+#include <math.h>
+#include <errno.h>
+#include "mathimpl.h"
+
+FLOAT
+M_DECL_FUNC (__expm1) (FLOAT x)
+{
+ if ((__m81_test (x) & __M81_COND_INF) == 0 && isgreater (x, o_threshold))
+ __set_errno (ERANGE);
+ return __m81_u(M_SUF (__expm1)) (x);
+}
+declare_mgen_alias (__expm1, expm1)
-#define FUNC expm1f
-#define float_type float
+#include <math-type-macros-float.h>
#define o_threshold 8.8722831726e+01F
-#include <s_expm1.c>
+#include <s_expm1_template.c>
-#define FUNC expm1l
-#define float_type long double
+#include <math-type-macros-ldouble.h>
/* 400c0000b17217f7d1cf79ab */
#define o_threshold 1.13565234062941439487914863093465101e+04L
-#include <s_expm1.c>
+#include <s_expm1_template.c>
libm_hidden_def (__expm1l)
-#define FUNC fabs
-#include <s_atan.c>
+#include <math-type-macros-double.h>
+#include <s_fabs_template.c>
--- /dev/null
+/* Implement fabs for m68k.
+ Copyright (C) 1996-2017 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/>. */
+
+#include <math.h>
+
+FLOAT
+M_DECL_FUNC (__fabs) (FLOAT x)
+{
+ return __m81_u(M_SUF (__fabs)) (x);
+}
+declare_mgen_alias (__fabs, fabs)
-#define FUNC fabsf
-#include <s_atanf.c>
+#include <math-type-macros-float.h>
+#include <s_fabs_template.c>
-#define FUNC fabsl
-#include <s_atanl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_fabs_template.c>
-#define FUNC floor
-#include <s_atan.c>
+#include <math-type-macros-double.h>
+#include <s_floor_template.c>
--- /dev/null
+/* Implement floor for m68k.
+ Copyright (C) 1996-2017 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/>. */
+
+#include <math.h>
+
+FLOAT
+M_DECL_FUNC (__floor) (FLOAT x)
+{
+ return __m81_u(M_SUF (__floor)) (x);
+}
+declare_mgen_alias (__floor, floor)
-#define FUNC floorf
-#include <s_atanf.c>
+#include <math-type-macros-float.h>
+#include <s_floor_template.c>
-#define FUNC floorl
-#include <s_atanl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_floor_template.c>
-/* Copyright (C) 1996-2017 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/>. */
-
-#include <math.h>
-
-#ifndef FUNC
-#define FUNC frexp
-#endif
-#ifndef float_type
-#define float_type double
-#endif
-
-#define __CONCATX(a,b) __CONCAT(a,b)
-
-float_type
-__CONCATX(__,FUNC) (float_type value, int *expptr)
-{
- float_type mantissa, exponent;
- int iexponent;
- unsigned long fpsr;
-
- __asm ("ftst%.x %1\n"
- "fmove%.l %/fpsr, %0"
- : "=dm" (fpsr) : "f" (value));
- if (fpsr & (7 << 24))
- {
- /* Not finite or zero. */
- *expptr = 0;
- return value;
- }
- __asm ("fgetexp%.x %1, %0" : "=f" (exponent) : "f" (value));
- iexponent = (int) exponent + 1;
- *expptr = iexponent;
- __asm ("fscale%.l %2, %0"
- : "=f" (mantissa)
- : "0" (value), "dmi" (-iexponent));
- return mantissa;
-}
-weak_alias (__CONCATX(__,FUNC), FUNC)
+#include <math-type-macros-double.h>
+#include <s_frexp_template.c>
--- /dev/null
+/* Implement frexp for m68k.
+ Copyright (C) 1996-2017 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/>. */
+
+#include <math.h>
+
+FLOAT
+M_DECL_FUNC (__frexp) (FLOAT value, int *expptr)
+{
+ FLOAT mantissa, exponent;
+ int iexponent;
+ unsigned long fpsr;
+
+ __asm ("ftst%.x %1\n"
+ "fmove%.l %/fpsr, %0"
+ : "=dm" (fpsr) : "f" (value));
+ if (fpsr & (7 << 24))
+ {
+ /* Not finite or zero. */
+ *expptr = 0;
+ return value;
+ }
+ __asm ("fgetexp%.x %1, %0" : "=f" (exponent) : "f" (value));
+ iexponent = (int) exponent + 1;
+ *expptr = iexponent;
+ __asm ("fscale%.l %2, %0"
+ : "=f" (mantissa)
+ : "0" (value), "dmi" (-iexponent));
+ return mantissa;
+}
+declare_mgen_alias (__frexp, frexp)
-#define FUNC frexpf
-#define float_type float
-#include <s_frexp.c>
+#include <math-type-macros-float.h>
+#include <s_frexp_template.c>
#define FUNC log1p
#undef weak_alias
#define weak_alias(a,b)
-#include <s_atan.c>
+#include <s_significand.c>
#define FUNC log1pf
#undef weak_alias
#define weak_alias(a,b)
-#include <s_atanf.c>
+#include <s_significandf.c>
#define FUNC log1pl
#undef weak_alias
#define weak_alias(a,b)
-#include <s_atanl.c>
+#include <s_significandl.c>
-/* Round argument to nearest integral value according to current rounding
- direction.
- Copyright (C) 1997-2017 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- 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/>. */
-
-#include <math.h>
-
-#ifndef suffix
-#define suffix /*empty*/
-#endif
-#ifndef float_type
-#define float_type double
-#endif
-
-#define CONCATX(a,b) __CONCAT(a,b)
-
-long int
-CONCATX(__lrint,suffix) (float_type x)
-{
- return __m81_u(CONCATX(__lrint,suffix)) (x);
-}
-weak_alias (CONCATX(__lrint,suffix), CONCATX(lrint,suffix))
+#include <math-type-macros-double.h>
+#include <s_lrint_template.c>
--- /dev/null
+/* Round argument to nearest integral value according to current rounding
+ direction.
+ Copyright (C) 1997-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ 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/>. */
+
+#include <math.h>
+
+long int
+M_DECL_FUNC (__lrint) (FLOAT x)
+{
+ return __m81_u(M_SUF (__lrint)) (x);
+}
+declare_mgen_alias (__lrint, lrint)
-#define suffix f
-#define float_type float
-#include <s_lrint.c>
+#include <math-type-macros-float.h>
+#include <s_lrint_template.c>
-#define suffix l
-#define float_type long double
-#include <s_lrint.c>
+#include <math-type-macros-ldouble.h>
+#include <s_lrint_template.c>
-/* Copyright (C) 1996-2017 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/>. */
-
-#include <math.h>
-#include "mathimpl.h"
-
-#ifndef SUFF
-#define SUFF
-#endif
-#ifndef float_type
-#define float_type double
-#endif
-
-#define CONCATX(a,b) __CONCAT(a,b)
-#define s(name) CONCATX(name,SUFF)
-#define m81(func) __m81_u(s(func))
-
-float_type
-s(__modf) (float_type x, float_type *iptr)
-{
- float_type x_int, result;
- unsigned long x_cond;
-
- __asm ("fintrz%.x %1, %0" : "=f" (x_int) : "f" (x));
- *iptr = x_int;
- x_cond = __m81_test (x);
- if (x_cond & __M81_COND_INF)
- {
- result = 0;
- if (x_cond & __M81_COND_NEG)
- result = -result;
- }
- else if (x_cond & __M81_COND_ZERO)
- result = x;
- else
- result = x - x_int;
- return result;
-}
-weak_alias (s(__modf), s(modf))
+#include <math-type-macros-double.h>
+#include <s_modf_template.c>
--- /dev/null
+/* Implement modf for m68k.
+ Copyright (C) 1996-2017 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/>. */
+
+#include <math.h>
+#include "mathimpl.h"
+
+FLOAT
+M_DECL_FUNC (__modf) (FLOAT x, FLOAT *iptr)
+{
+ FLOAT x_int, result;
+ unsigned long x_cond;
+
+ __asm ("fintrz%.x %1, %0" : "=f" (x_int) : "f" (x));
+ *iptr = x_int;
+ x_cond = __m81_test (x);
+ if (x_cond & __M81_COND_INF)
+ {
+ result = 0;
+ if (x_cond & __M81_COND_NEG)
+ result = -result;
+ }
+ else if (x_cond & __M81_COND_ZERO)
+ result = x;
+ else
+ result = x - x_int;
+ return result;
+}
+declare_mgen_alias (__modf, modf)
-#define SUFF f
-#define float_type float
-#include <s_modf.c>
+#include <math-type-macros-float.h>
+#include <s_modf_template.c>
-#define SUFF l
-#define float_type long double
-#include <s_modf.c>
+#include <math-type-macros-ldouble.h>
+#include <s_modf_template.c>
-#define FUNC nearbyint
-#include <s_atan.c>
+#include <math-type-macros-double.h>
+#include <s_nearbyint_template.c>
--- /dev/null
+/* Implement nearbyint for m68k.
+ Copyright (C) 1996-2017 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/>. */
+
+#include <math.h>
+
+FLOAT
+M_DECL_FUNC (__nearbyint) (FLOAT x)
+{
+ return __m81_u(M_SUF (__nearbyint)) (x);
+}
+declare_mgen_alias (__nearbyint, nearbyint)
-#define FUNC nearbyintf
-#include <s_atanf.c>
+#include <math-type-macros-float.h>
+#include <s_nearbyint_template.c>
-#define FUNC nearbyintl
-#include <s_atanl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_nearbyint_template.c>
-/* Compute remainder and a congruent to the quotient. m68k fpu version
- Copyright (C) 1997-2017 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- 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/>. */
-
-#include <math.h>
-
-#ifndef SUFF
-#define SUFF
-#endif
-#ifndef float_type
-#define float_type double
-#endif
-
-#define CONCATX(a,b) __CONCAT(a,b)
-#define s(name) CONCATX(name,SUFF)
-
-float_type
-s(__remquo) (float_type x, float_type y, int *quo)
-{
- float_type result;
- int cquo, fpsr;
-
- __asm ("frem%.x %2,%0\n\tfmove%.l %/fpsr,%1"
- : "=f" (result), "=dm" (fpsr) : "f" (y), "0" (x));
- cquo = (fpsr >> 16) & 0x7f;
- if (fpsr & (1 << 23))
- cquo = -cquo;
- *quo = cquo;
- return result;
-}
-weak_alias (s(__remquo), s(remquo))
+#include <math-type-macros-double.h>
+#include <s_remquo_template.c>
--- /dev/null
+/* Compute remainder and a congruent to the quotient. m68k fpu version
+ Copyright (C) 1997-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ 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/>. */
+
+#include <math.h>
+
+FLOAT
+M_DECL_FUNC (__remquo) (FLOAT x, FLOAT y, int *quo)
+{
+ FLOAT result;
+ int cquo, fpsr;
+
+ __asm ("frem%.x %2,%0\n\tfmove%.l %/fpsr,%1"
+ : "=f" (result), "=dm" (fpsr) : "f" (y), "0" (x));
+ cquo = (fpsr >> 16) & 0x7f;
+ if (fpsr & (1 << 23))
+ cquo = -cquo;
+ *quo = cquo;
+ return result;
+}
+declare_mgen_alias (__remquo, remquo)
-#define SUFF f
-#define float_type float
-#include <s_remquo.c>
+#include <math-type-macros-float.h>
+#include <s_remquo_template.c>
-#define SUFF l
-#define float_type long double
-#include <s_remquo.c>
+#include <math-type-macros-ldouble.h>
+#include <s_remquo_template.c>
-#define FUNC rint
-#include <s_atan.c>
+#include <math-type-macros-double.h>
+#include <s_rint_template.c>
--- /dev/null
+/* Implement rint for m68k.
+ Copyright (C) 1996-2017 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/>. */
+
+#include <math.h>
+
+FLOAT
+M_DECL_FUNC (__rint) (FLOAT x)
+{
+ return __m81_u(M_SUF (__rint)) (x);
+}
+declare_mgen_alias (__rint, rint)
-#define FUNC rintf
-#include <s_atanf.c>
+#include <math-type-macros-float.h>
+#include <s_rint_template.c>
-#define FUNC rintl
-#include <s_atanl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_rint_template.c>
-#define FUNC significand
-#include <s_atan.c>
+/* Implement significand for m68k.
+ Copyright (C) 1996-2017 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/>. */
+
+#include <math.h>
+
+#ifndef FUNC
+#define FUNC significand
+#endif
+#ifndef float_type
+#define float_type double
+#endif
+
+#define __CONCATX(a,b) __CONCAT(a,b)
+
+float_type
+__CONCATX(__,FUNC) (float_type x)
+{
+ return __m81_u(__CONCATX(__,FUNC))(x);
+}
+weak_alias (__CONCATX(__,FUNC), FUNC)
-#define FUNC significandf
-#include <s_atanf.c>
+#ifndef FUNC
+#define FUNC significandf
+#endif
+#define float_type float
+#include <s_significand.c>
+#ifndef FUNC
#define FUNC significandl
-#include <s_atanl.c>
+#endif
+#define float_type long double
+#include <s_significand.c>
-/* Copyright (C) 2012-2017 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/>. */
-
-#include <math.h>
-#include <errno.h>
-#include "mathimpl.h"
-
-#ifndef FUNC
-# define FUNC sin
-#endif
-#ifndef float_type
-# define float_type double
-#endif
-
-#define CONCATX(a,b) __CONCAT(a,b)
-
-float_type
-CONCATX(__,FUNC) (float_type x)
-{
- if (__m81_test (x) & __M81_COND_INF)
- __set_errno (EDOM);
- return __m81_u(CONCATX(__, FUNC)) (x);
-}
-weak_alias (CONCATX(__, FUNC), FUNC)
+#include <math-type-macros-double.h>
+#include <s_sin_template.c>
--- /dev/null
+/* Implement sin for m68k.
+ Copyright (C) 2012-2017 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/>. */
+
+#include <math.h>
+#include <errno.h>
+#include "mathimpl.h"
+
+FLOAT
+M_DECL_FUNC (__sin) (FLOAT x)
+{
+ if (__m81_test (x) & __M81_COND_INF)
+ __set_errno (EDOM);
+ return __m81_u(M_SUF (__sin)) (x);
+}
+declare_mgen_alias (__sin, sin)
-/* Copyright (C) 1997-2017 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/>. */
-
-#include <math.h>
-
-#ifndef FUNC
-#define FUNC sincos
-#endif
-#ifndef float_type
-#define float_type double
-#endif
-
-#define CONCATX(a,b) __CONCAT(a,b)
-
-void
-CONCATX(__,FUNC) (float_type x, float_type *sinx, float_type *cosx)
-{
- __m81_u(CONCATX(__,FUNC))(x, sinx, cosx);
-}
-weak_alias (CONCATX(__,FUNC), FUNC)
+#include <math-type-macros-double.h>
+#include <s_sincos_template.c>
--- /dev/null
+/* Implement sincos for m68k.
+ Copyright (C) 1997-2017 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/>. */
+
+#include <math.h>
+
+void
+M_DECL_FUNC (__sincos) (FLOAT x, FLOAT *sinx, FLOAT *cosx)
+{
+ __m81_u(M_SUF (__sincos)) (x, sinx, cosx);
+}
+declare_mgen_alias (__sincos, sincos)
-#define FUNC sincosf
-#define float_type float
-#include <s_sincos.c>
+#include <math-type-macros-float.h>
+#include <s_sincos_template.c>
-#define FUNC sincosl
-#define float_type long double
-#include <s_sincos.c>
+#include <math-type-macros-ldouble.h>
+#include <s_sincos_template.c>
-#ifndef FUNC
-# define FUNC sinf
-#endif
-#define float_type float
-#include <s_sin.c>
+#include <math-type-macros-float.h>
+#include <s_sin_template.c>
-#ifndef FUNC
-# define FUNC sinl
-#endif
-#define float_type long double
-#include <s_sin.c>
+#include <math-type-macros-ldouble.h>
+#include <s_sin_template.c>
-#define FUNC tan
-#include <s_sin.c>
+#include <math-type-macros-double.h>
+#include <s_tan_template.c>
--- /dev/null
+/* Implement tan for m68k.
+ Copyright (C) 2012-2017 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/>. */
+
+#include <math.h>
+#include <errno.h>
+#include "mathimpl.h"
+
+FLOAT
+M_DECL_FUNC (__tan) (FLOAT x)
+{
+ if (__m81_test (x) & __M81_COND_INF)
+ __set_errno (EDOM);
+ return __m81_u(M_SUF (__tan)) (x);
+}
+declare_mgen_alias (__tan, tan)
-#define FUNC tanf
-#include <s_sinf.c>
+#include <math-type-macros-float.h>
+#include <s_tan_template.c>
-#define FUNC tanh
-#include <s_atan.c>
+#include <math-type-macros-double.h>
+#include <s_tanh_template.c>
--- /dev/null
+/* Implement tanh for m68k.
+ Copyright (C) 1996-2017 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/>. */
+
+#include <math.h>
+
+FLOAT
+M_DECL_FUNC (__tanh) (FLOAT x)
+{
+ return __m81_u(M_SUF (__tanh)) (x);
+}
+declare_mgen_alias (__tanh, tanh)
-#define FUNC tanhf
-#include <s_atanf.c>
+#include <math-type-macros-float.h>
+#include <s_tanh_template.c>
-#define FUNC tanhl
-#include <s_atanl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_tanh_template.c>
-#define FUNC tanl
-#include <s_sinl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_tan_template.c>
-#define FUNC trunc
-#include <s_atan.c>
+#include <math-type-macros-double.h>
+#include <s_trunc_template.c>
--- /dev/null
+/* Implement trunc for m68k.
+ Copyright (C) 1996-2017 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/>. */
+
+#include <math.h>
+
+FLOAT
+M_DECL_FUNC (__trunc) (FLOAT x)
+{
+ return __m81_u(M_SUF (__trunc)) (x);
+}
+declare_mgen_alias (__trunc, trunc)
-#define FUNC truncf
-#include <s_atanf.c>
+#include <math-type-macros-float.h>
+#include <s_trunc_template.c>
-#define FUNC truncl
-#include <s_atanl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_trunc_template.c>