Tue Jun 4 22:03:02 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>

* 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.
This commit is contained in:
Roland McGrath 1996-06-06 05:22:44 +00:00
parent 7c2f9239ec
commit 863a5d8290
11 changed files with 104 additions and 30 deletions

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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)

View File

@ -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)

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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)