mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-22 04:50:07 +00:00
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.
This commit is contained in:
parent
c0535adfeb
commit
e53df1dee8
97
ChangeLog
97
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.
|
||||
|
||||
|
@ -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>
|
||||
|
26
sysdeps/m68k/m680x0/fpu/s_atan_template.c
Normal file
26
sysdeps/m68k/m680x0/fpu/s_atan_template.c
Normal file
@ -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)
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -1,2 +1,2 @@
|
||||
#define FUNC ceil
|
||||
#include <s_atan.c>
|
||||
#include <math-type-macros-double.h>
|
||||
#include <s_ceil_template.c>
|
||||
|
26
sysdeps/m68k/m680x0/fpu/s_ceil_template.c
Normal file
26
sysdeps/m68k/m680x0/fpu/s_ceil_template.c
Normal file
@ -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)
|
@ -1,2 +1,2 @@
|
||||
#define FUNC ceilf
|
||||
#include <s_atanf.c>
|
||||
#include <math-type-macros-float.h>
|
||||
#include <s_ceil_template.c>
|
||||
|
@ -1,2 +1,2 @@
|
||||
#define FUNC ceill
|
||||
#include <s_atanl.c>
|
||||
#include <math-type-macros-ldouble.h>
|
||||
#include <s_ceil_template.c>
|
||||
|
@ -1,2 +1,2 @@
|
||||
#define FUNC cos
|
||||
#include <s_sin.c>
|
||||
#include <math-type-macros-double.h>
|
||||
#include <s_cos_template.c>
|
||||
|
30
sysdeps/m68k/m680x0/fpu/s_cos_template.c
Normal file
30
sysdeps/m68k/m680x0/fpu/s_cos_template.c
Normal file
@ -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)
|
@ -1,2 +1,2 @@
|
||||
#define FUNC cosf
|
||||
#include <s_sinf.c>
|
||||
#include <math-type-macros-float.h>
|
||||
#include <s_cos_template.c>
|
||||
|
@ -1,2 +1,2 @@
|
||||
#define FUNC cosl
|
||||
#include <s_sinl.c>
|
||||
#include <math-type-macros-ldouble.h>
|
||||
#include <s_cos_template.c>
|
||||
|
@ -15,27 +15,6 @@
|
||||
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>
|
||||
|
30
sysdeps/m68k/m680x0/fpu/s_expm1_template.c
Normal file
30
sysdeps/m68k/m680x0/fpu/s_expm1_template.c
Normal file
@ -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)
|
@ -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>
|
||||
|
@ -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)
|
||||
|
@ -1,2 +1,2 @@
|
||||
#define FUNC fabs
|
||||
#include <s_atan.c>
|
||||
#include <math-type-macros-double.h>
|
||||
#include <s_fabs_template.c>
|
||||
|
26
sysdeps/m68k/m680x0/fpu/s_fabs_template.c
Normal file
26
sysdeps/m68k/m680x0/fpu/s_fabs_template.c
Normal file
@ -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)
|
@ -1,2 +1,2 @@
|
||||
#define FUNC fabsf
|
||||
#include <s_atanf.c>
|
||||
#include <math-type-macros-float.h>
|
||||
#include <s_fabs_template.c>
|
||||
|
@ -1,2 +1,2 @@
|
||||
#define FUNC fabsl
|
||||
#include <s_atanl.c>
|
||||
#include <math-type-macros-ldouble.h>
|
||||
#include <s_fabs_template.c>
|
||||
|
@ -1,2 +1,2 @@
|
||||
#define FUNC floor
|
||||
#include <s_atan.c>
|
||||
#include <math-type-macros-double.h>
|
||||
#include <s_floor_template.c>
|
||||
|
26
sysdeps/m68k/m680x0/fpu/s_floor_template.c
Normal file
26
sysdeps/m68k/m680x0/fpu/s_floor_template.c
Normal file
@ -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)
|
@ -1,2 +1,2 @@
|
||||
#define FUNC floorf
|
||||
#include <s_atanf.c>
|
||||
#include <math-type-macros-float.h>
|
||||
#include <s_floor_template.c>
|
||||
|
@ -1,2 +1,2 @@
|
||||
#define FUNC floorl
|
||||
#include <s_atanl.c>
|
||||
#include <math-type-macros-ldouble.h>
|
||||
#include <s_floor_template.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
|
||||
<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>
|
||||
|
45
sysdeps/m68k/m680x0/fpu/s_frexp_template.c
Normal file
45
sysdeps/m68k/m680x0/fpu/s_frexp_template.c
Normal file
@ -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)
|
@ -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>
|
||||
|
@ -1,4 +1,4 @@
|
||||
#define FUNC log1p
|
||||
#undef weak_alias
|
||||
#define weak_alias(a,b)
|
||||
#include <s_atan.c>
|
||||
#include <s_significand.c>
|
||||
|
@ -1,4 +1,4 @@
|
||||
#define FUNC log1pf
|
||||
#undef weak_alias
|
||||
#define weak_alias(a,b)
|
||||
#include <s_atanf.c>
|
||||
#include <s_significandf.c>
|
||||
|
@ -1,4 +1,4 @@
|
||||
#define FUNC log1pl
|
||||
#undef weak_alias
|
||||
#define weak_alias(a,b)
|
||||
#include <s_atanl.c>
|
||||
#include <s_significandl.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 <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>
|
||||
|
28
sysdeps/m68k/m680x0/fpu/s_lrint_template.c
Normal file
28
sysdeps/m68k/m680x0/fpu/s_lrint_template.c
Normal file
@ -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)
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
43
sysdeps/m68k/m680x0/fpu/s_modf_template.c
Normal file
43
sysdeps/m68k/m680x0/fpu/s_modf_template.c
Normal file
@ -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)
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -1,2 +1,2 @@
|
||||
#define FUNC nearbyint
|
||||
#include <s_atan.c>
|
||||
#include <math-type-macros-double.h>
|
||||
#include <s_nearbyint_template.c>
|
||||
|
26
sysdeps/m68k/m680x0/fpu/s_nearbyint_template.c
Normal file
26
sysdeps/m68k/m680x0/fpu/s_nearbyint_template.c
Normal file
@ -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)
|
@ -1,2 +1,2 @@
|
||||
#define FUNC nearbyintf
|
||||
#include <s_atanf.c>
|
||||
#include <math-type-macros-float.h>
|
||||
#include <s_nearbyint_template.c>
|
||||
|
@ -1,2 +1,2 @@
|
||||
#define FUNC nearbyintl
|
||||
#include <s_atanl.c>
|
||||
#include <math-type-macros-ldouble.h>
|
||||
#include <s_nearbyint_template.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 <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>
|
||||
|
36
sysdeps/m68k/m680x0/fpu/s_remquo_template.c
Normal file
36
sysdeps/m68k/m680x0/fpu/s_remquo_template.c
Normal file
@ -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)
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -1,2 +1,2 @@
|
||||
#define FUNC rint
|
||||
#include <s_atan.c>
|
||||
#include <math-type-macros-double.h>
|
||||
#include <s_rint_template.c>
|
||||
|
26
sysdeps/m68k/m680x0/fpu/s_rint_template.c
Normal file
26
sysdeps/m68k/m680x0/fpu/s_rint_template.c
Normal file
@ -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)
|
@ -1,2 +1,2 @@
|
||||
#define FUNC rintf
|
||||
#include <s_atanf.c>
|
||||
#include <math-type-macros-float.h>
|
||||
#include <s_rint_template.c>
|
||||
|
@ -1,2 +1,2 @@
|
||||
#define FUNC rintl
|
||||
#include <s_atanl.c>
|
||||
#include <math-type-macros-ldouble.h>
|
||||
#include <s_rint_template.c>
|
||||
|
@ -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)
|
||||
|
@ -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>
|
||||
|
@ -1,2 +1,5 @@
|
||||
#ifndef FUNC
|
||||
#define FUNC significandl
|
||||
#include <s_atanl.c>
|
||||
#endif
|
||||
#define float_type long double
|
||||
#include <s_significand.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
|
||||
<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>
|
||||
|
30
sysdeps/m68k/m680x0/fpu/s_sin_template.c
Normal file
30
sysdeps/m68k/m680x0/fpu/s_sin_template.c
Normal file
@ -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)
|
@ -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>
|
||||
|
26
sysdeps/m68k/m680x0/fpu/s_sincos_template.c
Normal file
26
sysdeps/m68k/m680x0/fpu/s_sincos_template.c
Normal file
@ -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)
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -1,2 +1,2 @@
|
||||
#define FUNC tan
|
||||
#include <s_sin.c>
|
||||
#include <math-type-macros-double.h>
|
||||
#include <s_tan_template.c>
|
||||
|
30
sysdeps/m68k/m680x0/fpu/s_tan_template.c
Normal file
30
sysdeps/m68k/m680x0/fpu/s_tan_template.c
Normal file
@ -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)
|
@ -1,2 +1,2 @@
|
||||
#define FUNC tanf
|
||||
#include <s_sinf.c>
|
||||
#include <math-type-macros-float.h>
|
||||
#include <s_tan_template.c>
|
||||
|
@ -1,2 +1,2 @@
|
||||
#define FUNC tanh
|
||||
#include <s_atan.c>
|
||||
#include <math-type-macros-double.h>
|
||||
#include <s_tanh_template.c>
|
||||
|
26
sysdeps/m68k/m680x0/fpu/s_tanh_template.c
Normal file
26
sysdeps/m68k/m680x0/fpu/s_tanh_template.c
Normal file
@ -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)
|
@ -1,2 +1,2 @@
|
||||
#define FUNC tanhf
|
||||
#include <s_atanf.c>
|
||||
#include <math-type-macros-float.h>
|
||||
#include <s_tanh_template.c>
|
||||
|
@ -1,2 +1,2 @@
|
||||
#define FUNC tanhl
|
||||
#include <s_atanl.c>
|
||||
#include <math-type-macros-ldouble.h>
|
||||
#include <s_tanh_template.c>
|
||||
|
@ -1,2 +1,2 @@
|
||||
#define FUNC tanl
|
||||
#include <s_sinl.c>
|
||||
#include <math-type-macros-ldouble.h>
|
||||
#include <s_tan_template.c>
|
||||
|
@ -1,2 +1,2 @@
|
||||
#define FUNC trunc
|
||||
#include <s_atan.c>
|
||||
#include <math-type-macros-double.h>
|
||||
#include <s_trunc_template.c>
|
||||
|
26
sysdeps/m68k/m680x0/fpu/s_trunc_template.c
Normal file
26
sysdeps/m68k/m680x0/fpu/s_trunc_template.c
Normal file
@ -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)
|
@ -1,2 +1,2 @@
|
||||
#define FUNC truncf
|
||||
#include <s_atanf.c>
|
||||
#include <math-type-macros-float.h>
|
||||
#include <s_trunc_template.c>
|
||||
|
@ -1,2 +1,2 @@
|
||||
#define FUNC truncl
|
||||
#include <s_atanl.c>
|
||||
#include <math-type-macros-ldouble.h>
|
||||
#include <s_trunc_template.c>
|
||||
|
Loading…
Reference in New Issue
Block a user