2006-02-27 Jeff Johnston <jjohnstn@redhat.com>

* Makefile.am (MATHOBJS_IN_LIBC): Add s_isinfd, sf_isinff,
        s_isnand, and sf_isnanf object files.
        * Makefile.in: Regenerated.
        * libc/include/ieeefp.h: Undef isnan and isinf to avoid
        conflict if <math.h> has previously been included.
        * libc/include/math.h
        * libm/common/Makefile.am: Add new s_isinfd, s_isnand, sf_isinff,
        and sf_isnanf files.  Also support s_isnan, sf_isnan, s_isinf, and
        sf_isinf files which have been moved from math/mathfp directories.
        * libm/common/Makefile.in: Regenerated.
        * libm/common/s_isinfd.c: New file.
        * libm/common/s_isnand.c: Ditto.
        * libm/common/sf_isinff.c: Ditto.
        * libm/common/sf_isnanf.c: Ditto.
        * libm/common/s_isinf.c: Moved from libm/math directory.
        * libm/common/s_isnan.c: Ditto.
        * libm/common/sf_isinf.c: Ditto.
        * libm/common/sf_isnan.c: Ditto.
        * libm/math/Makefile.am: Remove isinf and isnan family functions
        which have been moved into common directory.
        * libm/mathfp/Makefile.am: Ditto.
        * libm/math/Makefile.in: Regenerated.
        * libm/mathfp/Makefile.in: Ditto.
        * libm/math/s_isinf.c: Removed.
        * libm/math/s_isnan.c: Ditto.
        * libm/math/sf_isinf.c: Ditto.
        * libm/math/sf_isnan.c: Ditto.
        * libm/mathfp/s_isinf.c: Ditto.
        * libm/mathfp/s_isnan.c: Ditto.
        * libm/mathfp/sf_isinf.c: Ditto.
        * libm/mathfp/sf_isnan.c: Ditto.
This commit is contained in:
Jeff Johnston
2006-02-27 23:51:28 +00:00
parent 47a5b664e5
commit e48682cff5
23 changed files with 388 additions and 387 deletions

View File

@ -1,4 +1,3 @@
/* math.h -- Definitions for the math floating point package. */
#ifndef _MATH_H_
#define _MATH_H_
@ -119,6 +118,10 @@ typedef double double_t;
#define FP_SUBNORMAL 3
#define FP_NORMAL 4
extern int __isinff (float x);
extern int __isinfd (double x);
extern int __isnanf (float x);
extern int __isnand (double x);
extern int __fpclassifyf (float x);
extern int __fpclassifyd (double x);
extern int __signbitf (float x);
@ -131,9 +134,19 @@ extern int __signbitd (double x);
#define isfinite(y) \
(__extension__ ({__typeof__(y) __y = (y); \
fpclassify(__y) != FP_INFINITE && fpclassify(__y) != FP_NAN;}))
#define isnormal(z) \
(__extension__ ({__typeof__(z) __z = (z); \
fpclassify(__z) == FP_NORMAL;}))
/* Note: isinf and isnan were once functions in newlib that took double
* arguments. C99 specifies that these names are reserved for macros
* supporting multiple floating point types. Thus, they are
* now defined as macros. Implementations of the old functions
* taking double arguments still exist for compatibility purposes. */
#define isinf(x) \
(__extension__ ({__typeof__(x) __x = (x); \
(sizeof (__x) == sizeof (float)) ? __isinff(__x) : __isinfd(__x);}))
#define isnan(x) \
(__extension__ ({__typeof__(x) __x = (x); \
(sizeof (__x) == sizeof (float)) ? __isnanf(__x) : __isnand(__x);}))
#define isnormal(y) (fpclassify(y) == FP_NORMAL)
#define signbit(x) \
(__extension__ ({__typeof__(x) __x = (x); \
(sizeof(__x) == sizeof(float)) ? __signbitf(__x) : __signbitd(__x);}))
@ -162,8 +175,6 @@ extern int __signbitd (double x);
extern double infinity _PARAMS((void));
extern double nan _PARAMS((const char *));
extern int isnan _PARAMS((double));
extern int isinf _PARAMS((double));
extern int finite _PARAMS((double));
extern double copysign _PARAMS((double, double));
extern int ilogb _PARAMS((double));