diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2007-04-26 02:28:19 +0400 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2007-04-26 02:28:19 +0400 |
commit | 34450bd565935f215b07d42ab1af87317ad9a8a0 (patch) | |
tree | 7bdbcc1dad9a77d66f4f6288cf24de28d93503e1 /newlib/libm/common | |
parent | 42cd3e6c525b8abbe3e55c2b17686f16b1a1747e (diff) |
2007-04-25 Jeff Johnston <jjohnstn@redhat.com>
* libm/common/s_fpclassify.c (__fpclassifyf): Move this to...
* libm/common/sf_fpclassify.c: ...here. New file.
* libm/common/Makefile.am: Add sf_fpclassify.c.
* libm/common/Makefile.in: Regenerated.
Diffstat (limited to 'newlib/libm/common')
-rw-r--r-- | newlib/libm/common/Makefile.am | 2 | ||||
-rw-r--r-- | newlib/libm/common/Makefile.in | 22 | ||||
-rw-r--r-- | newlib/libm/common/s_fpclassify.c | 23 | ||||
-rw-r--r-- | newlib/libm/common/sf_fpclassify.c | 29 |
4 files changed, 46 insertions, 30 deletions
diff --git a/newlib/libm/common/Makefile.am b/newlib/libm/common/Makefile.am index 87b552776..1f2f98c43 100644 --- a/newlib/libm/common/Makefile.am +++ b/newlib/libm/common/Makefile.am @@ -18,7 +18,7 @@ fsrc = sf_finite.c sf_copysign.c sf_modf.c sf_scalbn.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_fdim.c sf_fma.c sf_fmax.c sf_fmin.c sf_fpclassify.c sf_lrint.c \ sf_lround.c sf_nearbyint.c sf_remquo.c sf_round.c \ sf_scalbln.c sf_trunc.c diff --git a/newlib/libm/common/Makefile.in b/newlib/libm/common/Makefile.in index 2c717042b..0c5a100bc 100644 --- a/newlib/libm/common/Makefile.in +++ b/newlib/libm/common/Makefile.in @@ -80,10 +80,11 @@ am__objects_2 = lib_a-sf_finite.$(OBJEXT) lib_a-sf_copysign.$(OBJEXT) \ lib_a-sf_nextafter.$(OBJEXT) lib_a-sf_rint.$(OBJEXT) \ lib_a-sf_logb.$(OBJEXT) lib_a-sf_fdim.$(OBJEXT) \ lib_a-sf_fma.$(OBJEXT) lib_a-sf_fmax.$(OBJEXT) \ - lib_a-sf_fmin.$(OBJEXT) lib_a-sf_lrint.$(OBJEXT) \ - lib_a-sf_lround.$(OBJEXT) lib_a-sf_nearbyint.$(OBJEXT) \ - lib_a-sf_remquo.$(OBJEXT) lib_a-sf_round.$(OBJEXT) \ - lib_a-sf_scalbln.$(OBJEXT) lib_a-sf_trunc.$(OBJEXT) + lib_a-sf_fmin.$(OBJEXT) lib_a-sf_fpclassify.$(OBJEXT) \ + lib_a-sf_lrint.$(OBJEXT) lib_a-sf_lround.$(OBJEXT) \ + lib_a-sf_nearbyint.$(OBJEXT) lib_a-sf_remquo.$(OBJEXT) \ + lib_a-sf_round.$(OBJEXT) lib_a-sf_scalbln.$(OBJEXT) \ + lib_a-sf_trunc.$(OBJEXT) @USE_LIBTOOL_FALSE@am_lib_a_OBJECTS = $(am__objects_1) \ @USE_LIBTOOL_FALSE@ $(am__objects_2) lib_a_OBJECTS = $(am_lib_a_OBJECTS) @@ -100,8 +101,9 @@ am__objects_4 = sf_finite.lo sf_copysign.lo sf_modf.lo sf_scalbn.lo \ sf_cbrt.lo sf_expm1.lo sf_ilogb.lo sf_infinity.lo sf_isinf.lo \ sf_isinff.lo sf_isnan.lo sf_isnanf.lo sf_log1p.lo sf_nan.lo \ sf_nextafter.lo sf_rint.lo sf_logb.lo sf_fdim.lo sf_fma.lo \ - sf_fmax.lo sf_fmin.lo sf_lrint.lo sf_lround.lo sf_nearbyint.lo \ - sf_remquo.lo sf_round.lo sf_scalbln.lo sf_trunc.lo + sf_fmax.lo sf_fmin.lo sf_fpclassify.lo sf_lrint.lo \ + sf_lround.lo sf_nearbyint.lo sf_remquo.lo sf_round.lo \ + sf_scalbln.lo sf_trunc.lo @USE_LIBTOOL_TRUE@am_libcommon_la_OBJECTS = $(am__objects_3) \ @USE_LIBTOOL_TRUE@ $(am__objects_4) libcommon_la_OBJECTS = $(am_libcommon_la_OBJECTS) @@ -255,7 +257,7 @@ fsrc = sf_finite.c sf_copysign.c sf_modf.c sf_scalbn.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_fdim.c sf_fma.c sf_fmax.c sf_fmin.c sf_fpclassify.c sf_lrint.c \ sf_lround.c sf_nearbyint.c sf_remquo.c sf_round.c \ sf_scalbln.c sf_trunc.c @@ -666,6 +668,12 @@ lib_a-sf_fmin.o: sf_fmin.c lib_a-sf_fmin.obj: sf_fmin.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_fmin.obj `if test -f 'sf_fmin.c'; then $(CYGPATH_W) 'sf_fmin.c'; else $(CYGPATH_W) '$(srcdir)/sf_fmin.c'; fi` +lib_a-sf_fpclassify.o: sf_fpclassify.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_fpclassify.o `test -f 'sf_fpclassify.c' || echo '$(srcdir)/'`sf_fpclassify.c + +lib_a-sf_fpclassify.obj: sf_fpclassify.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_fpclassify.obj `if test -f 'sf_fpclassify.c'; then $(CYGPATH_W) 'sf_fpclassify.c'; else $(CYGPATH_W) '$(srcdir)/sf_fpclassify.c'; fi` + lib_a-sf_lrint.o: sf_lrint.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sf_lrint.o `test -f 'sf_lrint.c' || echo '$(srcdir)/'`sf_lrint.c diff --git a/newlib/libm/common/s_fpclassify.c b/newlib/libm/common/s_fpclassify.c index 111d70923..3ebba7030 100644 --- a/newlib/libm/common/s_fpclassify.c +++ b/newlib/libm/common/s_fpclassify.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved. +/* Copyright (C) 2002, 2007 by Red Hat, Incorporated. All rights reserved. * * Permission to use, copy, modify, and distribute this software * is freely granted, provided that this notice is preserved. @@ -7,27 +7,6 @@ #include "fdlibm.h" int -__fpclassifyf (float x) -{ - __uint32_t w; - - GET_FLOAT_WORD(w,x); - - if (w == 0x00000000 || w == 0x80000000) - return FP_ZERO; - else if ((w >= 0x00800000 && w <= 0x7f7fffff) || - (w >= 0x80800000 && w <= 0xff7fffff)) - return FP_NORMAL; - else if ((w >= 0x00000001 && w <= 0x007fffff) || - (w >= 0x80000001 && w <= 0x807fffff)) - return FP_SUBNORMAL; - else if (w == 0x7f800000 || w == 0xff800000) - return FP_INFINITE; - else - return FP_NAN; -} - -int __fpclassifyd (double x) { __uint32_t msw, lsw; diff --git a/newlib/libm/common/sf_fpclassify.c b/newlib/libm/common/sf_fpclassify.c new file mode 100644 index 000000000..878457f39 --- /dev/null +++ b/newlib/libm/common/sf_fpclassify.c @@ -0,0 +1,29 @@ +/* Copyright (C) 2002,2007 by Red Hat, Incorporated. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include "fdlibm.h" + +int +__fpclassifyf (float x) +{ + __uint32_t w; + + GET_FLOAT_WORD(w,x); + + if (w == 0x00000000 || w == 0x80000000) + return FP_ZERO; + else if ((w >= 0x00800000 && w <= 0x7f7fffff) || + (w >= 0x80800000 && w <= 0xff7fffff)) + return FP_NORMAL; + else if ((w >= 0x00000001 && w <= 0x007fffff) || + (w >= 0x80000001 && w <= 0x807fffff)) + return FP_SUBNORMAL; + else if (w == 0x7f800000 || w == 0xff800000) + return FP_INFINITE; + else + return FP_NAN; +} + |