From: Roland McGrath Date: Thu, 6 Jun 1996 05:22:44 +0000 (+0000) Subject: Tue Jun 4 22:03:02 1996 Andreas Schwab X-Git-Tag: glibc-2.16-ports-merge^2~3799 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=863a5d82907483924627e74ece18fc27d4f337b3;p=platform%2Fupstream%2Fglibc.git Tue Jun 4 22:03:02 1996 Andreas Schwab * 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. --- 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_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/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 #include -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_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 #include -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_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 #include -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/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_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 #include -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_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 #include +#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_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_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_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 #include -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)