]> sourceware.org Git - glibc.git/commitdiff
Rework m68k libm functions to use declare_mgen_alias.
authorJoseph Myers <joseph@codesourcery.com>
Thu, 30 Nov 2017 22:39:07 +0000 (22:39 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Thu, 30 Nov 2017 22:39:07 +0000 (22:39 +0000)
Many m68k libm functions use their own system to share code between
different types and functions, involving defining macros before
including code for another function (for example, s_atan.c also acts
as a template that can define other functions).

Thes files serving as templates generate function aliases directly
with e.g. "weak_alias (__CONCATX(__,FUNC), FUNC)" in s_atan.c.  To be
prepared to generate _Float32, _Float64 and _Float32x function
aliases, this needs changing so that the libm_alias_* macros get used
instead.  As the macro to use varies depending on the type, that would
mean additional macros to define in several different places to get
the appropriate alias-generation macro used in each case.

Rather than adding to the m68k-specific mechanisms, this patch
converts the functions in question to use something closer to the
math/ type-generic template mechanism.  After this patch, these
functions have m68k-specific templates such as s_atan_template.c, but
those templates use all the same macros as in the math/ templates,
such as FLOAT, M_DECL_FUNC, M_SUF and declare_mgen_alias.  There is no
automatic generation of the files such as s_atan.c that include the
appropriate math-type-macros-*.h header and the template file (the
existing automatic generation logic is only applicable for the fixed
set of templates listed in math/ - and sysdeps sources always override
files generated that way), so those files are still checked in, but
they are all the obvious two-line files (with one additional
definition in the case of the expm1 implementations), rather than
making e.g. s_atan.c special.

Functions are only converted where they should have aliases for
_FloatN / _FloatNx types.  Those m68k functions that do not generate
public names (those that only generate __ieee754_*, with wrappers
generating the public names, and classification functions that only
exist once per format not once per type so don't get aliases) are
unchanged.  However, log1p (public names generated by wrapper) and
significand (not provided for new types so no new aliases needed)
needed changing because they previously included the atan
implementations.  Now, s_significand.c is the main implementation for
functions with that prototype and using the old implementation
approach, while log1p includes it in place of atan.

Any further cleanups in this area (which preserve the proper set of
functions getting aliases defined by libm_alias_float and
libm_alias_double) are of course welcome, just not needed for the
goals of this patch.

Tested with build-many-glibcs.py that installed stripped shared
libraries are unchanged by the patch.

* 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.

74 files changed:
ChangeLog
sysdeps/m68k/m680x0/fpu/s_atan.c
sysdeps/m68k/m680x0/fpu/s_atan_template.c [new file with mode: 0644]
sysdeps/m68k/m680x0/fpu/s_atanf.c
sysdeps/m68k/m680x0/fpu/s_atanl.c
sysdeps/m68k/m680x0/fpu/s_ceil.c
sysdeps/m68k/m680x0/fpu/s_ceil_template.c [new file with mode: 0644]
sysdeps/m68k/m680x0/fpu/s_ceilf.c
sysdeps/m68k/m680x0/fpu/s_ceill.c
sysdeps/m68k/m680x0/fpu/s_cos.c
sysdeps/m68k/m680x0/fpu/s_cos_template.c [new file with mode: 0644]
sysdeps/m68k/m680x0/fpu/s_cosf.c
sysdeps/m68k/m680x0/fpu/s_cosl.c
sysdeps/m68k/m680x0/fpu/s_expm1.c
sysdeps/m68k/m680x0/fpu/s_expm1_template.c [new file with mode: 0644]
sysdeps/m68k/m680x0/fpu/s_expm1f.c
sysdeps/m68k/m680x0/fpu/s_expm1l.c
sysdeps/m68k/m680x0/fpu/s_fabs.c
sysdeps/m68k/m680x0/fpu/s_fabs_template.c [new file with mode: 0644]
sysdeps/m68k/m680x0/fpu/s_fabsf.c
sysdeps/m68k/m680x0/fpu/s_fabsl.c
sysdeps/m68k/m680x0/fpu/s_floor.c
sysdeps/m68k/m680x0/fpu/s_floor_template.c [new file with mode: 0644]
sysdeps/m68k/m680x0/fpu/s_floorf.c
sysdeps/m68k/m680x0/fpu/s_floorl.c
sysdeps/m68k/m680x0/fpu/s_frexp.c
sysdeps/m68k/m680x0/fpu/s_frexp_template.c [new file with mode: 0644]
sysdeps/m68k/m680x0/fpu/s_frexpf.c
sysdeps/m68k/m680x0/fpu/s_log1p.c
sysdeps/m68k/m680x0/fpu/s_log1pf.c
sysdeps/m68k/m680x0/fpu/s_log1pl.c
sysdeps/m68k/m680x0/fpu/s_lrint.c
sysdeps/m68k/m680x0/fpu/s_lrint_template.c [new file with mode: 0644]
sysdeps/m68k/m680x0/fpu/s_lrintf.c
sysdeps/m68k/m680x0/fpu/s_lrintl.c
sysdeps/m68k/m680x0/fpu/s_modf.c
sysdeps/m68k/m680x0/fpu/s_modf_template.c [new file with mode: 0644]
sysdeps/m68k/m680x0/fpu/s_modff.c
sysdeps/m68k/m680x0/fpu/s_modfl.c
sysdeps/m68k/m680x0/fpu/s_nearbyint.c
sysdeps/m68k/m680x0/fpu/s_nearbyint_template.c [new file with mode: 0644]
sysdeps/m68k/m680x0/fpu/s_nearbyintf.c
sysdeps/m68k/m680x0/fpu/s_nearbyintl.c
sysdeps/m68k/m680x0/fpu/s_remquo.c
sysdeps/m68k/m680x0/fpu/s_remquo_template.c [new file with mode: 0644]
sysdeps/m68k/m680x0/fpu/s_remquof.c
sysdeps/m68k/m680x0/fpu/s_remquol.c
sysdeps/m68k/m680x0/fpu/s_rint.c
sysdeps/m68k/m680x0/fpu/s_rint_template.c [new file with mode: 0644]
sysdeps/m68k/m680x0/fpu/s_rintf.c
sysdeps/m68k/m680x0/fpu/s_rintl.c
sysdeps/m68k/m680x0/fpu/s_significand.c
sysdeps/m68k/m680x0/fpu/s_significandf.c
sysdeps/m68k/m680x0/fpu/s_significandl.c
sysdeps/m68k/m680x0/fpu/s_sin.c
sysdeps/m68k/m680x0/fpu/s_sin_template.c [new file with mode: 0644]
sysdeps/m68k/m680x0/fpu/s_sincos.c
sysdeps/m68k/m680x0/fpu/s_sincos_template.c [new file with mode: 0644]
sysdeps/m68k/m680x0/fpu/s_sincosf.c
sysdeps/m68k/m680x0/fpu/s_sincosl.c
sysdeps/m68k/m680x0/fpu/s_sinf.c
sysdeps/m68k/m680x0/fpu/s_sinl.c
sysdeps/m68k/m680x0/fpu/s_tan.c
sysdeps/m68k/m680x0/fpu/s_tan_template.c [new file with mode: 0644]
sysdeps/m68k/m680x0/fpu/s_tanf.c
sysdeps/m68k/m680x0/fpu/s_tanh.c
sysdeps/m68k/m680x0/fpu/s_tanh_template.c [new file with mode: 0644]
sysdeps/m68k/m680x0/fpu/s_tanhf.c
sysdeps/m68k/m680x0/fpu/s_tanhl.c
sysdeps/m68k/m680x0/fpu/s_tanl.c
sysdeps/m68k/m680x0/fpu/s_trunc.c
sysdeps/m68k/m680x0/fpu/s_trunc_template.c [new file with mode: 0644]
sysdeps/m68k/m680x0/fpu/s_truncf.c
sysdeps/m68k/m680x0/fpu/s_truncl.c

index 98420311ab00132c579a986ab655918abc40b890..d5f77a49b971a676347c63872aa2aebe27be645a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,102 @@
 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.
 
index 55e26312fc259be01ae5ccbcae7b9e4dd68f338b..a6f90d329845fb3e00c6cb7b734ed16b27b1b98d 100644 (file)
@@ -1,34 +1,2 @@
-/* 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>
diff --git a/sysdeps/m68k/m680x0/fpu/s_atan_template.c b/sysdeps/m68k/m680x0/fpu/s_atan_template.c
new file mode 100644 (file)
index 0000000..03da769
--- /dev/null
@@ -0,0 +1,26 @@
+/* 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)
index c98559a8ba01bf10cabd250d80a36b726875491e..bc24155c410c02ab292e13e0ca30ab0a8b1b431f 100644 (file)
@@ -1,5 +1,2 @@
-#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>
index b7e608addd869d90003e22d7b4b52c4c5be70e12..28eea1199971bf9b409b2bed2e177671c633cfea 100644 (file)
@@ -1,5 +1,2 @@
-#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>
index 93d5ad72e5805a45557ba0e62870ff259afa5b1e..70aeb739f1d5e17ca4213f3dd97ee01c84aa9bb1 100644 (file)
@@ -1,2 +1,2 @@
-#define        FUNC    ceil
-#include <s_atan.c>
+#include <math-type-macros-double.h>
+#include <s_ceil_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_ceil_template.c b/sysdeps/m68k/m680x0/fpu/s_ceil_template.c
new file mode 100644 (file)
index 0000000..945f7c1
--- /dev/null
@@ -0,0 +1,26 @@
+/* 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)
index b3ba6a57008d3f9828d137798e5f2bc00a7299e7..74e027e40c7f55c51cf8dfc21e1e8c15f07acd11 100644 (file)
@@ -1,2 +1,2 @@
-#define        FUNC    ceilf
-#include <s_atanf.c>
+#include <math-type-macros-float.h>
+#include <s_ceil_template.c>
index 2bf95b00c63799ade3a3307de2d39b4ef5bffdab..5188c2471d45815d30777754f266e93c12ee4326 100644 (file)
@@ -1,2 +1,2 @@
-#define FUNC ceill
-#include <s_atanl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_ceil_template.c>
index 2f1adf77f57fab45242a9e5f18a92511a468eab9..24e508e5c3613c46a9f98311f0f86418ec68dc3f 100644 (file)
@@ -1,2 +1,2 @@
-#define        FUNC    cos
-#include <s_sin.c>
+#include <math-type-macros-double.h>
+#include <s_cos_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_cos_template.c b/sysdeps/m68k/m680x0/fpu/s_cos_template.c
new file mode 100644 (file)
index 0000000..56a5a75
--- /dev/null
@@ -0,0 +1,30 @@
+/* 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)
index b6d6accb4ac5504a524c1c9cae634084d15ff77c..fcfc844dfef9144a31c7887a66b34202d391515a 100644 (file)
@@ -1,2 +1,2 @@
-#define FUNC cosf
-#include <s_sinf.c>
+#include <math-type-macros-float.h>
+#include <s_cos_template.c>
index eb61521fdda75871ec6342dcd4d19f64cfc5413a..de8767cfe3e533eac963c49640fc9a1423560d34 100644 (file)
@@ -1,2 +1,2 @@
-#define FUNC cosl
-#include <s_sinl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_cos_template.c>
index c969a7f029b9bdef5357908e4d36ceb9c3b2aa6f..e3abfbdfa531c32ee07d102054a17848adf617e8 100644 (file)
    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>
diff --git a/sysdeps/m68k/m680x0/fpu/s_expm1_template.c b/sysdeps/m68k/m680x0/fpu/s_expm1_template.c
new file mode 100644 (file)
index 0000000..492cc87
--- /dev/null
@@ -0,0 +1,30 @@
+/* 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)
index 2cd8ffcfeb370206b46738dfd5cbae254cd2ac00..a36080030effe76bed3e69ae51f5badcb9289f39 100644 (file)
@@ -1,4 +1,3 @@
-#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>
index a2c80860ba488177fcd673473115fdb18eec1961..cfbab2843bf5df7ed35b6a37c72f54f1238adff2 100644 (file)
@@ -1,6 +1,5 @@
-#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)
index 1f0631e2ff0d71070d424c7b739c93be587119d4..179a94add2afcfe4dbc96841414f5d6c143cda67 100644 (file)
@@ -1,2 +1,2 @@
-#define        FUNC    fabs
-#include <s_atan.c>
+#include <math-type-macros-double.h>
+#include <s_fabs_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_fabs_template.c b/sysdeps/m68k/m680x0/fpu/s_fabs_template.c
new file mode 100644 (file)
index 0000000..5b74e4b
--- /dev/null
@@ -0,0 +1,26 @@
+/* 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)
index 8f9421998a4d493d528701eca5efaa07974a5bd0..9072d2a76ac9899cf6a5025d49a89bfdada30ccc 100644 (file)
@@ -1,2 +1,2 @@
-#define        FUNC    fabsf
-#include <s_atanf.c>
+#include <math-type-macros-float.h>
+#include <s_fabs_template.c>
index 8ac14d5b8c6234cbaf3b0e9b2a657cdc8537bff1..fa48f8ae4e5b082d946d39ce6f280cbc3b1889bb 100644 (file)
@@ -1,2 +1,2 @@
-#define FUNC fabsl
-#include <s_atanl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_fabs_template.c>
index e1219c602ac77722801b8d18e2c7d642e5cfafe9..339ae2cce4a7b62a68c75009ed746da5decaf0cc 100644 (file)
@@ -1,2 +1,2 @@
-#define        FUNC    floor
-#include <s_atan.c>
+#include <math-type-macros-double.h>
+#include <s_floor_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_floor_template.c b/sysdeps/m68k/m680x0/fpu/s_floor_template.c
new file mode 100644 (file)
index 0000000..542d8b8
--- /dev/null
@@ -0,0 +1,26 @@
+/* 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)
index f4f9b9a1d85c7ac1c5e654b036523f3250699bb8..5d998e02175bd5a9f4baa6157a1b12def223c534 100644 (file)
@@ -1,2 +1,2 @@
-#define        FUNC    floorf
-#include <s_atanf.c>
+#include <math-type-macros-float.h>
+#include <s_floor_template.c>
index 2c1ffd7d2c5f867a7a5749c882348244481a1bb8..2295f998454ea53027d28f7843f12347d56cdb49 100644 (file)
@@ -1,2 +1,2 @@
-#define FUNC floorl
-#include <s_atanl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_floor_template.c>
index 009b1e32238f909a443357954bf1be673a4890fe..be8db3875abe363963904a2bb81e25d96402bc45 100644 (file)
@@ -1,53 +1,2 @@
-/* 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>
diff --git a/sysdeps/m68k/m680x0/fpu/s_frexp_template.c b/sysdeps/m68k/m680x0/fpu/s_frexp_template.c
new file mode 100644 (file)
index 0000000..7f50887
--- /dev/null
@@ -0,0 +1,45 @@
+/* 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)
index 893b6ad3cf6565ec12a93a1adcca87b40cfb0ef0..6cf7ceb29459ddee1e22713b83b61f1eb701eb8f 100644 (file)
@@ -1,3 +1,2 @@
-#define FUNC frexpf
-#define float_type float
-#include <s_frexp.c>
+#include <math-type-macros-float.h>
+#include <s_frexp_template.c>
index 082618df18ab11325fe338a46b32fe04cd580cb6..7eb2529547d00cb950f462fd04fadbf5cf527890 100644 (file)
@@ -1,4 +1,4 @@
 #define        FUNC    log1p
 #undef weak_alias
 #define weak_alias(a,b)
-#include <s_atan.c>
+#include <s_significand.c>
index 480c39519fab01a32d0abaddbea105c638be520e..40f332ff36c009b90bfd03785c6cd10d4f5ab99c 100644 (file)
@@ -1,4 +1,4 @@
 #define        FUNC    log1pf
 #undef weak_alias
 #define weak_alias(a,b)
-#include <s_atanf.c>
+#include <s_significandf.c>
index a4f34a4f863cc8114b468027ba38310e0b67cd0f..e580bafbc5b3154a1da418b3debed15f6b0449d4 100644 (file)
@@ -1,4 +1,4 @@
 #define FUNC log1pl
 #undef weak_alias
 #define weak_alias(a,b)
-#include <s_atanl.c>
+#include <s_significandl.c>
index d25a548dcd2f9776569d7cac5f726e68c04bc1ed..31440cfdbcf1d15afed4b8328494859af0e4c2f5 100644 (file)
@@ -1,37 +1,2 @@
-/* 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>
diff --git a/sysdeps/m68k/m680x0/fpu/s_lrint_template.c b/sysdeps/m68k/m680x0/fpu/s_lrint_template.c
new file mode 100644 (file)
index 0000000..efa00f1
--- /dev/null
@@ -0,0 +1,28 @@
+/* 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)
index 44924cb82f12d9118cc2b7657df5950a4105f344..77e753baa7b97d7393a8910a6eefba8953ce795d 100644 (file)
@@ -1,3 +1,2 @@
-#define suffix f
-#define float_type float
-#include <s_lrint.c>
+#include <math-type-macros-float.h>
+#include <s_lrint_template.c>
index cd0bd23b8a1db2d5c41a05e2ac1a32cbe432402f..a4670b83c64f17f165cf461c608db4317faf6be4 100644 (file)
@@ -1,3 +1,2 @@
-#define suffix l
-#define float_type long double
-#include <s_lrint.c>
+#include <math-type-macros-ldouble.h>
+#include <s_lrint_template.c>
index 3c1a5a27490347a33c369cfeb571bcbcb24b4b7a..1d1c0ea7f25ef9bdbf9672cf61c8474ff8f66c1a 100644 (file)
@@ -1,53 +1,2 @@
-/* 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>
diff --git a/sysdeps/m68k/m680x0/fpu/s_modf_template.c b/sysdeps/m68k/m680x0/fpu/s_modf_template.c
new file mode 100644 (file)
index 0000000..b354e73
--- /dev/null
@@ -0,0 +1,43 @@
+/* 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)
index 0c44d7c0ab6b59709f1082348b115e6251c5481b..3d28880398a2d9b45217e87a83e55cd098c757f8 100644 (file)
@@ -1,3 +1,2 @@
-#define SUFF f
-#define float_type float
-#include <s_modf.c>
+#include <math-type-macros-float.h>
+#include <s_modf_template.c>
index c7075b3ba9e7bc4f804a69e5cd138ed064aa7f14..9057645249bcfdc937109a712829d37251653d59 100644 (file)
@@ -1,3 +1,2 @@
-#define SUFF l
-#define float_type long double
-#include <s_modf.c>
+#include <math-type-macros-ldouble.h>
+#include <s_modf_template.c>
index b87f5e216043f8c347d4a54d085c0a77757f0fa3..6af0d9b1a995e0d0fdf3a4637fb0a70843f36521 100644 (file)
@@ -1,2 +1,2 @@
-#define        FUNC nearbyint
-#include <s_atan.c>
+#include <math-type-macros-double.h>
+#include <s_nearbyint_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_nearbyint_template.c b/sysdeps/m68k/m680x0/fpu/s_nearbyint_template.c
new file mode 100644 (file)
index 0000000..4546378
--- /dev/null
@@ -0,0 +1,26 @@
+/* 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)
index 70d08ab44c7fb473bb44e3b7f5941c1a2c1080fe..aefd7fc7c5d6873580679f164bdfb2cc8f087854 100644 (file)
@@ -1,2 +1,2 @@
-#define        FUNC nearbyintf
-#include <s_atanf.c>
+#include <math-type-macros-float.h>
+#include <s_nearbyint_template.c>
index 230cd7784c98ed381fd7ae44e80eb8962d302256..8516caf947d2024e628c00340f1c2b19e7dd70ab 100644 (file)
@@ -1,2 +1,2 @@
-#define        FUNC nearbyintl
-#include <s_atanl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_nearbyint_template.c>
index 554751ca8715d761536c7e64898a2c84e2eda6e7..b1d8f3a9720b55628d7095502fcf2b061466abd3 100644 (file)
@@ -1,46 +1,2 @@
-/* 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>
diff --git a/sysdeps/m68k/m680x0/fpu/s_remquo_template.c b/sysdeps/m68k/m680x0/fpu/s_remquo_template.c
new file mode 100644 (file)
index 0000000..fb5a096
--- /dev/null
@@ -0,0 +1,36 @@
+/* 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)
index 8a292fc26cbb89817421047ca44a4055d56b6418..f2b86628d2022c568913dd248e27c67de34ee996 100644 (file)
@@ -1,3 +1,2 @@
-#define SUFF f
-#define float_type float
-#include <s_remquo.c>
+#include <math-type-macros-float.h>
+#include <s_remquo_template.c>
index d236cfd1f9986c5243b5c3be4557bdc7a800a6cf..cb18d9e520e08c8db28761398db44a31afad801c 100644 (file)
@@ -1,3 +1,2 @@
-#define SUFF l
-#define float_type long double
-#include <s_remquo.c>
+#include <math-type-macros-ldouble.h>
+#include <s_remquo_template.c>
index f0f18c734674fc97c6542e9c9635772f32b40f3a..fa092c07eb8bc10a1fc4cc0200903c6ca978a181 100644 (file)
@@ -1,2 +1,2 @@
-#define        FUNC    rint
-#include <s_atan.c>
+#include <math-type-macros-double.h>
+#include <s_rint_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_rint_template.c b/sysdeps/m68k/m680x0/fpu/s_rint_template.c
new file mode 100644 (file)
index 0000000..2589f9d
--- /dev/null
@@ -0,0 +1,26 @@
+/* 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)
index 4e00cab0fb08e67f3d33afe60a05ba92ae9dbf25..5cda19c69081e2d85f3533379165c39d176ba64b 100644 (file)
@@ -1,2 +1,2 @@
-#define        FUNC    rintf
-#include <s_atanf.c>
+#include <math-type-macros-float.h>
+#include <s_rint_template.c>
index 305667b3a1c5b6a091fe9884373d56d147a84e79..df393ee8957872f2a494ec40ea76cd1120998c6a 100644 (file)
@@ -1,2 +1,2 @@
-#define FUNC rintl
-#include <s_atanl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_rint_template.c>
index 34d4ea3d14572a146b92332ac3da8d9dedfd8dc2..d43de6ed91091a2baca0a4b045d3d0ebe2ca65fe 100644 (file)
@@ -1,2 +1,35 @@
-#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)
index 4e769ca31713c1c268198d0a4cc219bd343f5cdb..bbaa64bb13a949f6c23bb269da3a0b978dfacf32 100644 (file)
@@ -1,2 +1,5 @@
-#define        FUNC    significandf
-#include <s_atanf.c>
+#ifndef FUNC
+#define FUNC significandf
+#endif
+#define float_type float
+#include <s_significand.c>
index 8c6fc7e610b659b3ed5663438df74c607d7b7140..f3496ee862cbcb57fae41121a1752cc1ad3ba481 100644 (file)
@@ -1,2 +1,5 @@
+#ifndef FUNC
 #define FUNC significandl
-#include <s_atanl.c>
+#endif
+#define float_type long double
+#include <s_significand.c>
index 953fb445cfc1800be6722b94e0c2154130f0705d..b52e804ab98d2a727b1ba8f289d2ba928c2acd9f 100644 (file)
@@ -1,38 +1,2 @@
-/* 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>
diff --git a/sysdeps/m68k/m680x0/fpu/s_sin_template.c b/sysdeps/m68k/m680x0/fpu/s_sin_template.c
new file mode 100644 (file)
index 0000000..c44d414
--- /dev/null
@@ -0,0 +1,30 @@
+/* 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)
index ca93d93333fee220ac12fe52df2314c0c63c7295..9226798fd7591406ea3896b1138df9ba529e3c6f 100644 (file)
@@ -1,34 +1,2 @@
-/* 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>
diff --git a/sysdeps/m68k/m680x0/fpu/s_sincos_template.c b/sysdeps/m68k/m680x0/fpu/s_sincos_template.c
new file mode 100644 (file)
index 0000000..017f011
--- /dev/null
@@ -0,0 +1,26 @@
+/* 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)
index 7ee2ec6600b67dfca4edc88b8624032a0eca5826..581388bdc60ff508e15fc06177b0d2474b3c23f8 100644 (file)
@@ -1,3 +1,2 @@
-#define FUNC sincosf
-#define float_type float
-#include <s_sincos.c>
+#include <math-type-macros-float.h>
+#include <s_sincos_template.c>
index f998cc09774359f8adc0700d48f801be3a649ab2..6a88d3e88aba43214975274e7e3a623fdac6dcbf 100644 (file)
@@ -1,3 +1,2 @@
-#define FUNC sincosl
-#define float_type long double
-#include <s_sincos.c>
+#include <math-type-macros-ldouble.h>
+#include <s_sincos_template.c>
index 304f4f76f64afed50f55331410cd5c565ad1029c..7868705d277b089247a6b068d6423d7a1da1b9c3 100644 (file)
@@ -1,5 +1,2 @@
-#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>
index 31dac0bee70ded95f168a3aad824cdb89f87f3c5..f542d1b09613057fd40cc9954a9a3d584cb41ddc 100644 (file)
@@ -1,5 +1,2 @@
-#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>
index dfbbbb22704edeba10d30aa4c7af5b22d6b8a2f6..c680a6b041adc79d699997128f5ce059697e9b4f 100644 (file)
@@ -1,2 +1,2 @@
-#define        FUNC    tan
-#include <s_sin.c>
+#include <math-type-macros-double.h>
+#include <s_tan_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_tan_template.c b/sysdeps/m68k/m680x0/fpu/s_tan_template.c
new file mode 100644 (file)
index 0000000..6291096
--- /dev/null
@@ -0,0 +1,30 @@
+/* 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)
index 9ae66ddbf3371424439fe7f4d9f79209b71c504d..a95d4d757c99c4d8ca5b1034b70e5e0b114b49b4 100644 (file)
@@ -1,2 +1,2 @@
-#define FUNC tanf
-#include <s_sinf.c>
+#include <math-type-macros-float.h>
+#include <s_tan_template.c>
index ac2e7dbb792d60f7edb76648713bf6d4e8838fe6..11d4bc4f71a687e823f258d0d64afb1e9ea146e0 100644 (file)
@@ -1,2 +1,2 @@
-#define        FUNC    tanh
-#include <s_atan.c>
+#include <math-type-macros-double.h>
+#include <s_tanh_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_tanh_template.c b/sysdeps/m68k/m680x0/fpu/s_tanh_template.c
new file mode 100644 (file)
index 0000000..6b591f1
--- /dev/null
@@ -0,0 +1,26 @@
+/* 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)
index 1addaae4ff41edb85cb1b1de0ff410759d2f3c81..40f45a2fd7809b8b203d070c01684c4fe853c91b 100644 (file)
@@ -1,2 +1,2 @@
-#define        FUNC    tanhf
-#include <s_atanf.c>
+#include <math-type-macros-float.h>
+#include <s_tanh_template.c>
index 6e997911f2ffd5b4996698e3ba144fccf8a53bb2..72f4d8f1bc2ec59efae8e0fa4d5a01bcd923c4cc 100644 (file)
@@ -1,2 +1,2 @@
-#define FUNC tanhl
-#include <s_atanl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_tanh_template.c>
index 27daf8f29b199ca8b719615776c331af481f9eab..099dbfde7df5b5bdd2b0731d9b72b06df08349bc 100644 (file)
@@ -1,2 +1,2 @@
-#define FUNC tanl
-#include <s_sinl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_tan_template.c>
index 96f29a776c9852919d7d4353c4a57334a6bcd276..a9f0c4b9db28e5ed6ca80b5b061196855c82f921 100644 (file)
@@ -1,2 +1,2 @@
-#define        FUNC trunc
-#include <s_atan.c>
+#include <math-type-macros-double.h>
+#include <s_trunc_template.c>
diff --git a/sysdeps/m68k/m680x0/fpu/s_trunc_template.c b/sysdeps/m68k/m680x0/fpu/s_trunc_template.c
new file mode 100644 (file)
index 0000000..9ed1e3d
--- /dev/null
@@ -0,0 +1,26 @@
+/* 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)
index 44dca748cac27ddfe0e1194e0f801dbd8786ace2..65474c779b2ed941a124cd583681ba4a197af69d 100644 (file)
@@ -1,2 +1,2 @@
-#define        FUNC truncf
-#include <s_atanf.c>
+#include <math-type-macros-float.h>
+#include <s_trunc_template.c>
index 8d35777aed485db1d7f26d6499c3f4ab8b42d836..cbb87540cf8a5f2f7241b6bf7f3e56f7781a8c26 100644 (file)
@@ -1,2 +1,2 @@
-#define        FUNC truncl
-#include <s_atanl.c>
+#include <math-type-macros-ldouble.h>
+#include <s_trunc_template.c>
This page took 0.147836 seconds and 5 git commands to generate.