From e53df1dee841a206bf376373eb4250ce4f277e4b Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Thu, 30 Nov 2017 22:39:07 +0000 Subject: [PATCH] Rework m68k libm functions to use declare_mgen_alias. 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. --- ChangeLog | 97 +++++++++++++++++++ sysdeps/m68k/m680x0/fpu/s_atan.c | 36 +------ sysdeps/m68k/m680x0/fpu/s_atan_template.c | 26 +++++ sysdeps/m68k/m680x0/fpu/s_atanf.c | 7 +- sysdeps/m68k/m680x0/fpu/s_atanl.c | 7 +- sysdeps/m68k/m680x0/fpu/s_ceil.c | 4 +- sysdeps/m68k/m680x0/fpu/s_ceil_template.c | 26 +++++ sysdeps/m68k/m680x0/fpu/s_ceilf.c | 4 +- sysdeps/m68k/m680x0/fpu/s_ceill.c | 4 +- sysdeps/m68k/m680x0/fpu/s_cos.c | 4 +- sysdeps/m68k/m680x0/fpu/s_cos_template.c | 30 ++++++ sysdeps/m68k/m680x0/fpu/s_cosf.c | 4 +- sysdeps/m68k/m680x0/fpu/s_cosl.c | 4 +- sysdeps/m68k/m680x0/fpu/s_expm1.c | 27 +----- sysdeps/m68k/m680x0/fpu/s_expm1_template.c | 30 ++++++ sysdeps/m68k/m680x0/fpu/s_expm1f.c | 5 +- sysdeps/m68k/m680x0/fpu/s_expm1l.c | 5 +- sysdeps/m68k/m680x0/fpu/s_fabs.c | 4 +- sysdeps/m68k/m680x0/fpu/s_fabs_template.c | 26 +++++ sysdeps/m68k/m680x0/fpu/s_fabsf.c | 4 +- sysdeps/m68k/m680x0/fpu/s_fabsl.c | 4 +- sysdeps/m68k/m680x0/fpu/s_floor.c | 4 +- sysdeps/m68k/m680x0/fpu/s_floor_template.c | 26 +++++ sysdeps/m68k/m680x0/fpu/s_floorf.c | 4 +- sysdeps/m68k/m680x0/fpu/s_floorl.c | 4 +- sysdeps/m68k/m680x0/fpu/s_frexp.c | 55 +---------- sysdeps/m68k/m680x0/fpu/s_frexp_template.c | 45 +++++++++ sysdeps/m68k/m680x0/fpu/s_frexpf.c | 5 +- sysdeps/m68k/m680x0/fpu/s_log1p.c | 2 +- sysdeps/m68k/m680x0/fpu/s_log1pf.c | 2 +- sysdeps/m68k/m680x0/fpu/s_log1pl.c | 2 +- sysdeps/m68k/m680x0/fpu/s_lrint.c | 39 +------- sysdeps/m68k/m680x0/fpu/s_lrint_template.c | 28 ++++++ sysdeps/m68k/m680x0/fpu/s_lrintf.c | 5 +- sysdeps/m68k/m680x0/fpu/s_lrintl.c | 5 +- sysdeps/m68k/m680x0/fpu/s_modf.c | 55 +---------- sysdeps/m68k/m680x0/fpu/s_modf_template.c | 43 ++++++++ sysdeps/m68k/m680x0/fpu/s_modff.c | 5 +- sysdeps/m68k/m680x0/fpu/s_modfl.c | 5 +- sysdeps/m68k/m680x0/fpu/s_nearbyint.c | 4 +- .../m68k/m680x0/fpu/s_nearbyint_template.c | 26 +++++ sysdeps/m68k/m680x0/fpu/s_nearbyintf.c | 4 +- sysdeps/m68k/m680x0/fpu/s_nearbyintl.c | 4 +- sysdeps/m68k/m680x0/fpu/s_remquo.c | 48 +-------- sysdeps/m68k/m680x0/fpu/s_remquo_template.c | 36 +++++++ sysdeps/m68k/m680x0/fpu/s_remquof.c | 5 +- sysdeps/m68k/m680x0/fpu/s_remquol.c | 5 +- sysdeps/m68k/m680x0/fpu/s_rint.c | 4 +- sysdeps/m68k/m680x0/fpu/s_rint_template.c | 26 +++++ sysdeps/m68k/m680x0/fpu/s_rintf.c | 4 +- sysdeps/m68k/m680x0/fpu/s_rintl.c | 4 +- sysdeps/m68k/m680x0/fpu/s_significand.c | 37 ++++++- sysdeps/m68k/m680x0/fpu/s_significandf.c | 7 +- sysdeps/m68k/m680x0/fpu/s_significandl.c | 5 +- sysdeps/m68k/m680x0/fpu/s_sin.c | 40 +------- sysdeps/m68k/m680x0/fpu/s_sin_template.c | 30 ++++++ sysdeps/m68k/m680x0/fpu/s_sincos.c | 36 +------ sysdeps/m68k/m680x0/fpu/s_sincos_template.c | 26 +++++ sysdeps/m68k/m680x0/fpu/s_sincosf.c | 5 +- sysdeps/m68k/m680x0/fpu/s_sincosl.c | 5 +- sysdeps/m68k/m680x0/fpu/s_sinf.c | 7 +- sysdeps/m68k/m680x0/fpu/s_sinl.c | 7 +- sysdeps/m68k/m680x0/fpu/s_tan.c | 4 +- sysdeps/m68k/m680x0/fpu/s_tan_template.c | 30 ++++++ sysdeps/m68k/m680x0/fpu/s_tanf.c | 4 +- sysdeps/m68k/m680x0/fpu/s_tanh.c | 4 +- sysdeps/m68k/m680x0/fpu/s_tanh_template.c | 26 +++++ sysdeps/m68k/m680x0/fpu/s_tanhf.c | 4 +- sysdeps/m68k/m680x0/fpu/s_tanhl.c | 4 +- sysdeps/m68k/m680x0/fpu/s_tanl.c | 4 +- sysdeps/m68k/m680x0/fpu/s_trunc.c | 4 +- sysdeps/m68k/m680x0/fpu/s_trunc_template.c | 26 +++++ sysdeps/m68k/m680x0/fpu/s_truncf.c | 4 +- sysdeps/m68k/m680x0/fpu/s_truncl.c | 4 +- 74 files changed, 751 insertions(+), 434 deletions(-) create mode 100644 sysdeps/m68k/m680x0/fpu/s_atan_template.c create mode 100644 sysdeps/m68k/m680x0/fpu/s_ceil_template.c create mode 100644 sysdeps/m68k/m680x0/fpu/s_cos_template.c create mode 100644 sysdeps/m68k/m680x0/fpu/s_expm1_template.c create mode 100644 sysdeps/m68k/m680x0/fpu/s_fabs_template.c create mode 100644 sysdeps/m68k/m680x0/fpu/s_floor_template.c create mode 100644 sysdeps/m68k/m680x0/fpu/s_frexp_template.c create mode 100644 sysdeps/m68k/m680x0/fpu/s_lrint_template.c create mode 100644 sysdeps/m68k/m680x0/fpu/s_modf_template.c create mode 100644 sysdeps/m68k/m680x0/fpu/s_nearbyint_template.c create mode 100644 sysdeps/m68k/m680x0/fpu/s_remquo_template.c create mode 100644 sysdeps/m68k/m680x0/fpu/s_rint_template.c create mode 100644 sysdeps/m68k/m680x0/fpu/s_sin_template.c create mode 100644 sysdeps/m68k/m680x0/fpu/s_sincos_template.c create mode 100644 sysdeps/m68k/m680x0/fpu/s_tan_template.c create mode 100644 sysdeps/m68k/m680x0/fpu/s_tanh_template.c create mode 100644 sysdeps/m68k/m680x0/fpu/s_trunc_template.c diff --git a/ChangeLog b/ChangeLog index 98420311ab0..d5f77a49b97 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,102 @@ 2017-11-30 Joseph Myers + * 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. diff --git a/sysdeps/m68k/m680x0/fpu/s_atan.c b/sysdeps/m68k/m680x0/fpu/s_atan.c index 55e26312fc2..a6f90d32984 100644 --- a/sysdeps/m68k/m680x0/fpu/s_atan.c +++ b/sysdeps/m68k/m680x0/fpu/s_atan.c @@ -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 - . */ - -#include - -#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 +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_atan_template.c b/sysdeps/m68k/m680x0/fpu/s_atan_template.c new file mode 100644 index 00000000000..03da7695652 --- /dev/null +++ b/sysdeps/m68k/m680x0/fpu/s_atan_template.c @@ -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 + . */ + +#include + +FLOAT +M_DECL_FUNC (__atan) (FLOAT x) +{ + return __m81_u(M_SUF (__atan)) (x); +} +declare_mgen_alias (__atan, atan) diff --git a/sysdeps/m68k/m680x0/fpu/s_atanf.c b/sysdeps/m68k/m680x0/fpu/s_atanf.c index c98559a8ba0..bc24155c410 100644 --- a/sysdeps/m68k/m680x0/fpu/s_atanf.c +++ b/sysdeps/m68k/m680x0/fpu/s_atanf.c @@ -1,5 +1,2 @@ -#ifndef FUNC -#define FUNC atanf -#endif -#define float_type float -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_atanl.c b/sysdeps/m68k/m680x0/fpu/s_atanl.c index b7e608addd8..28eea119997 100644 --- a/sysdeps/m68k/m680x0/fpu/s_atanl.c +++ b/sysdeps/m68k/m680x0/fpu/s_atanl.c @@ -1,5 +1,2 @@ -#ifndef FUNC -#define FUNC atanl -#endif -#define float_type long double -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_ceil.c b/sysdeps/m68k/m680x0/fpu/s_ceil.c index 93d5ad72e58..70aeb739f1d 100644 --- a/sysdeps/m68k/m680x0/fpu/s_ceil.c +++ b/sysdeps/m68k/m680x0/fpu/s_ceil.c @@ -1,2 +1,2 @@ -#define FUNC ceil -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_ceil_template.c b/sysdeps/m68k/m680x0/fpu/s_ceil_template.c new file mode 100644 index 00000000000..945f7c18aea --- /dev/null +++ b/sysdeps/m68k/m680x0/fpu/s_ceil_template.c @@ -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 + . */ + +#include + +FLOAT +M_DECL_FUNC (__ceil) (FLOAT x) +{ + return __m81_u(M_SUF (__ceil)) (x); +} +declare_mgen_alias (__ceil, ceil) diff --git a/sysdeps/m68k/m680x0/fpu/s_ceilf.c b/sysdeps/m68k/m680x0/fpu/s_ceilf.c index b3ba6a57008..74e027e40c7 100644 --- a/sysdeps/m68k/m680x0/fpu/s_ceilf.c +++ b/sysdeps/m68k/m680x0/fpu/s_ceilf.c @@ -1,2 +1,2 @@ -#define FUNC ceilf -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_ceill.c b/sysdeps/m68k/m680x0/fpu/s_ceill.c index 2bf95b00c63..5188c2471d4 100644 --- a/sysdeps/m68k/m680x0/fpu/s_ceill.c +++ b/sysdeps/m68k/m680x0/fpu/s_ceill.c @@ -1,2 +1,2 @@ -#define FUNC ceill -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_cos.c b/sysdeps/m68k/m680x0/fpu/s_cos.c index 2f1adf77f57..24e508e5c36 100644 --- a/sysdeps/m68k/m680x0/fpu/s_cos.c +++ b/sysdeps/m68k/m680x0/fpu/s_cos.c @@ -1,2 +1,2 @@ -#define FUNC cos -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_cos_template.c b/sysdeps/m68k/m680x0/fpu/s_cos_template.c new file mode 100644 index 00000000000..56a5a75bb28 --- /dev/null +++ b/sysdeps/m68k/m680x0/fpu/s_cos_template.c @@ -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 + . */ + +#include +#include +#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) diff --git a/sysdeps/m68k/m680x0/fpu/s_cosf.c b/sysdeps/m68k/m680x0/fpu/s_cosf.c index b6d6accb4ac..fcfc844dfef 100644 --- a/sysdeps/m68k/m680x0/fpu/s_cosf.c +++ b/sysdeps/m68k/m680x0/fpu/s_cosf.c @@ -1,2 +1,2 @@ -#define FUNC cosf -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_cosl.c b/sysdeps/m68k/m680x0/fpu/s_cosl.c index eb61521fdda..de8767cfe3e 100644 --- a/sysdeps/m68k/m680x0/fpu/s_cosl.c +++ b/sysdeps/m68k/m680x0/fpu/s_cosl.c @@ -1,2 +1,2 @@ -#define FUNC cosl -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_expm1.c b/sysdeps/m68k/m680x0/fpu/s_expm1.c index c969a7f029b..e3abfbdfa53 100644 --- a/sysdeps/m68k/m680x0/fpu/s_expm1.c +++ b/sysdeps/m68k/m680x0/fpu/s_expm1.c @@ -15,27 +15,6 @@ License along with the GNU C Library. If not, see . */ -#include -#include -#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 +#define o_threshold 7.09782712893383973096e+02 +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_expm1_template.c b/sysdeps/m68k/m680x0/fpu/s_expm1_template.c new file mode 100644 index 00000000000..492cc876195 --- /dev/null +++ b/sysdeps/m68k/m680x0/fpu/s_expm1_template.c @@ -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 + . */ + +#include +#include +#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) diff --git a/sysdeps/m68k/m680x0/fpu/s_expm1f.c b/sysdeps/m68k/m680x0/fpu/s_expm1f.c index 2cd8ffcfeb3..a36080030ef 100644 --- a/sysdeps/m68k/m680x0/fpu/s_expm1f.c +++ b/sysdeps/m68k/m680x0/fpu/s_expm1f.c @@ -1,4 +1,3 @@ -#define FUNC expm1f -#define float_type float +#include #define o_threshold 8.8722831726e+01F -#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_expm1l.c b/sysdeps/m68k/m680x0/fpu/s_expm1l.c index a2c80860ba4..cfbab2843bf 100644 --- a/sysdeps/m68k/m680x0/fpu/s_expm1l.c +++ b/sysdeps/m68k/m680x0/fpu/s_expm1l.c @@ -1,6 +1,5 @@ -#define FUNC expm1l -#define float_type long double +#include /* 400c0000b17217f7d1cf79ab */ #define o_threshold 1.13565234062941439487914863093465101e+04L -#include +#include libm_hidden_def (__expm1l) diff --git a/sysdeps/m68k/m680x0/fpu/s_fabs.c b/sysdeps/m68k/m680x0/fpu/s_fabs.c index 1f0631e2ff0..179a94add2a 100644 --- a/sysdeps/m68k/m680x0/fpu/s_fabs.c +++ b/sysdeps/m68k/m680x0/fpu/s_fabs.c @@ -1,2 +1,2 @@ -#define FUNC fabs -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_fabs_template.c b/sysdeps/m68k/m680x0/fpu/s_fabs_template.c new file mode 100644 index 00000000000..5b74e4b564e --- /dev/null +++ b/sysdeps/m68k/m680x0/fpu/s_fabs_template.c @@ -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 + . */ + +#include + +FLOAT +M_DECL_FUNC (__fabs) (FLOAT x) +{ + return __m81_u(M_SUF (__fabs)) (x); +} +declare_mgen_alias (__fabs, fabs) diff --git a/sysdeps/m68k/m680x0/fpu/s_fabsf.c b/sysdeps/m68k/m680x0/fpu/s_fabsf.c index 8f9421998a4..9072d2a76ac 100644 --- a/sysdeps/m68k/m680x0/fpu/s_fabsf.c +++ b/sysdeps/m68k/m680x0/fpu/s_fabsf.c @@ -1,2 +1,2 @@ -#define FUNC fabsf -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_fabsl.c b/sysdeps/m68k/m680x0/fpu/s_fabsl.c index 8ac14d5b8c6..fa48f8ae4e5 100644 --- a/sysdeps/m68k/m680x0/fpu/s_fabsl.c +++ b/sysdeps/m68k/m680x0/fpu/s_fabsl.c @@ -1,2 +1,2 @@ -#define FUNC fabsl -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_floor.c b/sysdeps/m68k/m680x0/fpu/s_floor.c index e1219c602ac..339ae2cce4a 100644 --- a/sysdeps/m68k/m680x0/fpu/s_floor.c +++ b/sysdeps/m68k/m680x0/fpu/s_floor.c @@ -1,2 +1,2 @@ -#define FUNC floor -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_floor_template.c b/sysdeps/m68k/m680x0/fpu/s_floor_template.c new file mode 100644 index 00000000000..542d8b85c90 --- /dev/null +++ b/sysdeps/m68k/m680x0/fpu/s_floor_template.c @@ -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 + . */ + +#include + +FLOAT +M_DECL_FUNC (__floor) (FLOAT x) +{ + return __m81_u(M_SUF (__floor)) (x); +} +declare_mgen_alias (__floor, floor) diff --git a/sysdeps/m68k/m680x0/fpu/s_floorf.c b/sysdeps/m68k/m680x0/fpu/s_floorf.c index f4f9b9a1d85..5d998e02175 100644 --- a/sysdeps/m68k/m680x0/fpu/s_floorf.c +++ b/sysdeps/m68k/m680x0/fpu/s_floorf.c @@ -1,2 +1,2 @@ -#define FUNC floorf -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_floorl.c b/sysdeps/m68k/m680x0/fpu/s_floorl.c index 2c1ffd7d2c5..2295f998454 100644 --- a/sysdeps/m68k/m680x0/fpu/s_floorl.c +++ b/sysdeps/m68k/m680x0/fpu/s_floorl.c @@ -1,2 +1,2 @@ -#define FUNC floorl -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_frexp.c b/sysdeps/m68k/m680x0/fpu/s_frexp.c index 009b1e32238..be8db3875ab 100644 --- a/sysdeps/m68k/m680x0/fpu/s_frexp.c +++ b/sysdeps/m68k/m680x0/fpu/s_frexp.c @@ -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 - . */ - -#include - -#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 +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_frexp_template.c b/sysdeps/m68k/m680x0/fpu/s_frexp_template.c new file mode 100644 index 00000000000..7f508873737 --- /dev/null +++ b/sysdeps/m68k/m680x0/fpu/s_frexp_template.c @@ -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 + . */ + +#include + +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) diff --git a/sysdeps/m68k/m680x0/fpu/s_frexpf.c b/sysdeps/m68k/m680x0/fpu/s_frexpf.c index 893b6ad3cf6..6cf7ceb2945 100644 --- a/sysdeps/m68k/m680x0/fpu/s_frexpf.c +++ b/sysdeps/m68k/m680x0/fpu/s_frexpf.c @@ -1,3 +1,2 @@ -#define FUNC frexpf -#define float_type float -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_log1p.c b/sysdeps/m68k/m680x0/fpu/s_log1p.c index 082618df18a..7eb2529547d 100644 --- a/sysdeps/m68k/m680x0/fpu/s_log1p.c +++ b/sysdeps/m68k/m680x0/fpu/s_log1p.c @@ -1,4 +1,4 @@ #define FUNC log1p #undef weak_alias #define weak_alias(a,b) -#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_log1pf.c b/sysdeps/m68k/m680x0/fpu/s_log1pf.c index 480c39519fa..40f332ff36c 100644 --- a/sysdeps/m68k/m680x0/fpu/s_log1pf.c +++ b/sysdeps/m68k/m680x0/fpu/s_log1pf.c @@ -1,4 +1,4 @@ #define FUNC log1pf #undef weak_alias #define weak_alias(a,b) -#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_log1pl.c b/sysdeps/m68k/m680x0/fpu/s_log1pl.c index a4f34a4f863..e580bafbc5b 100644 --- a/sysdeps/m68k/m680x0/fpu/s_log1pl.c +++ b/sysdeps/m68k/m680x0/fpu/s_log1pl.c @@ -1,4 +1,4 @@ #define FUNC log1pl #undef weak_alias #define weak_alias(a,b) -#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_lrint.c b/sysdeps/m68k/m680x0/fpu/s_lrint.c index d25a548dcd2..31440cfdbcf 100644 --- a/sysdeps/m68k/m680x0/fpu/s_lrint.c +++ b/sysdeps/m68k/m680x0/fpu/s_lrint.c @@ -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 - - 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 - . */ - -#include - -#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 +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_lrint_template.c b/sysdeps/m68k/m680x0/fpu/s_lrint_template.c new file mode 100644 index 00000000000..efa00f12b99 --- /dev/null +++ b/sysdeps/m68k/m680x0/fpu/s_lrint_template.c @@ -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 + + 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 + . */ + +#include + +long int +M_DECL_FUNC (__lrint) (FLOAT x) +{ + return __m81_u(M_SUF (__lrint)) (x); +} +declare_mgen_alias (__lrint, lrint) diff --git a/sysdeps/m68k/m680x0/fpu/s_lrintf.c b/sysdeps/m68k/m680x0/fpu/s_lrintf.c index 44924cb82f1..77e753baa7b 100644 --- a/sysdeps/m68k/m680x0/fpu/s_lrintf.c +++ b/sysdeps/m68k/m680x0/fpu/s_lrintf.c @@ -1,3 +1,2 @@ -#define suffix f -#define float_type float -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_lrintl.c b/sysdeps/m68k/m680x0/fpu/s_lrintl.c index cd0bd23b8a1..a4670b83c64 100644 --- a/sysdeps/m68k/m680x0/fpu/s_lrintl.c +++ b/sysdeps/m68k/m680x0/fpu/s_lrintl.c @@ -1,3 +1,2 @@ -#define suffix l -#define float_type long double -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_modf.c b/sysdeps/m68k/m680x0/fpu/s_modf.c index 3c1a5a27490..1d1c0ea7f25 100644 --- a/sysdeps/m68k/m680x0/fpu/s_modf.c +++ b/sysdeps/m68k/m680x0/fpu/s_modf.c @@ -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 - . */ - -#include -#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 +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_modf_template.c b/sysdeps/m68k/m680x0/fpu/s_modf_template.c new file mode 100644 index 00000000000..b354e738a5a --- /dev/null +++ b/sysdeps/m68k/m680x0/fpu/s_modf_template.c @@ -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 + . */ + +#include +#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) diff --git a/sysdeps/m68k/m680x0/fpu/s_modff.c b/sysdeps/m68k/m680x0/fpu/s_modff.c index 0c44d7c0ab6..3d28880398a 100644 --- a/sysdeps/m68k/m680x0/fpu/s_modff.c +++ b/sysdeps/m68k/m680x0/fpu/s_modff.c @@ -1,3 +1,2 @@ -#define SUFF f -#define float_type float -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_modfl.c b/sysdeps/m68k/m680x0/fpu/s_modfl.c index c7075b3ba9e..9057645249b 100644 --- a/sysdeps/m68k/m680x0/fpu/s_modfl.c +++ b/sysdeps/m68k/m680x0/fpu/s_modfl.c @@ -1,3 +1,2 @@ -#define SUFF l -#define float_type long double -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_nearbyint.c b/sysdeps/m68k/m680x0/fpu/s_nearbyint.c index b87f5e21604..6af0d9b1a99 100644 --- a/sysdeps/m68k/m680x0/fpu/s_nearbyint.c +++ b/sysdeps/m68k/m680x0/fpu/s_nearbyint.c @@ -1,2 +1,2 @@ -#define FUNC nearbyint -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_nearbyint_template.c b/sysdeps/m68k/m680x0/fpu/s_nearbyint_template.c new file mode 100644 index 00000000000..45463788c4c --- /dev/null +++ b/sysdeps/m68k/m680x0/fpu/s_nearbyint_template.c @@ -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 + . */ + +#include + +FLOAT +M_DECL_FUNC (__nearbyint) (FLOAT x) +{ + return __m81_u(M_SUF (__nearbyint)) (x); +} +declare_mgen_alias (__nearbyint, nearbyint) diff --git a/sysdeps/m68k/m680x0/fpu/s_nearbyintf.c b/sysdeps/m68k/m680x0/fpu/s_nearbyintf.c index 70d08ab44c7..aefd7fc7c5d 100644 --- a/sysdeps/m68k/m680x0/fpu/s_nearbyintf.c +++ b/sysdeps/m68k/m680x0/fpu/s_nearbyintf.c @@ -1,2 +1,2 @@ -#define FUNC nearbyintf -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_nearbyintl.c b/sysdeps/m68k/m680x0/fpu/s_nearbyintl.c index 230cd7784c9..8516caf947d 100644 --- a/sysdeps/m68k/m680x0/fpu/s_nearbyintl.c +++ b/sysdeps/m68k/m680x0/fpu/s_nearbyintl.c @@ -1,2 +1,2 @@ -#define FUNC nearbyintl -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_remquo.c b/sysdeps/m68k/m680x0/fpu/s_remquo.c index 554751ca871..b1d8f3a9720 100644 --- a/sysdeps/m68k/m680x0/fpu/s_remquo.c +++ b/sysdeps/m68k/m680x0/fpu/s_remquo.c @@ -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 - - 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 - . */ - -#include - -#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 +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_remquo_template.c b/sysdeps/m68k/m680x0/fpu/s_remquo_template.c new file mode 100644 index 00000000000..fb5a096054c --- /dev/null +++ b/sysdeps/m68k/m680x0/fpu/s_remquo_template.c @@ -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 + + 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 + . */ + +#include + +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) diff --git a/sysdeps/m68k/m680x0/fpu/s_remquof.c b/sysdeps/m68k/m680x0/fpu/s_remquof.c index 8a292fc26cb..f2b86628d20 100644 --- a/sysdeps/m68k/m680x0/fpu/s_remquof.c +++ b/sysdeps/m68k/m680x0/fpu/s_remquof.c @@ -1,3 +1,2 @@ -#define SUFF f -#define float_type float -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_remquol.c b/sysdeps/m68k/m680x0/fpu/s_remquol.c index d236cfd1f99..cb18d9e520e 100644 --- a/sysdeps/m68k/m680x0/fpu/s_remquol.c +++ b/sysdeps/m68k/m680x0/fpu/s_remquol.c @@ -1,3 +1,2 @@ -#define SUFF l -#define float_type long double -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_rint.c b/sysdeps/m68k/m680x0/fpu/s_rint.c index f0f18c73467..fa092c07eb8 100644 --- a/sysdeps/m68k/m680x0/fpu/s_rint.c +++ b/sysdeps/m68k/m680x0/fpu/s_rint.c @@ -1,2 +1,2 @@ -#define FUNC rint -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_rint_template.c b/sysdeps/m68k/m680x0/fpu/s_rint_template.c new file mode 100644 index 00000000000..2589f9d3321 --- /dev/null +++ b/sysdeps/m68k/m680x0/fpu/s_rint_template.c @@ -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 + . */ + +#include + +FLOAT +M_DECL_FUNC (__rint) (FLOAT x) +{ + return __m81_u(M_SUF (__rint)) (x); +} +declare_mgen_alias (__rint, rint) diff --git a/sysdeps/m68k/m680x0/fpu/s_rintf.c b/sysdeps/m68k/m680x0/fpu/s_rintf.c index 4e00cab0fb0..5cda19c6908 100644 --- a/sysdeps/m68k/m680x0/fpu/s_rintf.c +++ b/sysdeps/m68k/m680x0/fpu/s_rintf.c @@ -1,2 +1,2 @@ -#define FUNC rintf -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_rintl.c b/sysdeps/m68k/m680x0/fpu/s_rintl.c index 305667b3a1c..df393ee8957 100644 --- a/sysdeps/m68k/m680x0/fpu/s_rintl.c +++ b/sysdeps/m68k/m680x0/fpu/s_rintl.c @@ -1,2 +1,2 @@ -#define FUNC rintl -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_significand.c b/sysdeps/m68k/m680x0/fpu/s_significand.c index 34d4ea3d145..d43de6ed910 100644 --- a/sysdeps/m68k/m680x0/fpu/s_significand.c +++ b/sysdeps/m68k/m680x0/fpu/s_significand.c @@ -1,2 +1,35 @@ -#define FUNC significand -#include +/* 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 + . */ + +#include + +#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) diff --git a/sysdeps/m68k/m680x0/fpu/s_significandf.c b/sysdeps/m68k/m680x0/fpu/s_significandf.c index 4e769ca3171..bbaa64bb13a 100644 --- a/sysdeps/m68k/m680x0/fpu/s_significandf.c +++ b/sysdeps/m68k/m680x0/fpu/s_significandf.c @@ -1,2 +1,5 @@ -#define FUNC significandf -#include +#ifndef FUNC +#define FUNC significandf +#endif +#define float_type float +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_significandl.c b/sysdeps/m68k/m680x0/fpu/s_significandl.c index 8c6fc7e610b..f3496ee862c 100644 --- a/sysdeps/m68k/m680x0/fpu/s_significandl.c +++ b/sysdeps/m68k/m680x0/fpu/s_significandl.c @@ -1,2 +1,5 @@ +#ifndef FUNC #define FUNC significandl -#include +#endif +#define float_type long double +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_sin.c b/sysdeps/m68k/m680x0/fpu/s_sin.c index 953fb445cfc..b52e804ab98 100644 --- a/sysdeps/m68k/m680x0/fpu/s_sin.c +++ b/sysdeps/m68k/m680x0/fpu/s_sin.c @@ -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 - . */ - -#include -#include -#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 +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_sin_template.c b/sysdeps/m68k/m680x0/fpu/s_sin_template.c new file mode 100644 index 00000000000..c44d414c5b0 --- /dev/null +++ b/sysdeps/m68k/m680x0/fpu/s_sin_template.c @@ -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 + . */ + +#include +#include +#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) diff --git a/sysdeps/m68k/m680x0/fpu/s_sincos.c b/sysdeps/m68k/m680x0/fpu/s_sincos.c index ca93d93333f..9226798fd75 100644 --- a/sysdeps/m68k/m680x0/fpu/s_sincos.c +++ b/sysdeps/m68k/m680x0/fpu/s_sincos.c @@ -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 - . */ - -#include - -#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 +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_sincos_template.c b/sysdeps/m68k/m680x0/fpu/s_sincos_template.c new file mode 100644 index 00000000000..017f01198a7 --- /dev/null +++ b/sysdeps/m68k/m680x0/fpu/s_sincos_template.c @@ -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 + . */ + +#include + +void +M_DECL_FUNC (__sincos) (FLOAT x, FLOAT *sinx, FLOAT *cosx) +{ + __m81_u(M_SUF (__sincos)) (x, sinx, cosx); +} +declare_mgen_alias (__sincos, sincos) diff --git a/sysdeps/m68k/m680x0/fpu/s_sincosf.c b/sysdeps/m68k/m680x0/fpu/s_sincosf.c index 7ee2ec6600b..581388bdc60 100644 --- a/sysdeps/m68k/m680x0/fpu/s_sincosf.c +++ b/sysdeps/m68k/m680x0/fpu/s_sincosf.c @@ -1,3 +1,2 @@ -#define FUNC sincosf -#define float_type float -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_sincosl.c b/sysdeps/m68k/m680x0/fpu/s_sincosl.c index f998cc09774..6a88d3e88ab 100644 --- a/sysdeps/m68k/m680x0/fpu/s_sincosl.c +++ b/sysdeps/m68k/m680x0/fpu/s_sincosl.c @@ -1,3 +1,2 @@ -#define FUNC sincosl -#define float_type long double -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_sinf.c b/sysdeps/m68k/m680x0/fpu/s_sinf.c index 304f4f76f64..7868705d277 100644 --- a/sysdeps/m68k/m680x0/fpu/s_sinf.c +++ b/sysdeps/m68k/m680x0/fpu/s_sinf.c @@ -1,5 +1,2 @@ -#ifndef FUNC -# define FUNC sinf -#endif -#define float_type float -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_sinl.c b/sysdeps/m68k/m680x0/fpu/s_sinl.c index 31dac0bee70..f542d1b0961 100644 --- a/sysdeps/m68k/m680x0/fpu/s_sinl.c +++ b/sysdeps/m68k/m680x0/fpu/s_sinl.c @@ -1,5 +1,2 @@ -#ifndef FUNC -# define FUNC sinl -#endif -#define float_type long double -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_tan.c b/sysdeps/m68k/m680x0/fpu/s_tan.c index dfbbbb22704..c680a6b041a 100644 --- a/sysdeps/m68k/m680x0/fpu/s_tan.c +++ b/sysdeps/m68k/m680x0/fpu/s_tan.c @@ -1,2 +1,2 @@ -#define FUNC tan -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_tan_template.c b/sysdeps/m68k/m680x0/fpu/s_tan_template.c new file mode 100644 index 00000000000..62910961112 --- /dev/null +++ b/sysdeps/m68k/m680x0/fpu/s_tan_template.c @@ -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 + . */ + +#include +#include +#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) diff --git a/sysdeps/m68k/m680x0/fpu/s_tanf.c b/sysdeps/m68k/m680x0/fpu/s_tanf.c index 9ae66ddbf33..a95d4d757c9 100644 --- a/sysdeps/m68k/m680x0/fpu/s_tanf.c +++ b/sysdeps/m68k/m680x0/fpu/s_tanf.c @@ -1,2 +1,2 @@ -#define FUNC tanf -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_tanh.c b/sysdeps/m68k/m680x0/fpu/s_tanh.c index ac2e7dbb792..11d4bc4f71a 100644 --- a/sysdeps/m68k/m680x0/fpu/s_tanh.c +++ b/sysdeps/m68k/m680x0/fpu/s_tanh.c @@ -1,2 +1,2 @@ -#define FUNC tanh -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_tanh_template.c b/sysdeps/m68k/m680x0/fpu/s_tanh_template.c new file mode 100644 index 00000000000..6b591f1b377 --- /dev/null +++ b/sysdeps/m68k/m680x0/fpu/s_tanh_template.c @@ -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 + . */ + +#include + +FLOAT +M_DECL_FUNC (__tanh) (FLOAT x) +{ + return __m81_u(M_SUF (__tanh)) (x); +} +declare_mgen_alias (__tanh, tanh) diff --git a/sysdeps/m68k/m680x0/fpu/s_tanhf.c b/sysdeps/m68k/m680x0/fpu/s_tanhf.c index 1addaae4ff4..40f45a2fd78 100644 --- a/sysdeps/m68k/m680x0/fpu/s_tanhf.c +++ b/sysdeps/m68k/m680x0/fpu/s_tanhf.c @@ -1,2 +1,2 @@ -#define FUNC tanhf -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_tanhl.c b/sysdeps/m68k/m680x0/fpu/s_tanhl.c index 6e997911f2f..72f4d8f1bc2 100644 --- a/sysdeps/m68k/m680x0/fpu/s_tanhl.c +++ b/sysdeps/m68k/m680x0/fpu/s_tanhl.c @@ -1,2 +1,2 @@ -#define FUNC tanhl -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_tanl.c b/sysdeps/m68k/m680x0/fpu/s_tanl.c index 27daf8f29b1..099dbfde7df 100644 --- a/sysdeps/m68k/m680x0/fpu/s_tanl.c +++ b/sysdeps/m68k/m680x0/fpu/s_tanl.c @@ -1,2 +1,2 @@ -#define FUNC tanl -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_trunc.c b/sysdeps/m68k/m680x0/fpu/s_trunc.c index 96f29a776c9..a9f0c4b9db2 100644 --- a/sysdeps/m68k/m680x0/fpu/s_trunc.c +++ b/sysdeps/m68k/m680x0/fpu/s_trunc.c @@ -1,2 +1,2 @@ -#define FUNC trunc -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_trunc_template.c b/sysdeps/m68k/m680x0/fpu/s_trunc_template.c new file mode 100644 index 00000000000..9ed1e3d8e4d --- /dev/null +++ b/sysdeps/m68k/m680x0/fpu/s_trunc_template.c @@ -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 + . */ + +#include + +FLOAT +M_DECL_FUNC (__trunc) (FLOAT x) +{ + return __m81_u(M_SUF (__trunc)) (x); +} +declare_mgen_alias (__trunc, trunc) diff --git a/sysdeps/m68k/m680x0/fpu/s_truncf.c b/sysdeps/m68k/m680x0/fpu/s_truncf.c index 44dca748cac..65474c779b2 100644 --- a/sysdeps/m68k/m680x0/fpu/s_truncf.c +++ b/sysdeps/m68k/m680x0/fpu/s_truncf.c @@ -1,2 +1,2 @@ -#define FUNC truncf -#include +#include +#include diff --git a/sysdeps/m68k/m680x0/fpu/s_truncl.c b/sysdeps/m68k/m680x0/fpu/s_truncl.c index 8d35777aed4..cbb87540cf8 100644 --- a/sysdeps/m68k/m680x0/fpu/s_truncl.c +++ b/sysdeps/m68k/m680x0/fpu/s_truncl.c @@ -1,2 +1,2 @@ -#define FUNC truncl -#include +#include +#include -- 2.47.2