From c34ee845b6096d6e24c414a77d6d664c11374cd1 Mon Sep 17 00:00:00 2001 From: jjohnstn Date: Mon, 27 Feb 2006 23:51:28 +0000 Subject: [PATCH] 2006-02-27 Jeff Johnston * 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 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. --- newlib/ChangeLog | 34 ++++++ newlib/Makefile.am | 2 + newlib/Makefile.in | 2 +- newlib/libc/include/ieeefp.h | 3 + newlib/libc/include/math.h | 23 +++- newlib/libm/common/Makefile.am | 12 +- newlib/libm/common/Makefile.in | 22 +++- newlib/libm/common/s_isinf.c | 29 +++++ newlib/libm/{math/s_isinf.c => common/s_isinfd.c} | 11 +- newlib/libm/common/s_isnan.c | 135 ++++++++++++++++++++++ newlib/libm/{math/s_isnan.c => common/s_isnand.c} | 18 +-- newlib/libm/{math => common}/sf_isinf.c | 22 ++-- newlib/libm/common/sf_isinff.c | 27 +++++ newlib/libm/{math => common}/sf_isnan.c | 23 ++-- newlib/libm/common/sf_isnanf.c | 37 ++++++ newlib/libm/math/Makefile.am | 12 +- newlib/libm/math/Makefile.in | 61 +++++----- newlib/libm/mathfp/Makefile.am | 7 +- newlib/libm/mathfp/Makefile.in | 38 +++--- newlib/libm/mathfp/s_isinf.c | 37 ------ newlib/libm/mathfp/s_isnan.c | 124 -------------------- newlib/libm/mathfp/sf_isinf.c | 48 -------- newlib/libm/mathfp/sf_isnan.c | 48 -------- 23 files changed, 388 insertions(+), 387 deletions(-) create mode 100644 newlib/libm/common/s_isinf.c rename newlib/libm/{math/s_isinf.c => common/s_isinfd.c} (71%) create mode 100644 newlib/libm/common/s_isnan.c rename newlib/libm/{math/s_isnan.c => common/s_isnand.c} (87%) rename newlib/libm/{math => common}/sf_isinf.c (60%) create mode 100644 newlib/libm/common/sf_isinff.c rename newlib/libm/{math => common}/sf_isnan.c (70%) create mode 100644 newlib/libm/common/sf_isnanf.c delete mode 100644 newlib/libm/mathfp/s_isinf.c delete mode 100644 newlib/libm/mathfp/s_isnan.c delete mode 100644 newlib/libm/mathfp/sf_isinf.c delete mode 100644 newlib/libm/mathfp/sf_isnan.c diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 940ef007c6..fcefc2edb0 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,37 @@ +2006-02-27 Jeff Johnston + + * 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 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. + 2006-02-20 Jeff Johnston * libc/stdio/fflush.c (fflush): For an fflush on a read-only diff --git a/newlib/Makefile.am b/newlib/Makefile.am index f249ce49cc..9da9349cbb 100644 --- a/newlib/Makefile.am +++ b/newlib/Makefile.am @@ -91,6 +91,8 @@ toollib_DATA = $(CRT0) $(CRT1) MATHOBJS_IN_LIBC = \ s_isinf.$(oext) sf_isinf.$(oext) \ s_isnan.$(oext) sf_isnan.$(oext) \ + s_isinfd.$(oext) sf_isinff.$(oext) \ + s_isnand.$(oext) sf_isnanf.$(oext) \ s_nan.$(oext) sf_nan.$(oext) \ s_ldexp.$(oext) sf_ldexp.$(oext) \ s_frexp.$(oext) sf_frexp.$(oext) \ diff --git a/newlib/Makefile.in b/newlib/Makefile.in index 6d9dc258c0..ce3f148b77 100644 --- a/newlib/Makefile.in +++ b/newlib/Makefile.in @@ -154,7 +154,7 @@ toollib_DATA = $(CRT0) $(CRT1) # The functions ldexp, frexp and modf are traditionally supplied in # both libc.a and libm.a. We build them in libm.a and copy them over, # along with some required supporting routines. -MATHOBJS_IN_LIBC = s_isinf.$(oext) sf_isinf.$(oext) s_isnan.$(oext) sf_isnan.$(oext) s_nan.$(oext) sf_nan.$(oext) s_ldexp.$(oext) sf_ldexp.$(oext) s_frexp.$(oext) sf_frexp.$(oext) s_modf.$(oext) sf_modf.$(oext) s_scalbn.$(oext) sf_scalbn.$(oext) s_finite.$(oext) sf_finite.$(oext) s_copysign.$(oext) sf_copysign.$(oext) s_infconst.$(oext) +MATHOBJS_IN_LIBC = s_isinf.$(oext) sf_isinf.$(oext) s_isnan.$(oext) sf_isnan.$(oext) s_isinfd.$(oext) sf_isinff.$(oext) s_isnand.$(oext) sf_isnanf.$(oext) s_nan.$(oext) sf_nan.$(oext) s_ldexp.$(oext) sf_ldexp.$(oext) s_frexp.$(oext) sf_frexp.$(oext) s_modf.$(oext) sf_modf.$(oext) s_scalbn.$(oext) sf_scalbn.$(oext) s_finite.$(oext) sf_finite.$(oext) s_copysign.$(oext) sf_copysign.$(oext) s_infconst.$(oext) LIBC_OBJECTLISTS = $(POSIX_OBJECTLIST) $(SIGNAL_OBJECTLIST) $(SYSCALL_OBJECTLIST) $(UNIX_OBJECTLIST) $(STDIO64_OBJECTLIST) libc/argz/objectlist.awk.in libc/stdlib/objectlist.awk.in libc/time/objectlist.awk.in libc/ctype/objectlist.awk.in libc/search/objectlist.awk.in libc/string/objectlist.awk.in libc/locale/objectlist.awk.in libc/misc/objectlist.awk.in libc/reent/objectlist.awk.in libc/errno/objectlist.awk.in libc/stdio/objectlist.awk.in $(MACHINE_OBJECTLIST) $(SYS_OBJECTLIST) $(SYS_MACH_OBJECTLIST) diff --git a/newlib/libc/include/ieeefp.h b/newlib/libc/include/ieeefp.h index 970ea4543d..e08fd08852 100644 --- a/newlib/libc/include/ieeefp.h +++ b/newlib/libc/include/ieeefp.h @@ -184,6 +184,9 @@ typedef int fp_rdi; fp_rdi _EXFUN(fpgetroundtoi,(void)); fp_rdi _EXFUN(fpsetroundtoi,(fp_rdi)); +#undef isnan +#undef isinf + int _EXFUN(isnan, (double)); int _EXFUN(isinf, (double)); int _EXFUN(finite, (double)); diff --git a/newlib/libc/include/math.h b/newlib/libc/include/math.h index 041e8000bd..41ce752b35 100644 --- a/newlib/libc/include/math.h +++ b/newlib/libc/include/math.h @@ -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)); diff --git a/newlib/libm/common/Makefile.am b/newlib/libm/common/Makefile.am index ba7f310304..d6d7e510d6 100644 --- a/newlib/libm/common/Makefile.am +++ b/newlib/libm/common/Makefile.am @@ -6,7 +6,8 @@ INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) src = s_finite.c s_copysign.c s_modf.c s_scalbn.c \ s_cbrt.c s_expm1.c s_ilogb.c s_infconst.c \ - s_infinity.c s_log1p.c s_nan.c s_nextafter.c \ + s_infinity.c s_isinf.c s_isinfd.c s_isnan.c s_isnand.c \ + s_log1p.c s_nan.c s_nextafter.c \ s_rint.c s_logb.c s_matherr.c s_lib_ver.c \ s_fdim.c s_fma.c s_fmax.c s_fmin.c s_fpclassify.c s_lrint.c \ s_lround.c s_nearbyint.c s_remquo.c s_round.c s_scalbln.c \ @@ -14,7 +15,8 @@ src = s_finite.c s_copysign.c s_modf.c s_scalbn.c \ fsrc = sf_finite.c sf_copysign.c sf_modf.c sf_scalbn.c \ sf_cbrt.c sf_expm1.c sf_ilogb.c \ - sf_infinity.c sf_log1p.c sf_nan.c sf_nextafter.c \ + sf_infinity.c sf_isinf.c sf_isinff.c sf_isnan.c sf_isnanf.c \ + sf_log1p.c sf_nan.c sf_nextafter.c \ sf_rint.c sf_logb.c \ sf_fdim.c sf_fma.c sf_fmax.c sf_fmin.c sf_lrint.c \ sf_lround.c sf_nearbyint.c sf_remquo.c sf_round.c \ @@ -35,7 +37,7 @@ endif # USE_LIBTOOL include $(srcdir)/../../Makefile.shared chobj = scbrt.def scopysign.def sexpm1.def silogb.def \ - sinfinity.def slog1p.def smatherr.def smodf.def \ + sinfinity.def sisnan.def slog1p.def smatherr.def smodf.def \ snan.def snextafter.def sscalbn.def SUFFIXES = .def @@ -91,6 +93,10 @@ sinfinity.def: s_infinity.c $(CHEW) < $(srcdir)/s_infinity.c >$@ 2>/dev/null touch stmp-def +sisnan.def: s_isnan.c + $(CHEW) < $(srcdir)/s_isnan.c >$@ 2>/dev/null + touch stmp-def + slog1p.def: s_log1p.c $(CHEW) < $(srcdir)/s_log1p.c >$@ 2>/dev/null touch stmp-def diff --git a/newlib/libm/common/Makefile.in b/newlib/libm/common/Makefile.in index e71136f996..4e9db8b251 100644 --- a/newlib/libm/common/Makefile.in +++ b/newlib/libm/common/Makefile.in @@ -98,10 +98,10 @@ AUTOMAKE_OPTIONS = cygnus INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) -src = s_finite.c s_copysign.c s_modf.c s_scalbn.c s_cbrt.c s_expm1.c s_ilogb.c s_infconst.c s_infinity.c s_log1p.c s_nan.c s_nextafter.c s_rint.c s_logb.c s_matherr.c s_lib_ver.c s_fdim.c s_fma.c s_fmax.c s_fmin.c s_fpclassify.c s_lrint.c s_lround.c s_nearbyint.c s_remquo.c s_round.c s_scalbln.c s_signbit.c s_trunc.c +src = s_finite.c s_copysign.c s_modf.c s_scalbn.c s_cbrt.c s_expm1.c s_ilogb.c s_infconst.c s_infinity.c s_isinf.c s_isinfd.c s_isnan.c s_isnand.c s_log1p.c s_nan.c s_nextafter.c s_rint.c s_logb.c s_matherr.c s_lib_ver.c s_fdim.c s_fma.c s_fmax.c s_fmin.c s_fpclassify.c s_lrint.c s_lround.c s_nearbyint.c s_remquo.c s_round.c s_scalbln.c s_signbit.c s_trunc.c -fsrc = sf_finite.c sf_copysign.c sf_modf.c sf_scalbn.c sf_cbrt.c sf_expm1.c sf_ilogb.c sf_infinity.c sf_log1p.c sf_nan.c sf_nextafter.c sf_rint.c sf_logb.c sf_fdim.c sf_fma.c sf_fmax.c sf_fmin.c sf_lrint.c sf_lround.c sf_nearbyint.c sf_remquo.c sf_round.c sf_scalbln.c sf_trunc.c +fsrc = sf_finite.c sf_copysign.c sf_modf.c sf_scalbn.c sf_cbrt.c sf_expm1.c sf_ilogb.c sf_infinity.c sf_isinf.c sf_isinff.c sf_isnan.c sf_isnanf.c sf_log1p.c sf_nan.c sf_nextafter.c sf_rint.c sf_logb.c sf_fdim.c sf_fma.c sf_fmax.c sf_fmin.c sf_lrint.c sf_lround.c sf_nearbyint.c sf_remquo.c sf_round.c sf_scalbln.c sf_trunc.c libcommon_la_LDFLAGS = -Xcompiler -nostdlib @@ -113,7 +113,7 @@ libcommon_la_LDFLAGS = -Xcompiler -nostdlib @USE_LIBTOOL_FALSE@noinst_LIBRARIES = lib.a @USE_LIBTOOL_FALSE@lib_a_SOURCES = $(src) $(fsrc) -chobj = scbrt.def scopysign.def sexpm1.def silogb.def sinfinity.def slog1p.def smatherr.def smodf.def snan.def snextafter.def sscalbn.def +chobj = scbrt.def scopysign.def sexpm1.def silogb.def sinfinity.def sisnan.def slog1p.def smatherr.def smodf.def snan.def snextafter.def sscalbn.def SUFFIXES = .def @@ -137,6 +137,8 @@ lib_a_LIBADD = @USE_LIBTOOL_FALSE@s_scalbn.$(OBJEXT) s_cbrt.$(OBJEXT) \ @USE_LIBTOOL_FALSE@s_expm1.$(OBJEXT) s_ilogb.$(OBJEXT) \ @USE_LIBTOOL_FALSE@s_infconst.$(OBJEXT) s_infinity.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@s_isinf.$(OBJEXT) s_isinfd.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@s_isnan.$(OBJEXT) s_isnand.$(OBJEXT) \ @USE_LIBTOOL_FALSE@s_log1p.$(OBJEXT) s_nan.$(OBJEXT) \ @USE_LIBTOOL_FALSE@s_nextafter.$(OBJEXT) s_rint.$(OBJEXT) \ @USE_LIBTOOL_FALSE@s_logb.$(OBJEXT) s_matherr.$(OBJEXT) \ @@ -150,7 +152,9 @@ lib_a_LIBADD = @USE_LIBTOOL_FALSE@sf_copysign.$(OBJEXT) sf_modf.$(OBJEXT) \ @USE_LIBTOOL_FALSE@sf_scalbn.$(OBJEXT) sf_cbrt.$(OBJEXT) \ @USE_LIBTOOL_FALSE@sf_expm1.$(OBJEXT) sf_ilogb.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@sf_infinity.$(OBJEXT) sf_log1p.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@sf_infinity.$(OBJEXT) sf_isinf.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@sf_isinff.$(OBJEXT) sf_isnan.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@sf_isnanf.$(OBJEXT) sf_log1p.$(OBJEXT) \ @USE_LIBTOOL_FALSE@sf_nan.$(OBJEXT) sf_nextafter.$(OBJEXT) \ @USE_LIBTOOL_FALSE@sf_rint.$(OBJEXT) sf_logb.$(OBJEXT) \ @USE_LIBTOOL_FALSE@sf_fdim.$(OBJEXT) sf_fma.$(OBJEXT) sf_fmax.$(OBJEXT) \ @@ -163,14 +167,16 @@ LTLIBRARIES = $(noinst_LTLIBRARIES) libcommon_la_LIBADD = @USE_LIBTOOL_TRUE@libcommon_la_OBJECTS = s_finite.lo s_copysign.lo \ @USE_LIBTOOL_TRUE@s_modf.lo s_scalbn.lo s_cbrt.lo s_expm1.lo s_ilogb.lo \ -@USE_LIBTOOL_TRUE@s_infconst.lo s_infinity.lo s_log1p.lo s_nan.lo \ +@USE_LIBTOOL_TRUE@s_infconst.lo s_infinity.lo s_isinf.lo s_isinfd.lo \ +@USE_LIBTOOL_TRUE@s_isnan.lo s_isnand.lo s_log1p.lo s_nan.lo \ @USE_LIBTOOL_TRUE@s_nextafter.lo s_rint.lo s_logb.lo s_matherr.lo \ @USE_LIBTOOL_TRUE@s_lib_ver.lo s_fdim.lo s_fma.lo s_fmax.lo s_fmin.lo \ @USE_LIBTOOL_TRUE@s_fpclassify.lo s_lrint.lo s_lround.lo s_nearbyint.lo \ @USE_LIBTOOL_TRUE@s_remquo.lo s_round.lo s_scalbln.lo s_signbit.lo \ @USE_LIBTOOL_TRUE@s_trunc.lo sf_finite.lo sf_copysign.lo sf_modf.lo \ @USE_LIBTOOL_TRUE@sf_scalbn.lo sf_cbrt.lo sf_expm1.lo sf_ilogb.lo \ -@USE_LIBTOOL_TRUE@sf_infinity.lo sf_log1p.lo sf_nan.lo sf_nextafter.lo \ +@USE_LIBTOOL_TRUE@sf_infinity.lo sf_isinf.lo sf_isinff.lo sf_isnan.lo \ +@USE_LIBTOOL_TRUE@sf_isnanf.lo sf_log1p.lo sf_nan.lo sf_nextafter.lo \ @USE_LIBTOOL_TRUE@sf_rint.lo sf_logb.lo sf_fdim.lo sf_fma.lo sf_fmax.lo \ @USE_LIBTOOL_TRUE@sf_fmin.lo sf_lrint.lo sf_lround.lo sf_nearbyint.lo \ @USE_LIBTOOL_TRUE@sf_remquo.lo sf_round.lo sf_scalbln.lo sf_trunc.lo @@ -450,6 +456,10 @@ sinfinity.def: s_infinity.c $(CHEW) < $(srcdir)/s_infinity.c >$@ 2>/dev/null touch stmp-def +sisnan.def: s_isnan.c + $(CHEW) < $(srcdir)/s_isnan.c >$@ 2>/dev/null + touch stmp-def + slog1p.def: s_log1p.c $(CHEW) < $(srcdir)/s_log1p.c >$@ 2>/dev/null touch stmp-def diff --git a/newlib/libm/common/s_isinf.c b/newlib/libm/common/s_isinf.c new file mode 100644 index 0000000000..db8e8f82b5 --- /dev/null +++ b/newlib/libm/common/s_isinf.c @@ -0,0 +1,29 @@ +/* + * isinf(x) returns 1 if x is infinity, else 0; + * no branching! + * + * isinf is a macro in the C99 standard. It was previously + * implemented as a function by newlib and is declared as such in + * . Newlib supplies it here as a function if the user + * chooses to use or needs to link older code compiled with the + * previous declaration. + */ + +#include "fdlibm.h" +#include + +#ifndef _DOUBLE_IS_32BITS + +int +_DEFUN (isinf, (x), + double x) +{ + __int32_t hx,lx; + EXTRACT_WORDS(hx,lx,x); + hx &= 0x7fffffff; + hx |= (__uint32_t)(lx|(-lx))>>31; + hx = 0x7ff00000 - hx; + return 1 - (int)((__uint32_t)(hx|(-hx))>>31); +} + +#endif /* _DOUBLE_IS_32BITS */ diff --git a/newlib/libm/math/s_isinf.c b/newlib/libm/common/s_isinfd.c similarity index 71% rename from newlib/libm/math/s_isinf.c rename to newlib/libm/common/s_isinfd.c index 87f099566b..5a2b04d4eb 100644 --- a/newlib/libm/math/s_isinf.c +++ b/newlib/libm/common/s_isinfd.c @@ -1,5 +1,5 @@ /* - * isinf(x) returns 1 if x is infinity, else 0; + * __isinfd(x) returns 1 if x is infinity, else 0; * no branching! * Added by Cygnus Support. */ @@ -8,12 +8,9 @@ #ifndef _DOUBLE_IS_32BITS -#ifdef __STDC__ - int isinf(double x) -#else - int isinf(x) - double x; -#endif +int +_DEFUN (__isinfd, (x), + double x) { __int32_t hx,lx; EXTRACT_WORDS(hx,lx,x); diff --git a/newlib/libm/common/s_isnan.c b/newlib/libm/common/s_isnan.c new file mode 100644 index 0000000000..b0c40369a4 --- /dev/null +++ b/newlib/libm/common/s_isnan.c @@ -0,0 +1,135 @@ + +/* @(#)s_isnan.c 5.1 93/09/24 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* +FUNCTION + <>, <>, <>, <>, <>, <>---test for exceptional numbers + +INDEX + isnan +INDEX + isinf +INDEX + finite + +INDEX + isnanf +INDEX + isinff +INDEX + finitef + +ANSI_SYNOPSIS + #include + int isnan(double <[arg]>); + int isinf(double <[arg]>); + int finite(double <[arg]>); + int isnanf(float <[arg]>); + int isinff(float <[arg]>); + int finitef(float <[arg]>); + +TRAD_SYNOPSIS + #include + int isnan(<[arg]>) + double <[arg]>; + int isinf(<[arg]>) + double <[arg]>; + int finite(<[arg]>); + double <[arg]>; + int isnanf(<[arg]>); + float <[arg]>; + int isinff(<[arg]>); + float <[arg]>; + int finitef(<[arg]>); + float <[arg]>; + + +DESCRIPTION + These functions provide information on the floating-point + argument supplied. + + There are five major number formats: + o+ + o zero + A number which contains all zero bits. + o subnormal + A number with a zero exponent but a nonzero fraction. + o normal + A number with an exponent and a fraction. + o infinity + A number with an all 1's exponent and a zero fraction. + o NAN + A number with an all 1's exponent and a nonzero fraction. + + o- + + <> returns 1 if the argument is a nan. <> + returns 1 if the argument is infinity. <> returns 1 if the + argument is zero, subnormal or normal. + + The <>, <> and <> functions perform the same + operations as their <>, <> and <> + counterparts, but on single-precision floating-point numbers. + + It should be noted that the C99 standard dictates that <> + and <> are macros that operate on multiple types of + floating-point. The SUSv2 standard declares <> as + a function taking double. Newlib has decided to declare + them both as macros in math.h and as functions in ieeefp.h. + +QUICKREF + isnan - pure +QUICKREF + isinf - pure +QUICKREF + finite - pure +QUICKREF + isnan - pure +QUICKREF + isinf - pure +QUICKREF + finite - pure +*/ + +/* + * isnan(x) returns 1 is x is nan, else 0; + * no branching! + * + * The C99 standard dictates that isnan is a macro taking + * multiple floating-point types while the SUSv2 standard + * notes it is a function taking a double argument. Newlib + * has chosen to implement it as a macro in and + * declare it as a function in . + */ + +#include "fdlibm.h" +#include + +#ifndef _DOUBLE_IS_32BITS + +#ifdef __STDC__ + int isnan(double x) +#else + int isnan(x) + double x; +#endif +{ + __int32_t hx,lx; + EXTRACT_WORDS(hx,lx,x); + hx &= 0x7fffffff; + hx |= (__uint32_t)(lx|(-lx))>>31; + hx = 0x7ff00000 - hx; + return (int)(((__uint32_t)(hx))>>31); +} + +#endif /* _DOUBLE_IS_32BITS */ diff --git a/newlib/libm/math/s_isnan.c b/newlib/libm/common/s_isnand.c similarity index 87% rename from newlib/libm/math/s_isnan.c rename to newlib/libm/common/s_isnand.c index 596bd2d2a0..75538d9071 100644 --- a/newlib/libm/math/s_isnan.c +++ b/newlib/libm/common/s_isnand.c @@ -1,5 +1,3 @@ - -/* @(#)s_isnan.c 5.1 93/09/24 */ /* * ==================================================== * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. @@ -76,6 +74,11 @@ DESCRIPTION <> returns 1 if the argument is a nan. <> returns 1 if the argument is infinity. <> returns 1 if the argument is zero, subnormal or normal. + + Note that by the C99 standard, <> and <> are macros + taking any type of floating-point and are declared in + <>. Newlib has chosen to declare these as macros in + <> and as functions in <>. The <>, <> and <> functions perform the same operations as their <>, <> and <> @@ -96,7 +99,7 @@ QUICKREF */ /* - * isnan(x) returns 1 is x is nan, else 0; + * __isnand(x) returns 1 is x is nan, else 0; * no branching! */ @@ -104,12 +107,9 @@ QUICKREF #ifndef _DOUBLE_IS_32BITS -#ifdef __STDC__ - int isnan(double x) -#else - int isnan(x) - double x; -#endif +int +_DEFUN (__isnand, (x), + double x) { __int32_t hx,lx; EXTRACT_WORDS(hx,lx,x); diff --git a/newlib/libm/math/sf_isinf.c b/newlib/libm/common/sf_isinf.c similarity index 60% rename from newlib/libm/math/sf_isinf.c rename to newlib/libm/common/sf_isinf.c index 43a8abdf2b..9ee60c0625 100644 --- a/newlib/libm/math/sf_isinf.c +++ b/newlib/libm/common/sf_isinf.c @@ -1,16 +1,15 @@ /* * isinff(x) returns 1 if x is +-infinity, else 0; - * Added by Cygnus Support. + * + * isinff is an extension declared in and + * . */ #include "fdlibm.h" -#ifdef __STDC__ - int isinff(float x) -#else - int isinff(x) - float x; -#endif +int +_DEFUN (isinff, (x), + float x) { __int32_t ix; GET_FLOAT_WORD(ix,x); @@ -20,12 +19,9 @@ #ifdef _DOUBLE_IS_32BITS -#ifdef __STDC__ - int isinf(double x) -#else - int isinf(x) - double x; -#endif +int +_DEFUN (isinf, (x), + double x) { return isinff((float) x); } diff --git a/newlib/libm/common/sf_isinff.c b/newlib/libm/common/sf_isinff.c new file mode 100644 index 0000000000..9d0e742e55 --- /dev/null +++ b/newlib/libm/common/sf_isinff.c @@ -0,0 +1,27 @@ +/* + * __isinff(x) returns 1 if x is +-infinity, else 0; + * Added by Cygnus Support. + */ + +#include "fdlibm.h" + +int +_DEFUN (__isinff, (x), + float x) +{ + __int32_t ix; + GET_FLOAT_WORD(ix,x); + ix &= 0x7fffffff; + return FLT_UWORD_IS_INFINITE(ix); +} + +#ifdef _DOUBLE_IS_32BITS + +int +_DEFUN (__isinfd, (x), + double x) +{ + return __isinff((float) x); +} + +#endif /* defined(_DOUBLE_IS_32BITS) */ diff --git a/newlib/libm/math/sf_isnan.c b/newlib/libm/common/sf_isnan.c similarity index 70% rename from newlib/libm/math/sf_isnan.c rename to newlib/libm/common/sf_isnan.c index 0b4be3e9c7..e010051336 100644 --- a/newlib/libm/math/sf_isnan.c +++ b/newlib/libm/common/sf_isnan.c @@ -1,5 +1,4 @@ -/* sf_isnan.c -- float version of s_isnan.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. +/* sf_c_isnan.c -- float version of s_c_isnan.c. */ /* @@ -15,16 +14,15 @@ /* * isnanf(x) returns 1 is x is nan, else 0; + * + * isnanf is an extension declared in and . */ #include "fdlibm.h" -#ifdef __STDC__ - int isnanf(float x) -#else - int isnanf(x) - float x; -#endif +int +_DEFUN (isnanf, (x), + float x) { __int32_t ix; GET_FLOAT_WORD(ix,x); @@ -34,12 +32,9 @@ #ifdef _DOUBLE_IS_32BITS -#ifdef __STDC__ - int isnan(double x) -#else - int isnan(x) - double x; -#endif +int +_DEFUN (isnan, (x), + double x) { return isnanf((float) x); } diff --git a/newlib/libm/common/sf_isnanf.c b/newlib/libm/common/sf_isnanf.c new file mode 100644 index 0000000000..0b0d9bbaf3 --- /dev/null +++ b/newlib/libm/common/sf_isnanf.c @@ -0,0 +1,37 @@ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * __isnanf(x) returns 1 is x is nan, else 0; + */ + +#include "fdlibm.h" + +int +_DEFUN (__isnanf, (x), + float x) +{ + __int32_t ix; + GET_FLOAT_WORD(ix,x); + ix &= 0x7fffffff; + return FLT_UWORD_IS_NAN(ix); +} + +#ifdef _DOUBLE_IS_32BITS + +int +_DEFUN (__isnand, (x), + double x) +{ + return __isnanf((float) x); +} + +#endif /* defined(_DOUBLE_IS_32BITS) */ diff --git a/newlib/libm/math/Makefile.am b/newlib/libm/math/Makefile.am index 4b4db93d88..f5971fac94 100644 --- a/newlib/libm/math/Makefile.am +++ b/newlib/libm/math/Makefile.am @@ -22,10 +22,9 @@ src = k_standard.c k_rem_pio2.c \ w_cabs.c w_drem.c \ s_asinh.c s_atan.c s_ceil.c \ s_cos.c s_erf.c s_fabs.c s_floor.c \ - s_frexp.c s_isnan.c s_ldexp.c \ + s_frexp.c s_ldexp.c \ s_signif.c s_sin.c \ s_tan.c s_tanh.c \ - s_isinf.c \ w_exp2.c w_tgamma.c fsrc = kf_rem_pio2.c \ @@ -46,10 +45,9 @@ fsrc = kf_rem_pio2.c \ wf_cabs.c wf_drem.c \ sf_asinh.c sf_atan.c sf_ceil.c \ sf_cos.c sf_erf.c sf_fabs.c sf_floor.c \ - sf_frexp.c sf_isnan.c sf_ldexp.c \ + sf_frexp.c sf_ldexp.c \ sf_signif.c sf_sin.c \ sf_tan.c sf_tanh.c \ - sf_isinf.c \ wf_exp2.c wf_tgamma.c libmath_la_LDFLAGS = -Xcompiler -nostdlib @@ -73,8 +71,7 @@ chobj = wacos.def wacosh.def wasin.def sasinh.def \ wgamma.def whypot.def sldexp.def wlog.def \ wlog10.def \ wpow.def wremainder.def ssin.def wsinh.def \ - wsqrt.def stan.def stanh.def \ - sisnan.def + wsqrt.def stan.def stanh.def SUFFIXES = .def @@ -178,9 +175,6 @@ stan.def: s_tan.c stanh.def: s_tanh.c $(CHEW) < $(srcdir)/s_tanh.c >$@ 2>/dev/null touch stmp-def -sisnan.def: s_isnan.c - $(CHEW) < $(srcdir)/s_isnan.c >$@ 2>/dev/null - touch stmp-def # A partial dependency list. diff --git a/newlib/libm/math/Makefile.in b/newlib/libm/math/Makefile.in index 1de8a5398a..f00e189c7e 100644 --- a/newlib/libm/math/Makefile.in +++ b/newlib/libm/math/Makefile.in @@ -98,10 +98,10 @@ AUTOMAKE_OPTIONS = cygnus INCLUDES = -I$(srcdir)/../common $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) -src = k_standard.c k_rem_pio2.c k_cos.c k_sin.c k_tan.c e_acos.c e_acosh.c e_asin.c e_atan2.c e_atanh.c e_cosh.c e_exp.c e_fmod.c er_gamma.c e_hypot.c e_j0.c e_j1.c e_jn.c er_lgamma.c e_log.c e_log10.c e_pow.c e_rem_pio2.c e_remainder.c e_scalb.c e_sinh.c e_sqrt.c w_acos.c w_acosh.c w_asin.c w_atan2.c w_atanh.c w_cosh.c w_exp.c w_fmod.c w_gamma.c wr_gamma.c w_hypot.c w_j0.c w_j1.c w_jn.c w_lgamma.c wr_lgamma.c w_log.c w_log10.c w_pow.c w_remainder.c w_scalb.c w_sinh.c w_sqrt.c w_sincos.c w_cabs.c w_drem.c s_asinh.c s_atan.c s_ceil.c s_cos.c s_erf.c s_fabs.c s_floor.c s_frexp.c s_isnan.c s_ldexp.c s_signif.c s_sin.c s_tan.c s_tanh.c s_isinf.c w_exp2.c w_tgamma.c +src = k_standard.c k_rem_pio2.c k_cos.c k_sin.c k_tan.c e_acos.c e_acosh.c e_asin.c e_atan2.c e_atanh.c e_cosh.c e_exp.c e_fmod.c er_gamma.c e_hypot.c e_j0.c e_j1.c e_jn.c er_lgamma.c e_log.c e_log10.c e_pow.c e_rem_pio2.c e_remainder.c e_scalb.c e_sinh.c e_sqrt.c w_acos.c w_acosh.c w_asin.c w_atan2.c w_atanh.c w_cosh.c w_exp.c w_fmod.c w_gamma.c wr_gamma.c w_hypot.c w_j0.c w_j1.c w_jn.c w_lgamma.c wr_lgamma.c w_log.c w_log10.c w_pow.c w_remainder.c w_scalb.c w_sinh.c w_sqrt.c w_sincos.c w_cabs.c w_drem.c s_asinh.c s_atan.c s_ceil.c s_cos.c s_erf.c s_fabs.c s_floor.c s_frexp.c s_ldexp.c s_signif.c s_sin.c s_tan.c s_tanh.c w_exp2.c w_tgamma.c -fsrc = kf_rem_pio2.c kf_cos.c kf_sin.c kf_tan.c ef_acos.c ef_acosh.c ef_asin.c ef_atan2.c ef_atanh.c ef_cosh.c ef_exp.c ef_fmod.c erf_gamma.c ef_hypot.c ef_j0.c ef_j1.c ef_jn.c erf_lgamma.c ef_log.c ef_log10.c ef_pow.c ef_rem_pio2.c ef_remainder.c ef_scalb.c ef_sinh.c ef_sqrt.c wf_acos.c wf_acosh.c wf_asin.c wf_atan2.c wf_atanh.c wf_cosh.c wf_exp.c wf_fmod.c wf_gamma.c wrf_gamma.c wf_hypot.c wf_j0.c wf_j1.c wf_jn.c wf_lgamma.c wrf_lgamma.c wf_log.c wf_log10.c wf_pow.c wf_remainder.c wf_scalb.c wf_sinh.c wf_sqrt.c wf_sincos.c wf_cabs.c wf_drem.c sf_asinh.c sf_atan.c sf_ceil.c sf_cos.c sf_erf.c sf_fabs.c sf_floor.c sf_frexp.c sf_isnan.c sf_ldexp.c sf_signif.c sf_sin.c sf_tan.c sf_tanh.c sf_isinf.c wf_exp2.c wf_tgamma.c +fsrc = kf_rem_pio2.c kf_cos.c kf_sin.c kf_tan.c ef_acos.c ef_acosh.c ef_asin.c ef_atan2.c ef_atanh.c ef_cosh.c ef_exp.c ef_fmod.c erf_gamma.c ef_hypot.c ef_j0.c ef_j1.c ef_jn.c erf_lgamma.c ef_log.c ef_log10.c ef_pow.c ef_rem_pio2.c ef_remainder.c ef_scalb.c ef_sinh.c ef_sqrt.c wf_acos.c wf_acosh.c wf_asin.c wf_atan2.c wf_atanh.c wf_cosh.c wf_exp.c wf_fmod.c wf_gamma.c wrf_gamma.c wf_hypot.c wf_j0.c wf_j1.c wf_jn.c wf_lgamma.c wrf_lgamma.c wf_log.c wf_log10.c wf_pow.c wf_remainder.c wf_scalb.c wf_sinh.c wf_sqrt.c wf_sincos.c wf_cabs.c wf_drem.c sf_asinh.c sf_atan.c sf_ceil.c sf_cos.c sf_erf.c sf_fabs.c sf_floor.c sf_frexp.c sf_ldexp.c sf_signif.c sf_sin.c sf_tan.c sf_tanh.c wf_exp2.c wf_tgamma.c libmath_la_LDFLAGS = -Xcompiler -nostdlib @@ -113,7 +113,7 @@ libmath_la_LDFLAGS = -Xcompiler -nostdlib @USE_LIBTOOL_FALSE@noinst_LIBRARIES = lib.a @USE_LIBTOOL_FALSE@lib_a_SOURCES = $(src) $(fsrc) -chobj = wacos.def wacosh.def wasin.def sasinh.def satan.def watan2.def watanh.def wj0.def wcosh.def serf.def wexp.def sfabs.def sfloor.def wfmod.def sfrexp.def wgamma.def whypot.def sldexp.def wlog.def wlog10.def wpow.def wremainder.def ssin.def wsinh.def wsqrt.def stan.def stanh.def sisnan.def +chobj = wacos.def wacosh.def wasin.def sasinh.def satan.def watan2.def watanh.def wj0.def wcosh.def serf.def wexp.def sfabs.def sfloor.def wfmod.def sfrexp.def wgamma.def whypot.def sldexp.def wlog.def wlog10.def wpow.def wremainder.def ssin.def wsinh.def wsqrt.def stan.def stanh.def SUFFIXES = .def @@ -154,10 +154,9 @@ lib_a_LIBADD = @USE_LIBTOOL_FALSE@w_cabs.$(OBJEXT) w_drem.$(OBJEXT) s_asinh.$(OBJEXT) \ @USE_LIBTOOL_FALSE@s_atan.$(OBJEXT) s_ceil.$(OBJEXT) s_cos.$(OBJEXT) \ @USE_LIBTOOL_FALSE@s_erf.$(OBJEXT) s_fabs.$(OBJEXT) s_floor.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@s_frexp.$(OBJEXT) s_isnan.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@s_ldexp.$(OBJEXT) s_signif.$(OBJEXT) s_sin.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@s_tan.$(OBJEXT) s_tanh.$(OBJEXT) s_isinf.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@w_exp2.$(OBJEXT) w_tgamma.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@s_frexp.$(OBJEXT) s_ldexp.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@s_signif.$(OBJEXT) s_sin.$(OBJEXT) s_tan.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@s_tanh.$(OBJEXT) w_exp2.$(OBJEXT) w_tgamma.$(OBJEXT) \ @USE_LIBTOOL_FALSE@kf_rem_pio2.$(OBJEXT) kf_cos.$(OBJEXT) \ @USE_LIBTOOL_FALSE@kf_sin.$(OBJEXT) kf_tan.$(OBJEXT) ef_acos.$(OBJEXT) \ @USE_LIBTOOL_FALSE@ef_acosh.$(OBJEXT) ef_asin.$(OBJEXT) \ @@ -185,11 +184,9 @@ lib_a_LIBADD = @USE_LIBTOOL_FALSE@sf_atan.$(OBJEXT) sf_ceil.$(OBJEXT) sf_cos.$(OBJEXT) \ @USE_LIBTOOL_FALSE@sf_erf.$(OBJEXT) sf_fabs.$(OBJEXT) \ @USE_LIBTOOL_FALSE@sf_floor.$(OBJEXT) sf_frexp.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@sf_isnan.$(OBJEXT) sf_ldexp.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@sf_signif.$(OBJEXT) sf_sin.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@sf_tan.$(OBJEXT) sf_tanh.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@sf_isinf.$(OBJEXT) wf_exp2.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@wf_tgamma.$(OBJEXT) +@USE_LIBTOOL_FALSE@sf_ldexp.$(OBJEXT) sf_signif.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@sf_sin.$(OBJEXT) sf_tan.$(OBJEXT) sf_tanh.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@wf_exp2.$(OBJEXT) wf_tgamma.$(OBJEXT) LTLIBRARIES = $(noinst_LTLIBRARIES) libmath_la_LIBADD = @@ -206,25 +203,24 @@ libmath_la_LIBADD = @USE_LIBTOOL_TRUE@w_remainder.lo w_scalb.lo w_sinh.lo w_sqrt.lo \ @USE_LIBTOOL_TRUE@w_sincos.lo w_cabs.lo w_drem.lo s_asinh.lo s_atan.lo \ @USE_LIBTOOL_TRUE@s_ceil.lo s_cos.lo s_erf.lo s_fabs.lo s_floor.lo \ -@USE_LIBTOOL_TRUE@s_frexp.lo s_isnan.lo s_ldexp.lo s_signif.lo s_sin.lo \ -@USE_LIBTOOL_TRUE@s_tan.lo s_tanh.lo s_isinf.lo w_exp2.lo w_tgamma.lo \ -@USE_LIBTOOL_TRUE@kf_rem_pio2.lo kf_cos.lo kf_sin.lo kf_tan.lo \ -@USE_LIBTOOL_TRUE@ef_acos.lo ef_acosh.lo ef_asin.lo ef_atan2.lo \ -@USE_LIBTOOL_TRUE@ef_atanh.lo ef_cosh.lo ef_exp.lo ef_fmod.lo \ -@USE_LIBTOOL_TRUE@erf_gamma.lo ef_hypot.lo ef_j0.lo ef_j1.lo ef_jn.lo \ -@USE_LIBTOOL_TRUE@erf_lgamma.lo ef_log.lo ef_log10.lo ef_pow.lo \ -@USE_LIBTOOL_TRUE@ef_rem_pio2.lo ef_remainder.lo ef_scalb.lo ef_sinh.lo \ -@USE_LIBTOOL_TRUE@ef_sqrt.lo wf_acos.lo wf_acosh.lo wf_asin.lo \ -@USE_LIBTOOL_TRUE@wf_atan2.lo wf_atanh.lo wf_cosh.lo wf_exp.lo \ -@USE_LIBTOOL_TRUE@wf_fmod.lo wf_gamma.lo wrf_gamma.lo wf_hypot.lo \ -@USE_LIBTOOL_TRUE@wf_j0.lo wf_j1.lo wf_jn.lo wf_lgamma.lo wrf_lgamma.lo \ -@USE_LIBTOOL_TRUE@wf_log.lo wf_log10.lo wf_pow.lo wf_remainder.lo \ -@USE_LIBTOOL_TRUE@wf_scalb.lo wf_sinh.lo wf_sqrt.lo wf_sincos.lo \ -@USE_LIBTOOL_TRUE@wf_cabs.lo wf_drem.lo sf_asinh.lo sf_atan.lo \ -@USE_LIBTOOL_TRUE@sf_ceil.lo sf_cos.lo sf_erf.lo sf_fabs.lo sf_floor.lo \ -@USE_LIBTOOL_TRUE@sf_frexp.lo sf_isnan.lo sf_ldexp.lo sf_signif.lo \ -@USE_LIBTOOL_TRUE@sf_sin.lo sf_tan.lo sf_tanh.lo sf_isinf.lo wf_exp2.lo \ -@USE_LIBTOOL_TRUE@wf_tgamma.lo +@USE_LIBTOOL_TRUE@s_frexp.lo s_ldexp.lo s_signif.lo s_sin.lo s_tan.lo \ +@USE_LIBTOOL_TRUE@s_tanh.lo w_exp2.lo w_tgamma.lo kf_rem_pio2.lo \ +@USE_LIBTOOL_TRUE@kf_cos.lo kf_sin.lo kf_tan.lo ef_acos.lo ef_acosh.lo \ +@USE_LIBTOOL_TRUE@ef_asin.lo ef_atan2.lo ef_atanh.lo ef_cosh.lo \ +@USE_LIBTOOL_TRUE@ef_exp.lo ef_fmod.lo erf_gamma.lo ef_hypot.lo \ +@USE_LIBTOOL_TRUE@ef_j0.lo ef_j1.lo ef_jn.lo erf_lgamma.lo ef_log.lo \ +@USE_LIBTOOL_TRUE@ef_log10.lo ef_pow.lo ef_rem_pio2.lo ef_remainder.lo \ +@USE_LIBTOOL_TRUE@ef_scalb.lo ef_sinh.lo ef_sqrt.lo wf_acos.lo \ +@USE_LIBTOOL_TRUE@wf_acosh.lo wf_asin.lo wf_atan2.lo wf_atanh.lo \ +@USE_LIBTOOL_TRUE@wf_cosh.lo wf_exp.lo wf_fmod.lo wf_gamma.lo \ +@USE_LIBTOOL_TRUE@wrf_gamma.lo wf_hypot.lo wf_j0.lo wf_j1.lo wf_jn.lo \ +@USE_LIBTOOL_TRUE@wf_lgamma.lo wrf_lgamma.lo wf_log.lo wf_log10.lo \ +@USE_LIBTOOL_TRUE@wf_pow.lo wf_remainder.lo wf_scalb.lo wf_sinh.lo \ +@USE_LIBTOOL_TRUE@wf_sqrt.lo wf_sincos.lo wf_cabs.lo wf_drem.lo \ +@USE_LIBTOOL_TRUE@sf_asinh.lo sf_atan.lo sf_ceil.lo sf_cos.lo sf_erf.lo \ +@USE_LIBTOOL_TRUE@sf_fabs.lo sf_floor.lo sf_frexp.lo sf_ldexp.lo \ +@USE_LIBTOOL_TRUE@sf_signif.lo sf_sin.lo sf_tan.lo sf_tanh.lo \ +@USE_LIBTOOL_TRUE@wf_exp2.lo wf_tgamma.lo CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -550,9 +546,6 @@ stan.def: s_tan.c stanh.def: s_tanh.c $(CHEW) < $(srcdir)/s_tanh.c >$@ 2>/dev/null touch stmp-def -sisnan.def: s_isnan.c - $(CHEW) < $(srcdir)/s_isnan.c >$@ 2>/dev/null - touch stmp-def # A partial dependency list. diff --git a/newlib/libm/mathfp/Makefile.am b/newlib/libm/mathfp/Makefile.am index 82adbea4f6..e529022a6b 100644 --- a/newlib/libm/mathfp/Makefile.am +++ b/newlib/libm/mathfp/Makefile.am @@ -16,7 +16,7 @@ src = s_acos.c s_frexp.c s_mathcnst.c \ s_sincos.c \ s_atangent.c s_logarithm.c \ s_sineh.c \ - s_ceil.c s_isnan.c s_isinf.c \ + s_ceil.c \ e_acosh.c e_atanh.c e_remainder.c \ er_gamma.c er_lgamma.c \ s_erf.c e_j0.c e_j1.c w_jn.c e_hypot.c \ @@ -36,7 +36,6 @@ fsrc = sf_ceil.c \ sf_sincos.c \ sf_atangent.c sf_logarithm.c sf_sineh.c \ sf_log.c sf_sineh.c \ - sf_isnan.c sf_isinf.c \ ef_acosh.c ef_atanh.c ef_remainder.c \ erf_gamma.c erf_lgamma.c \ sf_erf.c ef_j0.c ef_j1.c wf_jn.c ef_hypot.c \ @@ -76,7 +75,6 @@ chobj = eacosh.def \ sfloor.def \ sfmod.def \ sfrexp.def \ - sisnan.def \ sldexp.def \ slog10.def \ slogarithm.def \ @@ -160,9 +158,6 @@ sfmod.def: s_fmod.c sfrexp.def: s_frexp.c $(CHEW) < $(srcdir)/s_frexp.c >$@ 2>/dev/null touch stmp-def -sisnan.def: s_isnan.c - $(CHEW) < $(srcdir)/s_isnan.c >$@ 2>/dev/null - touch stmp-def sldexp.def: s_ldexp.c $(CHEW) < $(srcdir)/s_ldexp.c >$@ 2>/dev/null touch stmp-def diff --git a/newlib/libm/mathfp/Makefile.in b/newlib/libm/mathfp/Makefile.in index e0eaaa43e7..b11e8130f3 100644 --- a/newlib/libm/mathfp/Makefile.in +++ b/newlib/libm/mathfp/Makefile.in @@ -98,10 +98,10 @@ AUTOMAKE_OPTIONS = cygnus INCLUDES = -I$(srcdir)/../common $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) -src = s_acos.c s_frexp.c s_mathcnst.c s_cos.c s_sinh.c s_asin.c s_asine.c s_cosh.c s_ispos.c s_numtest.c s_sqrt.c s_exp.c s_ldexp.c s_pow.c s_tan.c s_atan.c s_atan2.c s_fabs.c s_log.c s_tanh.c s_log10.c s_sin.c s_floor.c s_sine.c s_sincos.c s_atangent.c s_logarithm.c s_sineh.c s_ceil.c s_isnan.c s_isinf.c e_acosh.c e_atanh.c e_remainder.c er_gamma.c er_lgamma.c s_erf.c e_j0.c e_j1.c w_jn.c e_hypot.c w_cabs.c w_drem.c s_asinh.c s_fmod.c e_scalb.c s_signif.c s_exp2.c s_tgamma.c +src = s_acos.c s_frexp.c s_mathcnst.c s_cos.c s_sinh.c s_asin.c s_asine.c s_cosh.c s_ispos.c s_numtest.c s_sqrt.c s_exp.c s_ldexp.c s_pow.c s_tan.c s_atan.c s_atan2.c s_fabs.c s_log.c s_tanh.c s_log10.c s_sin.c s_floor.c s_sine.c s_sincos.c s_atangent.c s_logarithm.c s_sineh.c s_ceil.c e_acosh.c e_atanh.c e_remainder.c er_gamma.c er_lgamma.c s_erf.c e_j0.c e_j1.c w_jn.c e_hypot.c w_cabs.c w_drem.c s_asinh.c s_fmod.c e_scalb.c s_signif.c s_exp2.c s_tgamma.c -fsrc = sf_ceil.c sf_acos.c sf_frexp.c sf_cos.c sf_sinh.c sf_asine.c sf_cosh.c sf_ispos.c sf_numtest.c sf_sqrt.c sf_asin.c sf_exp.c sf_ldexp.c sf_pow.c sf_tan.c sf_atan2.c sf_fabs.c sf_tanh.c sf_atan.c sf_log10.c sf_sin.c sf_floor.c sf_sine.c sf_sincos.c sf_atangent.c sf_logarithm.c sf_sineh.c sf_log.c sf_sineh.c sf_isnan.c sf_isinf.c ef_acosh.c ef_atanh.c ef_remainder.c erf_gamma.c erf_lgamma.c sf_erf.c ef_j0.c ef_j1.c wf_jn.c ef_hypot.c wf_cabs.c wf_drem.c sf_asinh.c sf_fmod.c ef_scalb.c sf_signif.c sf_exp2.c sf_tgamma.c +fsrc = sf_ceil.c sf_acos.c sf_frexp.c sf_cos.c sf_sinh.c sf_asine.c sf_cosh.c sf_ispos.c sf_numtest.c sf_sqrt.c sf_asin.c sf_exp.c sf_ldexp.c sf_pow.c sf_tan.c sf_atan2.c sf_fabs.c sf_tanh.c sf_atan.c sf_log10.c sf_sin.c sf_floor.c sf_sine.c sf_sincos.c sf_atangent.c sf_logarithm.c sf_sineh.c sf_log.c sf_sineh.c ef_acosh.c ef_atanh.c ef_remainder.c erf_gamma.c erf_lgamma.c sf_erf.c ef_j0.c ef_j1.c wf_jn.c ef_hypot.c wf_cabs.c wf_drem.c sf_asinh.c sf_fmod.c ef_scalb.c sf_signif.c sf_exp2.c sf_tgamma.c libmathfp_la_LDFLAGS = -Xcompiler -nostdlib @@ -113,7 +113,7 @@ libmathfp_la_LDFLAGS = -Xcompiler -nostdlib @USE_LIBTOOL_FALSE@noinst_LIBRARIES = lib.a @USE_LIBTOOL_FALSE@lib_a_SOURCES = $(src) $(fsrc) -chobj = eacosh.def eatanh.def ehypot.def eremainder.def erlgamma.def sacos.def sasine.def sasinh.def satan.def satan2.def satangent.def scosh.def serf.def sexp.def sfabs.def sfloor.def sfmod.def sfrexp.def sisnan.def sldexp.def slog10.def slogarithm.def spow.def ssine.def ssineh.def ssqrt.def stan.def stanh.def wjn.def +chobj = eacosh.def eatanh.def ehypot.def eremainder.def erlgamma.def sacos.def sasine.def sasinh.def satan.def satan2.def satangent.def scosh.def serf.def sexp.def sfabs.def sfloor.def sfmod.def sfrexp.def sldexp.def slog10.def slogarithm.def spow.def ssine.def ssineh.def ssqrt.def stan.def stanh.def wjn.def SUFFIXES = .def @@ -143,8 +143,7 @@ lib_a_LIBADD = @USE_LIBTOOL_FALSE@s_sin.$(OBJEXT) s_floor.$(OBJEXT) s_sine.$(OBJEXT) \ @USE_LIBTOOL_FALSE@s_sincos.$(OBJEXT) s_atangent.$(OBJEXT) \ @USE_LIBTOOL_FALSE@s_logarithm.$(OBJEXT) s_sineh.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@s_ceil.$(OBJEXT) s_isnan.$(OBJEXT) s_isinf.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@e_acosh.$(OBJEXT) e_atanh.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@s_ceil.$(OBJEXT) e_acosh.$(OBJEXT) e_atanh.$(OBJEXT) \ @USE_LIBTOOL_FALSE@e_remainder.$(OBJEXT) er_gamma.$(OBJEXT) \ @USE_LIBTOOL_FALSE@er_lgamma.$(OBJEXT) s_erf.$(OBJEXT) e_j0.$(OBJEXT) \ @USE_LIBTOOL_FALSE@e_j1.$(OBJEXT) w_jn.$(OBJEXT) e_hypot.$(OBJEXT) \ @@ -165,7 +164,6 @@ lib_a_LIBADD = @USE_LIBTOOL_FALSE@sf_sincos.$(OBJEXT) sf_atangent.$(OBJEXT) \ @USE_LIBTOOL_FALSE@sf_logarithm.$(OBJEXT) sf_sineh.$(OBJEXT) \ @USE_LIBTOOL_FALSE@sf_log.$(OBJEXT) sf_sineh.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@sf_isnan.$(OBJEXT) sf_isinf.$(OBJEXT) \ @USE_LIBTOOL_FALSE@ef_acosh.$(OBJEXT) ef_atanh.$(OBJEXT) \ @USE_LIBTOOL_FALSE@ef_remainder.$(OBJEXT) erf_gamma.$(OBJEXT) \ @USE_LIBTOOL_FALSE@erf_lgamma.$(OBJEXT) sf_erf.$(OBJEXT) \ @@ -184,19 +182,18 @@ libmathfp_la_LIBADD = @USE_LIBTOOL_TRUE@s_ldexp.lo s_pow.lo s_tan.lo s_atan.lo s_atan2.lo \ @USE_LIBTOOL_TRUE@s_fabs.lo s_log.lo s_tanh.lo s_log10.lo s_sin.lo \ @USE_LIBTOOL_TRUE@s_floor.lo s_sine.lo s_sincos.lo s_atangent.lo \ -@USE_LIBTOOL_TRUE@s_logarithm.lo s_sineh.lo s_ceil.lo s_isnan.lo \ -@USE_LIBTOOL_TRUE@s_isinf.lo e_acosh.lo e_atanh.lo e_remainder.lo \ -@USE_LIBTOOL_TRUE@er_gamma.lo er_lgamma.lo s_erf.lo e_j0.lo e_j1.lo \ -@USE_LIBTOOL_TRUE@w_jn.lo e_hypot.lo w_cabs.lo w_drem.lo s_asinh.lo \ -@USE_LIBTOOL_TRUE@s_fmod.lo e_scalb.lo s_signif.lo s_exp2.lo \ -@USE_LIBTOOL_TRUE@s_tgamma.lo sf_ceil.lo sf_acos.lo sf_frexp.lo \ -@USE_LIBTOOL_TRUE@sf_cos.lo sf_sinh.lo sf_asine.lo sf_cosh.lo \ -@USE_LIBTOOL_TRUE@sf_ispos.lo sf_numtest.lo sf_sqrt.lo sf_asin.lo \ -@USE_LIBTOOL_TRUE@sf_exp.lo sf_ldexp.lo sf_pow.lo sf_tan.lo sf_atan2.lo \ -@USE_LIBTOOL_TRUE@sf_fabs.lo sf_tanh.lo sf_atan.lo sf_log10.lo \ -@USE_LIBTOOL_TRUE@sf_sin.lo sf_floor.lo sf_sine.lo sf_sincos.lo \ -@USE_LIBTOOL_TRUE@sf_atangent.lo sf_logarithm.lo sf_sineh.lo sf_log.lo \ -@USE_LIBTOOL_TRUE@sf_sineh.lo sf_isnan.lo sf_isinf.lo ef_acosh.lo \ +@USE_LIBTOOL_TRUE@s_logarithm.lo s_sineh.lo s_ceil.lo e_acosh.lo \ +@USE_LIBTOOL_TRUE@e_atanh.lo e_remainder.lo er_gamma.lo er_lgamma.lo \ +@USE_LIBTOOL_TRUE@s_erf.lo e_j0.lo e_j1.lo w_jn.lo e_hypot.lo w_cabs.lo \ +@USE_LIBTOOL_TRUE@w_drem.lo s_asinh.lo s_fmod.lo e_scalb.lo s_signif.lo \ +@USE_LIBTOOL_TRUE@s_exp2.lo s_tgamma.lo sf_ceil.lo sf_acos.lo \ +@USE_LIBTOOL_TRUE@sf_frexp.lo sf_cos.lo sf_sinh.lo sf_asine.lo \ +@USE_LIBTOOL_TRUE@sf_cosh.lo sf_ispos.lo sf_numtest.lo sf_sqrt.lo \ +@USE_LIBTOOL_TRUE@sf_asin.lo sf_exp.lo sf_ldexp.lo sf_pow.lo sf_tan.lo \ +@USE_LIBTOOL_TRUE@sf_atan2.lo sf_fabs.lo sf_tanh.lo sf_atan.lo \ +@USE_LIBTOOL_TRUE@sf_log10.lo sf_sin.lo sf_floor.lo sf_sine.lo \ +@USE_LIBTOOL_TRUE@sf_sincos.lo sf_atangent.lo sf_logarithm.lo \ +@USE_LIBTOOL_TRUE@sf_sineh.lo sf_log.lo sf_sineh.lo ef_acosh.lo \ @USE_LIBTOOL_TRUE@ef_atanh.lo ef_remainder.lo erf_gamma.lo \ @USE_LIBTOOL_TRUE@erf_lgamma.lo sf_erf.lo ef_j0.lo ef_j1.lo wf_jn.lo \ @USE_LIBTOOL_TRUE@ef_hypot.lo wf_cabs.lo wf_drem.lo sf_asinh.lo \ @@ -497,9 +494,6 @@ sfmod.def: s_fmod.c sfrexp.def: s_frexp.c $(CHEW) < $(srcdir)/s_frexp.c >$@ 2>/dev/null touch stmp-def -sisnan.def: s_isnan.c - $(CHEW) < $(srcdir)/s_isnan.c >$@ 2>/dev/null - touch stmp-def sldexp.def: s_ldexp.c $(CHEW) < $(srcdir)/s_ldexp.c >$@ 2>/dev/null touch stmp-def diff --git a/newlib/libm/mathfp/s_isinf.c b/newlib/libm/mathfp/s_isinf.c deleted file mode 100644 index fe9f547990..0000000000 --- a/newlib/libm/mathfp/s_isinf.c +++ /dev/null @@ -1,37 +0,0 @@ - -/* @(#)z_isinf.c 1.0 98/08/13 */ -/****************************************************************** - * isinf - * - * Input: - * x - pointer to a floating point value - * - * Output: - * An integer that indicates if the number is infinite. - * - * Description: - * This routine returns an integer that indicates if the number - * passed in is infinite (1) or is finite (0). - * - *****************************************************************/ - -#include "fdlibm.h" -#include "zmath.h" - -#ifndef _DOUBLE_IS_32BITS - -int isinf (double x) -{ - __uint32_t lx, hx; - int exp; - - EXTRACT_WORDS (hx, lx, x); - exp = (hx & 0x7ff00000) >> 20; - - if ((exp == 0x7ff) && ((hx & 0xf0000 || lx) == 0)) - return (1); - else - return (0); -} - -#endif /* _DOUBLE_IS_32BITS */ diff --git a/newlib/libm/mathfp/s_isnan.c b/newlib/libm/mathfp/s_isnan.c deleted file mode 100644 index 70ac704c3a..0000000000 --- a/newlib/libm/mathfp/s_isnan.c +++ /dev/null @@ -1,124 +0,0 @@ - -/* @(#)z_isnan.c 1.0 98/08/13 */ - -/* -FUNCTION - <>, <>, <>, <>, <>, <>---test -for exceptional numbers - -INDEX - isnan -INDEX - isinf -INDEX - finite - -INDEX - isnanf -INDEX - isinff -INDEX - finitef - -ANSI_SYNOPSIS - #include - int isnan(double <[arg]>); - int isinf(double <[arg]>); - int finite(double <[arg]>); - int isnanf(float <[arg]>); - int isinff(float <[arg]>); - int finitef(float <[arg]>); - -TRAD_SYNOPSIS - #include - int isnan(<[arg]>) - double <[arg]>; - int isinf(<[arg]>) - double <[arg]>; - int finite(<[arg]>); - double <[arg]>; - int isnanf(<[arg]>); - float <[arg]>; - int isinff(<[arg]>); - float <[arg]>; - int finitef(<[arg]>); - float <[arg]>; - - -DESCRIPTION - These functions provide information on the floating-point - argument supplied. - - There are five major number formats: - o+ - o zero - A number which contains all zero bits. - o subnormal - A number with a zero exponent but a nonzero fraction. - o normal - A number with an exponent and a fraction. - o infinity - A number with an all 1's exponent and a zero fraction. - o NAN - A number with an all 1's exponent and a nonzero fraction. - - o- - - <> returns 1 if the argument is a nan. <> - returns 1 if the argument is infinity. <> returns 1 if the - argument is zero, subnormal or normal. - - The <>, <> and <> functions perform the same - operations as their <>, <> and <> - counterparts, but on single-precision floating-point numbers. - -QUICKREF - isnan - pure -QUICKREF - isinf - pure -QUICKREF - finite - pure -QUICKREF - isnan - pure -QUICKREF - isinf - pure -QUICKREF - finite - pure -*/ - - -/****************************************************************** - * isnan - * - * Input: - * x - pointer to a floating-point value - * - * Output: - * An integer that indicates if the number is NaN. - * - * Description: - * This routine returns an integer that indicates if the number - * passed in is NaN (1) or is finite (0). - * - *****************************************************************/ - -#include "fdlibm.h" -#include "zmath.h" - -#ifndef _DOUBLE_IS_32BITS - -int isnan (double x) -{ - __uint32_t lx, hx; - int exp; - - EXTRACT_WORDS (hx, lx, x); - exp = (hx & 0x7ff00000) >> 20; - - if ((exp == 0x7ff) && (hx & 0xf0000 || lx)) - return (1); - else - return (0); -} - -#endif /* _DOUBLE_IS_32BITS */ diff --git a/newlib/libm/mathfp/sf_isinf.c b/newlib/libm/mathfp/sf_isinf.c deleted file mode 100644 index 84ab3f71c8..0000000000 --- a/newlib/libm/mathfp/sf_isinf.c +++ /dev/null @@ -1,48 +0,0 @@ - -/* @(#)z_isinff.c 1.0 98/08/13 */ -/****************************************************************** - * isinff - * - * Input: - * x - pointer to a floating point value - * - * Output: - * An integer that indicates if the number is infinite. - * - * Description: - * This routine returns an integer that indicates if the number - * passed in is infinite (1) or is finite (0). - * - *****************************************************************/ - -#include "fdlibm.h" -#include "zmath.h" - -int -_DEFUN (isinff, (float), - float x) -{ - __uint32_t wx; - int exp; - - GET_FLOAT_WORD (wx, x); - exp = (wx & 0x7f800000) >> 23; - - if ((exp == 0x7f8) && !(wx & 0xf0000)) - return (1); - else - return (0); -} - -#ifdef _DOUBLE_IS_32BITS - -int -_DEFUN (isinf, (double), - double x) -{ - return isinff ((float) x); -} - -#endif /* defined(_DOUBLE_IS_32BITS) */ - - diff --git a/newlib/libm/mathfp/sf_isnan.c b/newlib/libm/mathfp/sf_isnan.c deleted file mode 100644 index ac557a6b8a..0000000000 --- a/newlib/libm/mathfp/sf_isnan.c +++ /dev/null @@ -1,48 +0,0 @@ - -/* @(#)z_isnanf.c 1.0 98/08/13 */ -/****************************************************************** - * isnanf - * - * Input: - * x - pointer to a floating point value - * - * Output: - * An integer that indicates if the number is NaN. - * - * Description: - * This routine returns an integer that indicates if the number - * passed in is NaN (1) or is finite (0). - * - *****************************************************************/ - -#include "fdlibm.h" -#include "zmath.h" - -int -_DEFUN (isnanf, (float), - float x) -{ - __int32_t wx; - int exp; - - GET_FLOAT_WORD (wx, x); - exp = (wx & 0x7f800000) >> 23; - - if ((exp == 0x7f8) && (wx & 0x7fffff)) - return (1); - else - return (0); -} - - -#ifdef _DOUBLE_IS_32BITS - -int -_DEFUN (isnan, (double), - double x) -{ - return isnanf((float) x); -} - -#endif /* defined(_DOUBLE_IS_32BITS) */ - -- 2.11.0