aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/m68k/fpu
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1996-06-06 05:23:42 +0000
committerRoland McGrath <roland@gnu.org>1996-06-06 05:23:42 +0000
commit8f30ca23f7c7d9181fc532be00e22da67e38a0bf (patch)
tree8fe5e0221f947526a47441e4ac4862c3be8dbcba /sysdeps/m68k/fpu
parentf127cd28b5f758a512fcd09e317e720c16bce3b4 (diff)
downloadglibc-8f30ca23f7c7d9181fc532be00e22da67e38a0bf.zip
glibc-8f30ca23f7c7d9181fc532be00e22da67e38a0bf.tar.gz
glibc-8f30ca23f7c7d9181fc532be00e22da67e38a0bf.tar.bz2
Tue Jun 4 22:03:02 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/m68k/fpu/__math.h: Define long double versions of the inline functions. * sysdeps/m68k/fpu/e_asinl.c, sysdeps/m68k/fpu/e_atanl.c, sysdeps/m68k/fpu/e_acosl.c, sysdeps/m68k/fpu/e_expl.c, sysdeps/m68k/fpu/e_fmodl.c, sysdeps/m68k/fpu/e_log10l.c, sysdeps/m68k/fpu/e_logl.c, sysdeps/m68k/fpu/e_powl.c, sysdeps/m68k/fpu/e_remainderl.c, sysdeps/m68k/fpu/e_scalbl.c, sysdeps/m68k/fpu/e_sinhl.c, sysdeps/m68k/fpu/e_sqrtl.c, sysdeps/m68k/fpu/k_cosl.c, sysdeps/m68k/fpu/k_sinl.c, sysdeps/m68k/fpu/k_tanl.c, sysdeps/m68k/fpu/s_atanl.c, sysdeps/m68k/fpu/s_ceill.c, sysdeps/m68k/fpu/s_cosl.c, sysdeps/m68k/fpu/s_expm1l.c, sysdeps/m68k/fpu/s_fabsl.c, sysdeps/m68k/fpu/s_finitel.c, sysdeps/m68k/fpu/s_floorl.c, sysdeps/m68k/fpu/s_frexpl.c, sysdeps/m68k/fpu/s_ilogbl.c, sysdeps/m68k/fpu/s_isinfl.c, sysdeps/m68k/fpu/s_isnanl.c, sysdeps/m68k/fpu/s_ldexpl.c, sysdeps/m68k/fpu/s_log1pl.c, sysdeps/m68k/fpu/s_logbl.c, sysdeps/m68k/fpu/s_modfl.c, sysdeps/m68k/fpu/s_rintl.c, sysdeps/m68k/fpu/s_scalbnl.c, sysdeps/m68k/fpu/s_significandl.c, sysdeps/m68k/fpu/s_sinl.c, sysdeps/m68k/fpu/s_tanhl.c, sysdeps/m68k/fpu/s_tanl.c: New files. * sysdeps/m68k/fpu/e_acos.c, sysdeps/m68k/fpu/e_fmod.c, sysdeps/m68k/fpu/k_cos.c, sysdeps/m68k/fpu/k_sin.c, sysdeps/m68k/fpu/k_tan.c, sysdeps/m68k/fpu/s_atan.c, sysdeps/m68k/fpu/s_frexp.c, sysdeps/m68k/fpu/s_ilogb.c, sysdeps/m68k/fpu/s_isinf.c, sysdeps/m68k/fpu/s_ldexp.c, sysdeps/m68k/fpu/s_modf.c: Define generic functions using FUNC and float_type with appropriate defaults. * sysdeps/m68k/fpu/e_acosf.c, sysdeps/m68k/fpu/e_fmodf.c, sysdeps/m68k/fpu/k_cosf.c, sysdeps/m68k/fpu/k_sinf.c, sysdeps/m68k/fpu/k_tanf.c, sysdeps/m68k/fpu/s_atanf.c, sysdeps/m68k/fpu/s_frexpf.c, sysdeps/m68k/fpu/s_ilogbf.c, sysdeps/m68k/fpu/s_isinff.c, sysdeps/m68k/fpu/s_ldexpf.c, sysdeps/m68k/fpu/s_modff.c: Include the corresponding double versions with appropriate definitions to get float functions, instead of defining them directly. * sysdeps/m68k/fpu/acos.c: File removed. * sysdeps/m68k/fpu/asin.c: File removed. * sysdeps/m68k/fpu/atan.c: File removed. * sysdeps/m68k/fpu/atan2.c: File removed. * sysdeps/m68k/fpu/atanh.c: File removed. * sysdeps/m68k/fpu/ceil.c: File removed. * sysdeps/m68k/fpu/cos.c: File removed. * sysdeps/m68k/fpu/cosh.c: File removed. * sysdeps/m68k/fpu/drem.c: File removed. * sysdeps/m68k/fpu/exp.c: File removed. * sysdeps/m68k/fpu/expm1.c: File removed. * sysdeps/m68k/fpu/fabs.c: File removed. * sysdeps/m68k/fpu/fl.h: File removed. * sysdeps/m68k/fpu/floor.c: File removed. * sysdeps/m68k/fpu/fmod.c: File removed. * sysdeps/m68k/fpu/frexp.c: File removed. * sysdeps/m68k/fpu/isinf.c: File removed. * sysdeps/m68k/fpu/isinfl.c: File removed. * sysdeps/m68k/fpu/isnan.c: File removed. * sysdeps/m68k/fpu/isnanl.c: File removed. * sysdeps/m68k/fpu/ldexp.c: File removed. * sysdeps/m68k/fpu/log.c: File removed. * sysdeps/m68k/fpu/log10.c: File removed. * sysdeps/m68k/fpu/log1p.c: File removed. * sysdeps/m68k/fpu/logb.c: File removed. * sysdeps/m68k/fpu/pow.c: File removed. * sysdeps/m68k/fpu/rint.c: File removed. * sysdeps/m68k/fpu/sin.c: File removed. * sysdeps/m68k/fpu/sinh.c: File removed. * sysdeps/m68k/fpu/sqrt.c: File removed. * sysdeps/m68k/fpu/tan.c: File removed. * sysdeps/m68k/fpu/tanh.c: File removed. * sysdeps/unix/sysv/linux/syscalls.list: Add select (the syscall name is _newselect). * sysdeps/unix/sysv/linux/select.S: File removed. * sysdeps/unix/sysv/linux/m68k/select.S: File removed; obsolete with current kernels, generic linux version is fine.
Diffstat (limited to 'sysdeps/m68k/fpu')
-rw-r--r--sysdeps/m68k/fpu/__math.h178
-rw-r--r--sysdeps/m68k/fpu/acos.c32
-rw-r--r--sysdeps/m68k/fpu/asin.c2
-rw-r--r--sysdeps/m68k/fpu/atan.c2
-rw-r--r--sysdeps/m68k/fpu/atan2.c71
-rw-r--r--sysdeps/m68k/fpu/atanh.c2
-rw-r--r--sysdeps/m68k/fpu/ceil.c4
-rw-r--r--sysdeps/m68k/fpu/cos.c2
-rw-r--r--sysdeps/m68k/fpu/cosh.c2
-rw-r--r--sysdeps/m68k/fpu/drem.c31
-rw-r--r--sysdeps/m68k/fpu/e_acos.c7
-rw-r--r--sysdeps/m68k/fpu/e_acosf.c29
-rw-r--r--sysdeps/m68k/fpu/e_asinl.c2
-rw-r--r--sysdeps/m68k/fpu/e_expl.c2
-rw-r--r--sysdeps/m68k/fpu/e_fmod.c7
-rw-r--r--sysdeps/m68k/fpu/e_fmodf.c29
-rw-r--r--sysdeps/m68k/fpu/e_fmodl.c5
-rw-r--r--sysdeps/m68k/fpu/e_log10l.c2
-rw-r--r--sysdeps/m68k/fpu/e_logl.c2
-rw-r--r--sysdeps/m68k/fpu/e_powl.c2
-rw-r--r--sysdeps/m68k/fpu/e_remainderl.c2
-rw-r--r--sysdeps/m68k/fpu/e_scalbl.c2
-rw-r--r--sysdeps/m68k/fpu/e_sinhl.c2
-rw-r--r--sysdeps/m68k/fpu/e_sqrtl.c2
-rw-r--r--sysdeps/m68k/fpu/exp.c3
-rw-r--r--sysdeps/m68k/fpu/expm1.c3
-rw-r--r--sysdeps/m68k/fpu/fabs.c3
-rw-r--r--sysdeps/m68k/fpu/fl.h41
-rw-r--r--sysdeps/m68k/fpu/floor.c3
-rw-r--r--sysdeps/m68k/fpu/fmod.c27
-rw-r--r--sysdeps/m68k/fpu/frexp.c27
-rw-r--r--sysdeps/m68k/fpu/isinf.c34
-rw-r--r--sysdeps/m68k/fpu/isinfl.c28
-rw-r--r--sysdeps/m68k/fpu/isnan.c4
-rw-r--r--sysdeps/m68k/fpu/isnanl.c28
-rw-r--r--sysdeps/m68k/fpu/k_cos.c15
-rw-r--r--sysdeps/m68k/fpu/k_cosf.c29
-rw-r--r--sysdeps/m68k/fpu/k_cosl.c3
-rw-r--r--sysdeps/m68k/fpu/k_sin.c16
-rw-r--r--sysdeps/m68k/fpu/k_sinf.c29
-rw-r--r--sysdeps/m68k/fpu/k_sinl.c3
-rw-r--r--sysdeps/m68k/fpu/k_tan.c18
-rw-r--r--sysdeps/m68k/fpu/k_tanf.c32
-rw-r--r--sysdeps/m68k/fpu/k_tanl.c3
-rw-r--r--sysdeps/m68k/fpu/ldexp.c27
-rw-r--r--sysdeps/m68k/fpu/log.c3
-rw-r--r--sysdeps/m68k/fpu/log10.c2
-rw-r--r--sysdeps/m68k/fpu/log1p.c2
-rw-r--r--sysdeps/m68k/fpu/logb.c46
-rw-r--r--sysdeps/m68k/fpu/pow.c27
-rw-r--r--sysdeps/m68k/fpu/rint.c5
-rw-r--r--sysdeps/m68k/fpu/s_atan.c7
-rw-r--r--sysdeps/m68k/fpu/s_atanf.c34
-rw-r--r--sysdeps/m68k/fpu/s_atanl.c5
-rw-r--r--sysdeps/m68k/fpu/s_ceill.c2
-rw-r--r--sysdeps/m68k/fpu/s_cosl.c2
-rw-r--r--sysdeps/m68k/fpu/s_expm1l.c2
-rw-r--r--sysdeps/m68k/fpu/s_fabsl.c2
-rw-r--r--sysdeps/m68k/fpu/s_finitel.c2
-rw-r--r--sysdeps/m68k/fpu/s_floorl.c2
-rw-r--r--sysdeps/m68k/fpu/s_frexp.c18
-rw-r--r--sysdeps/m68k/fpu/s_frexpf.c30
-rw-r--r--sysdeps/m68k/fpu/s_frexpl.c3
-rw-r--r--sysdeps/m68k/fpu/s_ilogb.c16
-rw-r--r--sysdeps/m68k/fpu/s_ilogbf.c31
-rw-r--r--sysdeps/m68k/fpu/s_ilogbl.c3
-rw-r--r--sysdeps/m68k/fpu/s_isinf.c5
-rw-r--r--sysdeps/m68k/fpu/s_isinff.c34
-rw-r--r--sysdeps/m68k/fpu/s_isinfl.c5
-rw-r--r--sysdeps/m68k/fpu/s_isnanl.c2
-rw-r--r--sysdeps/m68k/fpu/s_ldexp.c7
-rw-r--r--sysdeps/m68k/fpu/s_ldexpf.c34
-rw-r--r--sysdeps/m68k/fpu/s_ldexpl.c5
-rw-r--r--sysdeps/m68k/fpu/s_log1pl.c2
-rw-r--r--sysdeps/m68k/fpu/s_logbl.c2
-rw-r--r--sysdeps/m68k/fpu/s_modf.c18
-rw-r--r--sysdeps/m68k/fpu/s_modff.c30
-rw-r--r--sysdeps/m68k/fpu/s_modfl.c3
-rw-r--r--sysdeps/m68k/fpu/s_rintl.c2
-rw-r--r--sysdeps/m68k/fpu/s_scalbnl.c2
-rw-r--r--sysdeps/m68k/fpu/s_significandl.c2
-rw-r--r--sysdeps/m68k/fpu/s_sinl.c2
-rw-r--r--sysdeps/m68k/fpu/s_tanhl.c2
-rw-r--r--sysdeps/m68k/fpu/s_tanl.c2
-rw-r--r--sysdeps/m68k/fpu/sin.c2
-rw-r--r--sysdeps/m68k/fpu/sinh.c2
-rw-r--r--sysdeps/m68k/fpu/sqrt.c2
-rw-r--r--sysdeps/m68k/fpu/tan.c2
-rw-r--r--sysdeps/m68k/fpu/tanh.c2
89 files changed, 396 insertions, 814 deletions
diff --git a/sysdeps/m68k/fpu/__math.h b/sysdeps/m68k/fpu/__math.h
index f59c168..2cbb4ca 100644
--- a/sysdeps/m68k/fpu/__math.h
+++ b/sysdeps/m68k/fpu/__math.h
@@ -54,6 +54,14 @@ Cambridge, MA 02139, USA. */
__asm("f" __STRING(op) "%.x %1, %0" : "=f" (__result) : "f" (__mathop_x));\
return __result; \
}
+
+#define __inline_mathopl(func, op) \
+ __m81_defun (long double, func, (long double __mathop_x)) \
+ { \
+ long double __result; \
+ __asm("f" __STRING(op) "%.x %1, %0" : "=f" (__result) : "f" (__mathop_x));\
+ return __result; \
+ }
/* ieee style elementary functions */
__inline_mathop(__ieee754_acos, acos)
@@ -77,6 +85,17 @@ __inline_mathopf(__ieee754_logf, logn)
__inline_mathopf(__ieee754_sqrtf, sqrt)
__inline_mathopf(__ieee754_atanhf, atan)
+/* ieee style elementary long double functions */
+__inline_mathopl(__ieee754_acosl, acos)
+__inline_mathopl(__ieee754_asinl, asin)
+__inline_mathopl(__ieee754_coshl, cosh)
+__inline_mathopl(__ieee754_sinhl, sinh)
+__inline_mathopl(__ieee754_expl, etox)
+__inline_mathopl(__ieee754_log10l, log10)
+__inline_mathopl(__ieee754_logl, logn)
+__inline_mathopl(__ieee754_sqrtl, sqrt)
+__inline_mathopl(__ieee754_atanhl, atan)
+
__inline_mathop(__atan, atan)
__inline_mathop(__cos, cos)
__inline_mathop(__sin, sin)
@@ -105,6 +124,20 @@ __inline_mathopf(__log1pf, lognp1)
__inline_mathopf(__logbf, log2)
__inline_mathopf(__significandf, getman)
+__inline_mathopl(__atanl, atan)
+__inline_mathopl(__cosl, cos)
+__inline_mathopl(__sinl, sin)
+__inline_mathopl(__tanl, tan)
+__inline_mathopl(__tanhl, tanh)
+__inline_mathopl(__fabsl, abs)
+__inline_mathopl(__sqrtl, sqrt)
+
+__inline_mathopl(__rintl, int)
+__inline_mathopl(__expm1l, etoxm1)
+__inline_mathopl(__log1pl, lognp1)
+__inline_mathopl(__logbl, log2)
+__inline_mathopl(__significandl, getman)
+
__m81_defun (double, __ieee754_remainder, (double __x, double __y))
{
double __result;
@@ -427,6 +460,119 @@ __m81_defun (float, __scalbnf, (float __x, int __n))
return __result;
}
+__m81_defun (long double, __ieee754_remainderl, (long double __x,
+ long double __y))
+{
+ long double __result;
+ __asm ("frem%.x %1, %0" : "=f" (__result) : "f" (__y), "0" (__x));
+ return __result;
+}
+
+__m81_defun (long double, __ldexpl, (long double __x, int __e))
+{
+ long double __result;
+ long double __float_e = (long double) __e;
+ __asm ("fscale%.x %1, %0" : "=f" (__result) : "f" (__float_e), "0" (__x));
+ return __result;
+}
+
+__m81_defun (long double, __ieee754_fmodl, (long double __x, long double __y))
+{
+ long double __result;
+ __asm("fmod%.x %1, %0" : "=f" (__result) : "f" (__y), "0" (__x));
+ return __result;
+}
+
+__m81_inline long double
+__m81_u(__frexpl)(long double __value, int *__expptr)
+{
+ long double __mantissa, __exponent;
+ __asm("fgetexp%.x %1, %0" : "=f" (__exponent) : "f" (__value));
+ __asm("fgetman%.x %1, %0" : "=f" (__mantissa) : "f" (__value));
+ *__expptr = (int) __exponent;
+ return __mantissa;
+}
+
+__m81_defun (long double, __floorl, (long double __x))
+{
+ long double __result;
+ unsigned long int __ctrl_reg;
+ __asm __volatile__ ("fmove%.l %!, %0" : "=dm" (__ctrl_reg));
+ /* Set rounding towards negative infinity. */
+ __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */
+ : "dmi" ((__ctrl_reg & ~0x10) | 0x20));
+ /* Convert X to an integer, using -Inf rounding. */
+ __asm __volatile__ ("fint%.x %1, %0" : "=f" (__result) : "f" (__x));
+ /* Restore the previous rounding mode. */
+ __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */
+ : "dmi" (__ctrl_reg));
+ return __result;
+}
+
+__m81_defun (long double, __ieee754_powl, (long double __x, long double __y))
+{
+ long double __result;
+ if (__x == 0.0l)
+ {
+ if (__y <= 0.0l)
+ __result = 0.0l / 0.0l;
+ else
+ __result = 0.0l;
+ }
+ else if (__y == 0.0l || __x == 1.0l)
+ __result = 1.0;
+ else if (__y == 1.0l)
+ __result = __x;
+ else if (__y == 2.0l)
+ __result = __x * __x;
+ else if (__x == 10.0l)
+ __asm("ftentox%.x %1, %0" : "=f" (__result) : "f" (__y));
+ else if (__x == 2.0l)
+ __asm("ftwotox%.x %1, %0" : "=f" (__result) : "f" (__y));
+ else if (__x < 0.0l)
+ {
+ long double __temp = __m81_u(__rintl)(__y);
+ if (__y == __temp)
+ {
+ int i = (int) __y;
+ __result
+ = __m81_u(__ieee754_expl)(__y * __m81_u(__ieee754_logl)(-__x));
+ if (i & 1)
+ __result = -__result;
+ }
+ else
+ __result = 0.0l / 0.0l;
+ }
+ else
+ __result = __m81_u(__ieee754_expl)(__y * __m81_u(__ieee754_logl)(__x));
+ return __result;
+}
+
+__m81_defun (long double, __ceill, (long double __x))
+{
+ long double __result;
+ unsigned long int __ctrl_reg;
+ __asm __volatile__ ("fmove%.l %!, %0" : "=dm" (__ctrl_reg));
+ /* Set rounding towards positive infinity. */
+ __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */
+ : "dmi" (__ctrl_reg | 0x30));
+ /* Convert X to an integer, using +Inf rounding. */
+ __asm __volatile__ ("fint%.x %1, %0" : "=f" (__result) : "f" (__x));
+ /* Restore the previous rounding mode. */
+ __asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */
+ : "dmi" (__ctrl_reg));
+ return __result;
+}
+
+__m81_inline long double
+__m81_u(__modfl)(long double __value, long double *__iptr)
+{
+ long double __modf_int;
+ __asm ("fintrz%.x %1, %0" : "=f" (__modf_int) : "f" (__value));
+ *__iptr = __modf_int;
+ return __value - __modf_int;
+}
+
__m81_defun (int, __isinfl, (long double __value))
{
/* There is no branch-condition for infinity,
@@ -445,4 +591,36 @@ __m81_defun (int, __isnanl, (long double __value))
return __result;
}
+__m81_defun (int, __finitel, (long double __value))
+{
+ /* There is no branch-condition for infinity, so we must extract and
+ examine the condition codes manually. */
+ unsigned long int __fpsr;
+ __asm ("ftst%.x %1\n"
+ "fmove%.l %/fpsr, %0" : "=dm" (__fpsr) : "f" (__value));
+ return (__fpsr & (3 << 24)) == 0;
+}
+
+__m81_defun (int, __ilogbl, (long double __x))
+{
+ long double __result;
+ __asm("fgetexp%.x %1, %0" : "=f" (__result) : "f" (__x));
+ return (int) __result;
+}
+
+__m81_defun (long double, __ieee754_scalbl, (long double __x, long double __n))
+{
+ long double __result;
+ __asm ("fscale%.x %1, %0" : "=f" (__result) : "f" (__n), "0" (__x));
+ return __result;
+}
+
+__m81_defun (long double, __scalbnl, (long double __x, int __n))
+{
+ long double __result;
+ long double __float_n = (long double) __n;
+ __asm ("fscale%.x %1, %0" : "=f" (__result) : "f" (__float_n), "0" (__x));
+ return __result;
+}
+
#endif /* GCC. */
diff --git a/sysdeps/m68k/fpu/acos.c b/sysdeps/m68k/fpu/acos.c
deleted file mode 100644
index 1481ce2..0000000
--- a/sysdeps/m68k/fpu/acos.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Copyright (C) 1991, 1994 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 Library General Public License as
-published by the Free Software Foundation; either version 2 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
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
-
-#include <ansidecl.h>
-#define __NO_MATH_INLINES
-#include <math.h>
-
-#ifndef FUNC
-#define FUNC acos
-#endif
-
-
-double
-DEFUN(FUNC, (x), double x)
-{
- return __m81_u(FUNC)(x);
-}
diff --git a/sysdeps/m68k/fpu/asin.c b/sysdeps/m68k/fpu/asin.c
deleted file mode 100644
index 0e3e58f..0000000
--- a/sysdeps/m68k/fpu/asin.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define FUNC asin
-#include <acos.c>
diff --git a/sysdeps/m68k/fpu/atan.c b/sysdeps/m68k/fpu/atan.c
deleted file mode 100644
index b9d428e..0000000
--- a/sysdeps/m68k/fpu/atan.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define FUNC atan
-#include <acos.c>
diff --git a/sysdeps/m68k/fpu/atan2.c b/sysdeps/m68k/fpu/atan2.c
deleted file mode 100644
index 753b7f0..0000000
--- a/sysdeps/m68k/fpu/atan2.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/* Copyright (C) 1991, 1992, 1994 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 Library General Public License as
-published by the Free Software Foundation; either version 2 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
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
-
-#include <ansidecl.h>
-#include <math.h>
-
-#ifdef __GNUC__
-
-double
-DEFUN(atan2, (y, x), double y AND double x)
-{
- static CONST double one = 1.0, zero = 0.0;
- double signx, signy;
- double pi, PIo4, PIo2;
-
- if (__isnan(x))
- return x;
- if (__isnan(y))
- return y;
-
- signy = __copysign(one, y);
- signx = __copysign(one, x);
-
- asm("fmovecr%.x %1, %0" : "=f" (pi) : "i" (0));
- PIo2 = pi / 2;
- PIo4 = pi / 4;
-
- if (y == zero)
- return signx == one ? y : __copysign(pi, signy);
-
- if (x == zero)
- return __copysign(PIo2, signy);
-
- if (__isinf(x))
- {
- if (__isinf(y))
- return __copysign(signx == one ? PIo4 : 3 * PIo4, signy);
- else
- return __copysign(signx == one ? zero : pi, signy);
- }
-
- if (__isinf(y))
- return __copysign(PIo2, signy);
-
- y = fabs(y);
-
- if (x < 0.0)
- /* X is negative. */
- return __copysign(pi - atan(y / -x), signy);
-
- return __copysign(atan(y / x), signy);
-}
-
-#else
-#include <sysdeps/generic/atan2.c>
-#endif
diff --git a/sysdeps/m68k/fpu/atanh.c b/sysdeps/m68k/fpu/atanh.c
deleted file mode 100644
index d4636ec..0000000
--- a/sysdeps/m68k/fpu/atanh.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define FUNC atanh
-#include <acos.c>
diff --git a/sysdeps/m68k/fpu/ceil.c b/sysdeps/m68k/fpu/ceil.c
deleted file mode 100644
index b4605e1..0000000
--- a/sysdeps/m68k/fpu/ceil.c
+++ /dev/null
@@ -1,4 +0,0 @@
-
-#define FUNC ceil
-
-#include <acos.c>
diff --git a/sysdeps/m68k/fpu/cos.c b/sysdeps/m68k/fpu/cos.c
deleted file mode 100644
index fa50130..0000000
--- a/sysdeps/m68k/fpu/cos.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define FUNC cos
-#include <acos.c>
diff --git a/sysdeps/m68k/fpu/cosh.c b/sysdeps/m68k/fpu/cosh.c
deleted file mode 100644
index 78a8194..0000000
--- a/sysdeps/m68k/fpu/cosh.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define FUNC cosh
-#include <acos.c>
diff --git a/sysdeps/m68k/fpu/drem.c b/sysdeps/m68k/fpu/drem.c
deleted file mode 100644
index 16caacf..0000000
--- a/sysdeps/m68k/fpu/drem.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Copyright (C) 1991, 1992, 1994, 1995 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 Library General Public License as
-published by the Free Software Foundation; either version 2 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
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
-
-#include <ansidecl.h>
-#define __NO_MATH_INLINES
-#include <math.h>
-
-#undef drem
-
-double
-DEFUN(__drem, (x, y), double x AND double y)
-{
- return ____drem(x, y);
-}
-
-weak_alias (__drem, drem)
diff --git a/sysdeps/m68k/fpu/e_acos.c b/sysdeps/m68k/fpu/e_acos.c
index 34dfc82..ae77dab 100644
--- a/sysdeps/m68k/fpu/e_acos.c
+++ b/sysdeps/m68k/fpu/e_acos.c
@@ -22,9 +22,12 @@ Cambridge, MA 02139, USA. */
#ifndef FUNC
#define FUNC __ieee754_acos
#endif
+#ifndef float_type
+#define float_type double
+#endif
-double
-DEFUN(FUNC, (x), double x)
+float_type
+DEFUN(FUNC, (x), float_type x)
{
return __m81_u(FUNC)(x);
}
diff --git a/sysdeps/m68k/fpu/e_acosf.c b/sysdeps/m68k/fpu/e_acosf.c
index 34da7ee..9066508 100644
--- a/sysdeps/m68k/fpu/e_acosf.c
+++ b/sysdeps/m68k/fpu/e_acosf.c
@@ -1,30 +1,5 @@
-/* Copyright (C) 1996 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 Library General Public License as
-published by the Free Software Foundation; either version 2 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
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
-
-#include <ansidecl.h>
-#include <math.h>
-
#ifndef FUNC
#define FUNC __ieee754_acosf
#endif
-
-float
-DEFUN(FUNC, (x), float x)
-{
- return __m81_u(FUNC)(x);
-}
+#define float_type float
+#include <e_acos.c>
diff --git a/sysdeps/m68k/fpu/e_asinl.c b/sysdeps/m68k/fpu/e_asinl.c
new file mode 100644
index 0000000..0dd89fb
--- /dev/null
+++ b/sysdeps/m68k/fpu/e_asinl.c
@@ -0,0 +1,2 @@
+#define FUNC __ieee754_asinl
+#include <e_acosl.c>
diff --git a/sysdeps/m68k/fpu/e_expl.c b/sysdeps/m68k/fpu/e_expl.c
new file mode 100644
index 0000000..8805a1b
--- /dev/null
+++ b/sysdeps/m68k/fpu/e_expl.c
@@ -0,0 +1,2 @@
+#define FUNC __ieee754_expl
+#include <e_acosl.c>
diff --git a/sysdeps/m68k/fpu/e_fmod.c b/sysdeps/m68k/fpu/e_fmod.c
index 578fa3c..0b2468c 100644
--- a/sysdeps/m68k/fpu/e_fmod.c
+++ b/sysdeps/m68k/fpu/e_fmod.c
@@ -22,9 +22,12 @@ Cambridge, MA 02139, USA. */
#ifndef FUNC
#define FUNC __ieee754_fmod
#endif
+#ifndef float_type
+#define float_type double
+#endif
-double
-DEFUN(FUNC, (x, y), double x AND double y)
+float_type
+DEFUN(FUNC, (x, y), float_type x AND float_type y)
{
return __m81_u(FUNC)(x, y);
}
diff --git a/sysdeps/m68k/fpu/e_fmodf.c b/sysdeps/m68k/fpu/e_fmodf.c
index b3c3ead..88c350c 100644
--- a/sysdeps/m68k/fpu/e_fmodf.c
+++ b/sysdeps/m68k/fpu/e_fmodf.c
@@ -1,30 +1,5 @@
-/* Copyright (C) 1996 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 Library General Public License as
-published by the Free Software Foundation; either version 2 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
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
-
-#include <ansidecl.h>
-#include <math.h>
-
#ifndef FUNC
#define FUNC __ieee754_fmodf
#endif
-
-float
-DEFUN(FUNC, (x, y), float x AND float y)
-{
- return __m81_u(FUNC)(x, y);
-}
+#define float_type float
+#include <e_fmod.c>
diff --git a/sysdeps/m68k/fpu/e_fmodl.c b/sysdeps/m68k/fpu/e_fmodl.c
new file mode 100644
index 0000000..a46f19e
--- /dev/null
+++ b/sysdeps/m68k/fpu/e_fmodl.c
@@ -0,0 +1,5 @@
+#ifndef FUNC
+#define FUNC __ieee754_fmodl
+#endif
+#define float_type long double
+#include <e_fmod.c>
diff --git a/sysdeps/m68k/fpu/e_log10l.c b/sysdeps/m68k/fpu/e_log10l.c
new file mode 100644
index 0000000..6dcfc5a
--- /dev/null
+++ b/sysdeps/m68k/fpu/e_log10l.c
@@ -0,0 +1,2 @@
+#define FUNC __ieee754_log10l
+#include <e_acosl.c>
diff --git a/sysdeps/m68k/fpu/e_logl.c b/sysdeps/m68k/fpu/e_logl.c
new file mode 100644
index 0000000..03b1830
--- /dev/null
+++ b/sysdeps/m68k/fpu/e_logl.c
@@ -0,0 +1,2 @@
+#define FUNC __ieee754_logl
+#include <e_acosl.c>
diff --git a/sysdeps/m68k/fpu/e_powl.c b/sysdeps/m68k/fpu/e_powl.c
new file mode 100644
index 0000000..0feec54
--- /dev/null
+++ b/sysdeps/m68k/fpu/e_powl.c
@@ -0,0 +1,2 @@
+#define FUNC __ieee754_powl
+#include <e_fmodl.c>
diff --git a/sysdeps/m68k/fpu/e_remainderl.c b/sysdeps/m68k/fpu/e_remainderl.c
new file mode 100644
index 0000000..b9dc540
--- /dev/null
+++ b/sysdeps/m68k/fpu/e_remainderl.c
@@ -0,0 +1,2 @@
+#define FUNC __ieee754_remainderl
+#include <e_fmodl.c>
diff --git a/sysdeps/m68k/fpu/e_scalbl.c b/sysdeps/m68k/fpu/e_scalbl.c
new file mode 100644
index 0000000..92ab7a4
--- /dev/null
+++ b/sysdeps/m68k/fpu/e_scalbl.c
@@ -0,0 +1,2 @@
+#define FUNC __ieee754_scalbl
+#include <e_fmodl.c>
diff --git a/sysdeps/m68k/fpu/e_sinhl.c b/sysdeps/m68k/fpu/e_sinhl.c
new file mode 100644
index 0000000..2f42d96
--- /dev/null
+++ b/sysdeps/m68k/fpu/e_sinhl.c
@@ -0,0 +1,2 @@
+#define FUNC __ieee754_sinhl
+#include <e_acosl.c>
diff --git a/sysdeps/m68k/fpu/e_sqrtl.c b/sysdeps/m68k/fpu/e_sqrtl.c
new file mode 100644
index 0000000..fede102
--- /dev/null
+++ b/sysdeps/m68k/fpu/e_sqrtl.c
@@ -0,0 +1,2 @@
+#define FUNC __ieee754_sqrtl
+#include <e_acosl.c>
diff --git a/sysdeps/m68k/fpu/exp.c b/sysdeps/m68k/fpu/exp.c
deleted file mode 100644
index 2649d72..0000000
--- a/sysdeps/m68k/fpu/exp.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#define FUNC exp
-#define OP etox
-#include <acos.c>
diff --git a/sysdeps/m68k/fpu/expm1.c b/sysdeps/m68k/fpu/expm1.c
deleted file mode 100644
index 19f1802..0000000
--- a/sysdeps/m68k/fpu/expm1.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#define FUNC __expm1
-#define OP expm1
-#include <acos.c>
diff --git a/sysdeps/m68k/fpu/fabs.c b/sysdeps/m68k/fpu/fabs.c
deleted file mode 100644
index f9538a5..0000000
--- a/sysdeps/m68k/fpu/fabs.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#define FUNC fabs
-#define OP abs
-#include <acos.c>
diff --git a/sysdeps/m68k/fpu/fl.h b/sysdeps/m68k/fpu/fl.h
deleted file mode 100644
index 098e880..0000000
--- a/sysdeps/m68k/fpu/fl.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Floating-point constants for the 68881.
- Copyright (C) 1992 Free Software Foundation, Inc. */
-
-/* IGNORE($ This is used internally in the library. */
-#include <sysdeps/ieee754/fl.h>
-/* ansidecl.m4 here inserts the ieee file. Kludge o rama.
- $) ENDCOMMENT INCLUDE($sysdeps/ieee754/fl.h$) STARTCOMMENT */
-
-#ifndef __need_HUGE_VAL
-
-#ifdef __GNUC__
-
-#undef FLT_ROUNDS
-
-/* Interrogate the 68881 to find the current rounding mode. */
-
-static __const __inline int
-DEFUN_VOID(__flt_rounds)
-{
- unsigned long int __fpcr;
- __asm("fmove%.l fpcr, %0" : "=g" (__fpcr));
- switch (__fpcr & (1 | 2))
- {
- case 0:
- return _FLT_ROUNDS_TONEAREST;
- case 1:
- return _FLT_ROUNDS_TOZERO;
- case 2:
- return _FLT_ROUNDS_TONEGINF;
- case 3:
- return _FLT_ROUNDS_TOPOSINF;
- default:
- return _FLT_ROUNDS_INDETERMINATE;
- }
-}
-
-#define FLT_ROUNDS (__flt_rounds())
-
-#endif /* GCC. */
-
-#endif /* Don't need HUGE_VAL. */
diff --git a/sysdeps/m68k/fpu/floor.c b/sysdeps/m68k/fpu/floor.c
deleted file mode 100644
index 92a2ca6..0000000
--- a/sysdeps/m68k/fpu/floor.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#define FUNC floor
-#define OP intrz
-#include <acos.c>
diff --git a/sysdeps/m68k/fpu/fmod.c b/sysdeps/m68k/fpu/fmod.c
deleted file mode 100644
index e3a2de0..0000000
--- a/sysdeps/m68k/fpu/fmod.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright (C) 1991, 1994 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 Library General Public License as
-published by the Free Software Foundation; either version 2 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
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
-
-#include <ansidecl.h>
-#define __NO_MATH_INLINES
-#include <math.h>
-
-double
-DEFUN(fmod, (x, y), double x AND double y)
-{
- return __fmod(x, y);
-}
diff --git a/sysdeps/m68k/fpu/frexp.c b/sysdeps/m68k/fpu/frexp.c
deleted file mode 100644
index de74851..0000000
--- a/sysdeps/m68k/fpu/frexp.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright (C) 1991 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 Library General Public License as
-published by the Free Software Foundation; either version 2 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
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
-
-#include <ansidecl.h>
-#define __NO_MATH_INLINES
-#include <math.h>
-
-double
-DEFUN(frexp, (value, expptr), double value AND int *expptr)
-{
- return __frexp(value, expptr);
-}
diff --git a/sysdeps/m68k/fpu/isinf.c b/sysdeps/m68k/fpu/isinf.c
deleted file mode 100644
index ab2cf0b..0000000
--- a/sysdeps/m68k/fpu/isinf.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright (C) 1991, 1994, 1995 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 Library General Public License as
-published by the Free Software Foundation; either version 2 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
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
-
-#include <ansidecl.h>
-#define __NO_MATH_INLINES
-#include <math.h>
-
-#ifndef FUNC
-#define FUNC __isinf
-#endif
-
-
-int
-DEFUN(FUNC, (x), double x)
-{
- return __m81_u(FUNC)(x);
-}
-
-weak_alias (__isinf, isinf)
diff --git a/sysdeps/m68k/fpu/isinfl.c b/sysdeps/m68k/fpu/isinfl.c
deleted file mode 100644
index 97b5983..0000000
--- a/sysdeps/m68k/fpu/isinfl.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Copyright (C) 1996 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 Library General Public License as
-published by the Free Software Foundation; either version 2 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
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
-
-#include <ansidecl.h>
-#include <math.h>
-
-int
-DEFUN(__isinfl, (x), long double x)
-{
- return __m81_u(__isinfl)(x);
-}
-
-weak_alias (__isinfl, isinfl)
diff --git a/sysdeps/m68k/fpu/isnan.c b/sysdeps/m68k/fpu/isnan.c
deleted file mode 100644
index d098491..0000000
--- a/sysdeps/m68k/fpu/isnan.c
+++ /dev/null
@@ -1,4 +0,0 @@
-#define FUNC __isnan
-#include <isinf.c>
-
-weak_alias (__isnan, isnan)
diff --git a/sysdeps/m68k/fpu/isnanl.c b/sysdeps/m68k/fpu/isnanl.c
deleted file mode 100644
index e5e3db2..0000000
--- a/sysdeps/m68k/fpu/isnanl.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Copyright (C) 1996 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 Library General Public License as
-published by the Free Software Foundation; either version 2 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
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
-
-#include <ansidecl.h>
-#include <math.h>
-
-int
-DEFUN(__isnanl, (x), long double x)
-{
- return __m81_u(__isnanl)(x);
-}
-
-weak_alias (__isnanl, isnanl)
diff --git a/sysdeps/m68k/fpu/k_cos.c b/sysdeps/m68k/fpu/k_cos.c
index 1f508b4..28406e8 100644
--- a/sysdeps/m68k/fpu/k_cos.c
+++ b/sysdeps/m68k/fpu/k_cos.c
@@ -19,8 +19,17 @@ Cambridge, MA 02139, USA. */
#include <ansidecl.h>
#include <math.h>
-double
-DEFUN(__kernel_cos, (x, y), double x AND double y)
+#ifndef FUNC
+#define FUNC cos
+#endif
+#ifndef float_type
+#define float_type double
+#endif
+
+#define __CONCATX(a,b) __CONCAT(a,b)
+
+float_type
+DEFUN(__CONCATX(__kernel_,FUNC), (x, y), float_type x AND float_type y)
{
- return __cos (x + y);
+ return __CONCATX(__,FUNC) (x + y);
}
diff --git a/sysdeps/m68k/fpu/k_cosf.c b/sysdeps/m68k/fpu/k_cosf.c
index a6f0a26..2a366d0 100644
--- a/sysdeps/m68k/fpu/k_cosf.c
+++ b/sysdeps/m68k/fpu/k_cosf.c
@@ -1,26 +1,3 @@
-/* Copyright (C) 1996 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 Library General Public License as
-published by the Free Software Foundation; either version 2 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
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
-
-#include <ansidecl.h>
-#include <math.h>
-
-float
-DEFUN(__kernel_cosf, (x, y), float x AND float y)
-{
- return __cosf (x + y);
-}
+#define FUNC cosf
+#define float_type float
+#include <k_cos.c>
diff --git a/sysdeps/m68k/fpu/k_cosl.c b/sysdeps/m68k/fpu/k_cosl.c
new file mode 100644
index 0000000..983b665
--- /dev/null
+++ b/sysdeps/m68k/fpu/k_cosl.c
@@ -0,0 +1,3 @@
+#define FUNC cosl
+#define float_type long double
+#include <k_cos.c>
diff --git a/sysdeps/m68k/fpu/k_sin.c b/sysdeps/m68k/fpu/k_sin.c
index 10cfbb4..8c6dfef 100644
--- a/sysdeps/m68k/fpu/k_sin.c
+++ b/sysdeps/m68k/fpu/k_sin.c
@@ -19,8 +19,18 @@ Cambridge, MA 02139, USA. */
#include <ansidecl.h>
#include <math.h>
-double
-DEFUN(__kernel_sin, (x, y, iy), double x AND double y AND int iy)
+#ifndef FUNC
+#define FUNC sin
+#endif
+#ifndef float_type
+#define float_type double
+#endif
+
+#define __CONCATX(a,b) __CONCAT(a,b)
+
+float_type
+DEFUN(__CONCATX(__kernel_,FUNC), (x, y, iy),
+ float_type x AND float_type y AND int iy)
{
- return __sin (x + y);
+ return __CONCATX(__,FUNC) (x + y);
}
diff --git a/sysdeps/m68k/fpu/k_sinf.c b/sysdeps/m68k/fpu/k_sinf.c
index 245e86b..7050347 100644
--- a/sysdeps/m68k/fpu/k_sinf.c
+++ b/sysdeps/m68k/fpu/k_sinf.c
@@ -1,26 +1,3 @@
-/* Copyright (C) 1996 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 Library General Public License as
-published by the Free Software Foundation; either version 2 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
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
-
-#include <ansidecl.h>
-#include <math.h>
-
-float
-DEFUN(__kernel_sinf, (x, y, iy), float x AND float y AND int iy)
-{
- return __sinf (x + y);
-}
+#define FUNC sinf
+#define float_type float
+#include <k_sin.c>
diff --git a/sysdeps/m68k/fpu/k_sinl.c b/sysdeps/m68k/fpu/k_sinl.c
new file mode 100644
index 0000000..5a647ca
--- /dev/null
+++ b/sysdeps/m68k/fpu/k_sinl.c
@@ -0,0 +1,3 @@
+#define FUNC sinl
+#define float_type long double
+#include <k_sin.c>
diff --git a/sysdeps/m68k/fpu/k_tan.c b/sysdeps/m68k/fpu/k_tan.c
index b18c9af..c8fa9b7 100644
--- a/sysdeps/m68k/fpu/k_tan.c
+++ b/sysdeps/m68k/fpu/k_tan.c
@@ -19,11 +19,21 @@ Cambridge, MA 02139, USA. */
#include <ansidecl.h>
#include <math.h>
-double
-DEFUN(__kernel_tan, (x, y, iy), double x AND double y AND int iy)
+#ifndef FUNC
+#define FUNC tan
+#endif
+#ifndef float_type
+#define float_type double
+#endif
+
+#define __CONCATX(a,b) __CONCAT(a,b)
+
+float_type
+DEFUN(__CONCATX(__kernel_,FUNC), (x, y, iy),
+ float_type x AND float_type y AND int iy)
{
if (iy == 1)
- return __tan (x + y);
+ return __CONCATX(__,FUNC) (x + y);
else
- return -1.0 / __tan (x + y);
+ return ((float_type) -1.0) / __CONCATX(__,FUNC) (x + y);
}
diff --git a/sysdeps/m68k/fpu/k_tanf.c b/sysdeps/m68k/fpu/k_tanf.c
index 027a74a..777af1b 100644
--- a/sysdeps/m68k/fpu/k_tanf.c
+++ b/sysdeps/m68k/fpu/k_tanf.c
@@ -1,29 +1,3 @@
-/* Copyright (C) 1996 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 Library General Public License as
-published by the Free Software Foundation; either version 2 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
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
-
-#include <ansidecl.h>
-#include <math.h>
-
-float
-DEFUN(__kernel_tanf, (x, y, iy), float x AND float y AND int iy)
-{
- if (iy == 1)
- return __tanf (x + y);
- else
- return -1.0 / __tanf (x + y);
-}
+#define FUNC tanf
+#define float_type float
+#include <k_tan.c>
diff --git a/sysdeps/m68k/fpu/k_tanl.c b/sysdeps/m68k/fpu/k_tanl.c
new file mode 100644
index 0000000..f2570e6
--- /dev/null
+++ b/sysdeps/m68k/fpu/k_tanl.c
@@ -0,0 +1,3 @@
+#define FUNC tanl
+#define float_type long double
+#include <k_tan.c>
diff --git a/sysdeps/m68k/fpu/ldexp.c b/sysdeps/m68k/fpu/ldexp.c
deleted file mode 100644
index 7e34882..0000000
--- a/sysdeps/m68k/fpu/ldexp.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright (C) 1991, 1994 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 Library General Public License as
-published by the Free Software Foundation; either version 2 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
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
-
-#include <ansidecl.h>
-#define __NO_MATH_INLINES
-#include <math.h>
-
-double
-DEFUN(ldexp, (x, exp), double x AND int exp)
-{
- return __ldexp(x, exp);
-}
diff --git a/sysdeps/m68k/fpu/log.c b/sysdeps/m68k/fpu/log.c
deleted file mode 100644
index 4de3346..0000000
--- a/sysdeps/m68k/fpu/log.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#define FUNC log
-#define OP logn
-#include <acos.c>
diff --git a/sysdeps/m68k/fpu/log10.c b/sysdeps/m68k/fpu/log10.c
deleted file mode 100644
index 246b69a..0000000
--- a/sysdeps/m68k/fpu/log10.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define FUNC log10
-#include <acos.c>
diff --git a/sysdeps/m68k/fpu/log1p.c b/sysdeps/m68k/fpu/log1p.c
deleted file mode 100644
index 0287838..0000000
--- a/sysdeps/m68k/fpu/log1p.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define FUNC log1p
-#include <acos.c>
diff --git a/sysdeps/m68k/fpu/logb.c b/sysdeps/m68k/fpu/logb.c
deleted file mode 100644
index 8619c90..0000000
--- a/sysdeps/m68k/fpu/logb.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Copyright (C) 1991, 1992, 1993, 1994, 1995 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 Library General Public License as
-published by the Free Software Foundation; either version 2 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
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
-
-#include <ansidecl.h>
-#include <math.h>
-
-#ifdef __GNUC__
-
-/* Return the base 2 signed integral exponent of X. */
-
-double
-DEFUN(__logb, (x), double x)
-{
- if (__isnan (x))
- return x;
- if (__isinf (x))
- return fabs (x);
-
- if (x == 0.0)
- asm ("flog2%.x %0, %0" : "=f" (x) : "0" (x));
- else
- asm ("fgetexp%.x %0, %0" : "=f" (x) : "0" (x));
-
- return x;
-}
-
-weak_alias (__logb, logb)
-
-#else
-#include <sysdeps/ieee754/logb.c>
-#endif
diff --git a/sysdeps/m68k/fpu/pow.c b/sysdeps/m68k/fpu/pow.c
deleted file mode 100644
index 5ace4da..0000000
--- a/sysdeps/m68k/fpu/pow.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright (C) 1991, 1994 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 Library General Public License as
-published by the Free Software Foundation; either version 2 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
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
-
-#include <ansidecl.h>
-#define __NO_MATH_INLINES
-#include <math.h>
-
-double
-DEFUN(pow, (x, y), double x AND double y)
-{
- return __pow(x, y);
-}
diff --git a/sysdeps/m68k/fpu/rint.c b/sysdeps/m68k/fpu/rint.c
deleted file mode 100644
index f83a4e4..0000000
--- a/sysdeps/m68k/fpu/rint.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#define FUNC __rint
-#define OP intr
-#include <acos.c>
-
-weak_alias (__rint, rint)
diff --git a/sysdeps/m68k/fpu/s_atan.c b/sysdeps/m68k/fpu/s_atan.c
index 51916e1..29717d4 100644
--- a/sysdeps/m68k/fpu/s_atan.c
+++ b/sysdeps/m68k/fpu/s_atan.c
@@ -22,11 +22,14 @@ Cambridge, MA 02139, USA. */
#ifndef FUNC
#define FUNC atan
#endif
+#ifndef float_type
+#define float_type double
+#endif
#define __CONCATX(a,b) __CONCAT(a,b)
-double
-DEFUN(__CONCATX(__,FUNC), (x), double x)
+float_type
+DEFUN(__CONCATX(__,FUNC), (x), float_type x)
{
return __m81_u(__CONCATX(__,FUNC))(x);
}
diff --git a/sysdeps/m68k/fpu/s_atanf.c b/sysdeps/m68k/fpu/s_atanf.c
index d26f838..c98559a 100644
--- a/sysdeps/m68k/fpu/s_atanf.c
+++ b/sysdeps/m68k/fpu/s_atanf.c
@@ -1,35 +1,5 @@
-/* Copyright (C) 1996 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 Library General Public License as
-published by the Free Software Foundation; either version 2 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
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
-
-#include <ansidecl.h>
-#include <math.h>
-
#ifndef FUNC
#define FUNC atanf
#endif
-
-#define __CONCATX(a,b) __CONCAT(a,b)
-
-float
-DEFUN(__CONCATX(__,FUNC), (x), float x)
-{
- return __m81_u(__CONCATX(__,FUNC))(x);
-}
-
-#define weak_aliasx(a,b) weak_alias(a,b)
-weak_aliasx (__CONCATX(__,FUNC), FUNC)
+#define float_type float
+#include <s_atan.c>
diff --git a/sysdeps/m68k/fpu/s_atanl.c b/sysdeps/m68k/fpu/s_atanl.c
new file mode 100644
index 0000000..b7e608a
--- /dev/null
+++ b/sysdeps/m68k/fpu/s_atanl.c
@@ -0,0 +1,5 @@
+#ifndef FUNC
+#define FUNC atanl
+#endif
+#define float_type long double
+#include <s_atan.c>
diff --git a/sysdeps/m68k/fpu/s_ceill.c b/sysdeps/m68k/fpu/s_ceill.c
new file mode 100644
index 0000000..2bf95b0
--- /dev/null
+++ b/sysdeps/m68k/fpu/s_ceill.c
@@ -0,0 +1,2 @@
+#define FUNC ceill
+#include <s_atanl.c>
diff --git a/sysdeps/m68k/fpu/s_cosl.c b/sysdeps/m68k/fpu/s_cosl.c
new file mode 100644
index 0000000..4198fee
--- /dev/null
+++ b/sysdeps/m68k/fpu/s_cosl.c
@@ -0,0 +1,2 @@
+#define FUNC cosl
+#include <s_atanl.c>
diff --git a/sysdeps/m68k/fpu/s_expm1l.c b/sysdeps/m68k/fpu/s_expm1l.c
new file mode 100644
index 0000000..cd62cb3
--- /dev/null
+++ b/sysdeps/m68k/fpu/s_expm1l.c
@@ -0,0 +1,2 @@
+#define FUNC expm1l
+#include <s_atanl.c>
diff --git a/sysdeps/m68k/fpu/s_fabsl.c b/sysdeps/m68k/fpu/s_fabsl.c
new file mode 100644
index 0000000..8ac14d5
--- /dev/null
+++ b/sysdeps/m68k/fpu/s_fabsl.c
@@ -0,0 +1,2 @@
+#define FUNC fabsl
+#include <s_atanl.c>
diff --git a/sysdeps/m68k/fpu/s_finitel.c b/sysdeps/m68k/fpu/s_finitel.c
new file mode 100644
index 0000000..bd346a2
--- /dev/null
+++ b/sysdeps/m68k/fpu/s_finitel.c
@@ -0,0 +1,2 @@
+#define FUNC finitel
+#include <s_isinfl.c>
diff --git a/sysdeps/m68k/fpu/s_floorl.c b/sysdeps/m68k/fpu/s_floorl.c
new file mode 100644
index 0000000..2c1ffd7
--- /dev/null
+++ b/sysdeps/m68k/fpu/s_floorl.c
@@ -0,0 +1,2 @@
+#define FUNC floorl
+#include <s_atanl.c>
diff --git a/sysdeps/m68k/fpu/s_frexp.c b/sysdeps/m68k/fpu/s_frexp.c
index 45c0540..16f3039 100644
--- a/sysdeps/m68k/fpu/s_frexp.c
+++ b/sysdeps/m68k/fpu/s_frexp.c
@@ -19,9 +19,19 @@ Cambridge, MA 02139, USA. */
#include <ansidecl.h>
#include <math.h>
-double
-DEFUN(__frexp, (value, expptr), double value AND int *expptr)
+#ifndef FUNC
+#define FUNC frexp
+#endif
+#ifndef float_type
+#define float_type double
+#endif
+
+#define __CONCATX(a,b) __CONCAT(a,b)
+
+float_type
+DEFUN(__CONCATX(__,FUNC), (value, expptr), float_type value AND int *expptr)
{
- return __m81_u(__frexp)(value, expptr);
+ return __m81_u(__CONCATX(__,FUNC))(value, expptr);
}
-weak_alias (__frexp, frexp)
+#define weak_aliasx(a,b) weak_alias(a,b)
+weak_aliasx (__CONCATX(__,FUNC), FUNC)
diff --git a/sysdeps/m68k/fpu/s_frexpf.c b/sysdeps/m68k/fpu/s_frexpf.c
index dd30f6c..893b6ad 100644
--- a/sysdeps/m68k/fpu/s_frexpf.c
+++ b/sysdeps/m68k/fpu/s_frexpf.c
@@ -1,27 +1,3 @@
-/* Copyright (C) 1996 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 Library General Public License as
-published by the Free Software Foundation; either version 2 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
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
-
-#include <ansidecl.h>
-#include <math.h>
-
-float
-DEFUN(__frexpf, (value, expptr), float value AND int *expptr)
-{
- return __m81_u(__frexpf)(value, expptr);
-}
-weak_alias (__frexpf, frexpf)
+#define FUNC frexpf
+#define float_type float
+#include <s_frexp.c>
diff --git a/sysdeps/m68k/fpu/s_frexpl.c b/sysdeps/m68k/fpu/s_frexpl.c
new file mode 100644
index 0000000..fe9466f
--- /dev/null
+++ b/sysdeps/m68k/fpu/s_frexpl.c
@@ -0,0 +1,3 @@
+#define FUNC frexpl
+#define float_type long double
+#include <s_frexp.c>
diff --git a/sysdeps/m68k/fpu/s_ilogb.c b/sysdeps/m68k/fpu/s_ilogb.c
index 4119df9..c80a288 100644
--- a/sysdeps/m68k/fpu/s_ilogb.c
+++ b/sysdeps/m68k/fpu/s_ilogb.c
@@ -19,10 +19,20 @@ Cambridge, MA 02139, USA. */
#include <ansidecl.h>
#include <math.h>
+#ifndef FUNC
+#define FUNC ilogb
+#endif
+#ifndef float_type
+#define float_type double
+#endif
+
+#define __CONCATX(a,b) __CONCAT(a,b)
+
int
-DEFUN(__ilogb, (x), double x)
+DEFUN(__CONCATX(__,FUNC), (x), float_type x)
{
- return __m81_u(__ilogb)(x);
+ return __m81_u(__CONCATX(__,FUNC))(x);
}
-weak_alias (__ilogb, ilogb)
+#define weak_aliasx(a,b) weak_alias(a,b)
+weak_aliasx (__CONCATX(__,FUNC), FUNC)
diff --git a/sysdeps/m68k/fpu/s_ilogbf.c b/sysdeps/m68k/fpu/s_ilogbf.c
index 8d9a027..c0c2ffd 100644
--- a/sysdeps/m68k/fpu/s_ilogbf.c
+++ b/sysdeps/m68k/fpu/s_ilogbf.c
@@ -1,28 +1,3 @@
-/* Copyright (C) 1996 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 Library General Public License as
-published by the Free Software Foundation; either version 2 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
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
-
-#include <ansidecl.h>
-#include <math.h>
-
-int
-DEFUN(__ilogbf, (x), float x)
-{
- return __m81_u(__ilogbf)(x);
-}
-
-weak_alias (__ilogbf, ilogbf)
+#define FUNC ilogbf
+#define float_type float
+#include <s_ilogb.c>
diff --git a/sysdeps/m68k/fpu/s_ilogbl.c b/sysdeps/m68k/fpu/s_ilogbl.c
new file mode 100644
index 0000000..c3554d5
--- /dev/null
+++ b/sysdeps/m68k/fpu/s_ilogbl.c
@@ -0,0 +1,3 @@
+#define FUNC ilogbl
+#define float_type long double
+#include <s_ilogb.c>
diff --git a/sysdeps/m68k/fpu/s_isinf.c b/sysdeps/m68k/fpu/s_isinf.c
index eec07c7..570a7ba 100644
--- a/sysdeps/m68k/fpu/s_isinf.c
+++ b/sysdeps/m68k/fpu/s_isinf.c
@@ -22,11 +22,14 @@ Cambridge, MA 02139, USA. */
#ifndef FUNC
#define FUNC isinf
#endif
+#ifndef float_type
+#define float_type double
+#endif
#define __CONCATX(a,b) __CONCAT(a,b)
int
-DEFUN(__CONCATX(__,FUNC), (x), double x)
+DEFUN(__CONCATX(__,FUNC), (x), float_type x)
{
return __m81_u(__CONCATX(__,FUNC))(x);
}
diff --git a/sysdeps/m68k/fpu/s_isinff.c b/sysdeps/m68k/fpu/s_isinff.c
index 8f18db5..ebf4f2a 100644
--- a/sysdeps/m68k/fpu/s_isinff.c
+++ b/sysdeps/m68k/fpu/s_isinff.c
@@ -1,35 +1,5 @@
-/* Copyright (C) 1996 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 Library General Public License as
-published by the Free Software Foundation; either version 2 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
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
-
-#include <ansidecl.h>
-#include <math.h>
-
#ifndef FUNC
#define FUNC isinff
#endif
-
-#define __CONCATX(a,b) __CONCAT(a,b)
-
-int
-DEFUN(__CONCATX(__,FUNC), (x), float x)
-{
- return __m81_u(__CONCATX(__,FUNC))(x);
-}
-
-#define weak_aliasx(a,b) weak_alias(a,b)
-weak_aliasx (__CONCATX(__,FUNC), FUNC)
+#define float_type float
+#include <s_isinf.c>
diff --git a/sysdeps/m68k/fpu/s_isinfl.c b/sysdeps/m68k/fpu/s_isinfl.c
new file mode 100644
index 0000000..963725a
--- /dev/null
+++ b/sysdeps/m68k/fpu/s_isinfl.c
@@ -0,0 +1,5 @@
+#ifndef FUNC
+#define FUNC isinfl
+#endif
+#define float_type long double
+#include <s_isinf.c>
diff --git a/sysdeps/m68k/fpu/s_isnanl.c b/sysdeps/m68k/fpu/s_isnanl.c
new file mode 100644
index 0000000..bbacb64
--- /dev/null
+++ b/sysdeps/m68k/fpu/s_isnanl.c
@@ -0,0 +1,2 @@
+#define FUNC isnanl
+#include <s_isinfl.c>
diff --git a/sysdeps/m68k/fpu/s_ldexp.c b/sysdeps/m68k/fpu/s_ldexp.c
index 67513d4..ea8bfba 100644
--- a/sysdeps/m68k/fpu/s_ldexp.c
+++ b/sysdeps/m68k/fpu/s_ldexp.c
@@ -22,11 +22,14 @@ Cambridge, MA 02139, USA. */
#ifndef FUNC
#define FUNC ldexp
#endif
+#ifndef float_type
+#define float_type double
+#endif
#define __CONCATX(a,b) __CONCAT(a,b)
-double
-DEFUN(__CONCATX(__,FUNC), (x, exp), double x AND int exp)
+float_type
+DEFUN(__CONCATX(__,FUNC), (x, exp), float_type x AND int exp)
{
return __m81_u(__CONCATX(__,FUNC))(x, exp);
}
diff --git a/sysdeps/m68k/fpu/s_ldexpf.c b/sysdeps/m68k/fpu/s_ldexpf.c
index 94abf25..81a6b28 100644
--- a/sysdeps/m68k/fpu/s_ldexpf.c
+++ b/sysdeps/m68k/fpu/s_ldexpf.c
@@ -1,35 +1,5 @@
-/* Copyright (C) 1996 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 Library General Public License as
-published by the Free Software Foundation; either version 2 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
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
-
-#include <ansidecl.h>
-#include <math.h>
-
#ifndef FUNC
#define FUNC ldexpf
#endif
-
-#define __CONCATX(a,b) __CONCAT(a,b)
-
-float
-DEFUN(__CONCATX(__,FUNC), (x, exp), float x AND int exp)
-{
- return __m81_u(__CONCATX(__,FUNC))(x, exp);
-}
-
-#define weak_aliasx(a,b) weak_alias(a,b)
-weak_aliasx (__CONCATX(__,FUNC), FUNC)
+#define float_type float
+#include <s_ldexp.c>
diff --git a/sysdeps/m68k/fpu/s_ldexpl.c b/sysdeps/m68k/fpu/s_ldexpl.c
new file mode 100644
index 0000000..25796b7
--- /dev/null
+++ b/sysdeps/m68k/fpu/s_ldexpl.c
@@ -0,0 +1,5 @@
+#ifndef FUNC
+#define FUNC ldexpl
+#endif
+#define float_type long double
+#include <s_ldexp.c>
diff --git a/sysdeps/m68k/fpu/s_log1pl.c b/sysdeps/m68k/fpu/s_log1pl.c
new file mode 100644
index 0000000..8dbef89
--- /dev/null
+++ b/sysdeps/m68k/fpu/s_log1pl.c
@@ -0,0 +1,2 @@
+#define FUNC log1pl
+#include <s_atanl.c>
diff --git a/sysdeps/m68k/fpu/s_logbl.c b/sysdeps/m68k/fpu/s_logbl.c
new file mode 100644
index 0000000..7d06ac1
--- /dev/null
+++ b/sysdeps/m68k/fpu/s_logbl.c
@@ -0,0 +1,2 @@
+#define FUNC logbl
+#include <s_atanl.c>
diff --git a/sysdeps/m68k/fpu/s_modf.c b/sysdeps/m68k/fpu/s_modf.c
index ce70be8..f704260e 100644
--- a/sysdeps/m68k/fpu/s_modf.c
+++ b/sysdeps/m68k/fpu/s_modf.c
@@ -19,9 +19,19 @@ Cambridge, MA 02139, USA. */
#include <ansidecl.h>
#include <math.h>
-double
-DEFUN(__modf, (x, exp), double x AND double *iptr)
+#ifndef FUNC
+#define FUNC modf
+#endif
+#ifndef float_type
+#define float_type double
+#endif
+
+#define __CONCATX(a,b) __CONCAT(a,b)
+
+float_type
+DEFUN(__CONCATX(__,FUNC), (x, iptr), float_type x AND float_type *iptr)
{
- return __m81_u(__modf)(x, iptr);
+ return __m81_u(__CONCATX(__,FUNC))(x, iptr);
}
-weak_alias(__modf, modf)
+#define weak_aliasx(a,b) weak_alias(a,b)
+weak_aliasx(__CONCATX(__,FUNC), FUNC)
diff --git a/sysdeps/m68k/fpu/s_modff.c b/sysdeps/m68k/fpu/s_modff.c
index 04b51d5..37bff00 100644
--- a/sysdeps/m68k/fpu/s_modff.c
+++ b/sysdeps/m68k/fpu/s_modff.c
@@ -1,27 +1,3 @@
-/* Copyright (C) 1996 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 Library General Public License as
-published by the Free Software Foundation; either version 2 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
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
-
-#include <ansidecl.h>
-#include <math.h>
-
-float
-DEFUN(__modff, (x, exp), float x AND float *iptr)
-{
- return __m81_u(__modff)(x, iptr);
-}
-weak_alias(__modff, modff)
+#define FUNC modff
+#define float_type float
+#include <s_modf.c>
diff --git a/sysdeps/m68k/fpu/s_modfl.c b/sysdeps/m68k/fpu/s_modfl.c
new file mode 100644
index 0000000..51327dd
--- /dev/null
+++ b/sysdeps/m68k/fpu/s_modfl.c
@@ -0,0 +1,3 @@
+#define FUNC modfl
+#define float_type long double
+#include <s_modf.c>
diff --git a/sysdeps/m68k/fpu/s_rintl.c b/sysdeps/m68k/fpu/s_rintl.c
new file mode 100644
index 0000000..305667b
--- /dev/null
+++ b/sysdeps/m68k/fpu/s_rintl.c
@@ -0,0 +1,2 @@
+#define FUNC rintl
+#include <s_atanl.c>
diff --git a/sysdeps/m68k/fpu/s_scalbnl.c b/sysdeps/m68k/fpu/s_scalbnl.c
new file mode 100644
index 0000000..83e8bfe
--- /dev/null
+++ b/sysdeps/m68k/fpu/s_scalbnl.c
@@ -0,0 +1,2 @@
+#define FUNC scalbnl
+#include <s_ldexpl.c>
diff --git a/sysdeps/m68k/fpu/s_significandl.c b/sysdeps/m68k/fpu/s_significandl.c
new file mode 100644
index 0000000..8c6fc7e
--- /dev/null
+++ b/sysdeps/m68k/fpu/s_significandl.c
@@ -0,0 +1,2 @@
+#define FUNC significandl
+#include <s_atanl.c>
diff --git a/sysdeps/m68k/fpu/s_sinl.c b/sysdeps/m68k/fpu/s_sinl.c
new file mode 100644
index 0000000..9ac532c
--- /dev/null
+++ b/sysdeps/m68k/fpu/s_sinl.c
@@ -0,0 +1,2 @@
+#define FUNC sinl
+#include <s_atanl.c>
diff --git a/sysdeps/m68k/fpu/s_tanhl.c b/sysdeps/m68k/fpu/s_tanhl.c
new file mode 100644
index 0000000..6e99791
--- /dev/null
+++ b/sysdeps/m68k/fpu/s_tanhl.c
@@ -0,0 +1,2 @@
+#define FUNC tanhl
+#include <s_atanl.c>
diff --git a/sysdeps/m68k/fpu/s_tanl.c b/sysdeps/m68k/fpu/s_tanl.c
new file mode 100644
index 0000000..64fcb54
--- /dev/null
+++ b/sysdeps/m68k/fpu/s_tanl.c
@@ -0,0 +1,2 @@
+#define FUNC tanl
+#include <s_atanl.c>
diff --git a/sysdeps/m68k/fpu/sin.c b/sysdeps/m68k/fpu/sin.c
deleted file mode 100644
index 28ac9e5..0000000
--- a/sysdeps/m68k/fpu/sin.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define FUNC sin
-#include <acos.c>
diff --git a/sysdeps/m68k/fpu/sinh.c b/sysdeps/m68k/fpu/sinh.c
deleted file mode 100644
index fae7c71..0000000
--- a/sysdeps/m68k/fpu/sinh.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define FUNC sinh
-#include <acos.c>
diff --git a/sysdeps/m68k/fpu/sqrt.c b/sysdeps/m68k/fpu/sqrt.c
deleted file mode 100644
index 2365b61..0000000
--- a/sysdeps/m68k/fpu/sqrt.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define FUNC sqrt
-#include <acos.c>
diff --git a/sysdeps/m68k/fpu/tan.c b/sysdeps/m68k/fpu/tan.c
deleted file mode 100644
index 53b3b53..0000000
--- a/sysdeps/m68k/fpu/tan.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define FUNC tan
-#include <acos.c>
diff --git a/sysdeps/m68k/fpu/tanh.c b/sysdeps/m68k/fpu/tanh.c
deleted file mode 100644
index cc67395..0000000
--- a/sysdeps/m68k/fpu/tanh.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define FUNC tanh
-#include <acos.c>