svn commit: trunk/uClibc/libm

psm at uclibc.org psm at uclibc.org
Wed Oct 26 10:15:07 UTC 2005


Author: psm
Date: 2005-10-26 03:15:05 -0700 (Wed, 26 Oct 2005)
New Revision: 11923

Log:
Remove s_ceilf.c and s_floorf.c, ceilf and floorf are provided by the float_wrapper. I hope that __ceilf and __floorf are not needed anywhere. Use only __finite from s_finite.c, disabled in fpmacros.c. Allow IMA compiling, 2 files: s_lib_version.c and w_cabs.c have to be reworked for complete IMA.

Removed:
   trunk/uClibc/libm/s_ceilf.c
   trunk/uClibc/libm/s_floorf.c

Modified:
   trunk/uClibc/libm/Makefile
   trunk/uClibc/libm/Makefile.in
   trunk/uClibc/libm/fpmacros.c
   trunk/uClibc/libm/s_finite.c


Changeset:
Modified: trunk/uClibc/libm/Makefile
===================================================================
--- trunk/uClibc/libm/Makefile	2005-10-26 08:15:03 UTC (rev 11922)
+++ trunk/uClibc/libm/Makefile	2005-10-26 10:15:05 UTC (rev 11923)
@@ -60,7 +60,7 @@
          w_cosh.c w_drem.c w_exp.c w_fmod.c w_gamma.c w_gamma_r.c\
          w_hypot.c w_j0.c w_j1.c w_jn.c w_lgamma.c w_lgamma_r.c\
          w_log.c w_log10.c w_pow.c w_remainder.c w_scalb.c w_sinh.c\
-         w_sqrt.c fpmacros.c nan.c s_ceilf.c s_floorf.c
+         w_sqrt.c fpmacros.c nan.c
 FL_MOBJ := acosf.o acoshf.o asinf.o asinhf.o atan2f.o atanf.o atanhf.o cbrtf.o \
 	ceilf.o copysignf.o cosf.o coshf.o erfcf.o erff.o exp2f.o expf.o \
 	expm1f.o fabsf.o fdimf.o floorf.o fmaf.o fmaxf.o fminf.o fmodf.o \

Modified: trunk/uClibc/libm/Makefile.in
===================================================================
--- trunk/uClibc/libm/Makefile.in	2005-10-26 08:15:03 UTC (rev 11922)
+++ trunk/uClibc/libm/Makefile.in	2005-10-26 10:15:05 UTC (rev 11923)
@@ -24,7 +24,7 @@
 
 CFLAGS+=-D_IEEE_LIBM -D_ISOC99_SOURCE -D_SVID_SOURCE
 
-DOMULTI=n
+#DOMULTI=n
 
 LIB_NAME:=libm
 
@@ -49,7 +49,7 @@
 	w_cosh.c w_drem.c w_exp.c w_fmod.c w_gamma.c w_gamma_r.c \
 	w_hypot.c w_j0.c w_j1.c w_jn.c w_lgamma.c w_lgamma_r.c \
 	w_log.c w_log10.c w_pow.c w_remainder.c w_scalb.c w_sinh.c \
-	w_sqrt.c fpmacros.c nan.c s_ceilf.c s_floorf.c
+	w_sqrt.c fpmacros.c nan.c
 FL_MOBJ:=acosf.o acoshf.o asinf.o asinhf.o atan2f.o atanf.o atanhf.o cbrtf.o \
 	ceilf.o copysignf.o cosf.o coshf.o erfcf.o erff.o exp2f.o expf.o \
 	expm1f.o fabsf.o fdimf.o floorf.o fmaf.o fmaxf.o fminf.o fmodf.o \
@@ -92,6 +92,9 @@
 endif
 endif
 
+LIBM_NO_MULTI:=s_lib_version.c w_cabs.c
+CSRC:=$(filter-out $(LIBM_NO_MULTI),$(CSRC))
+
 libm_SRC:=$(patsubst %.c,$(libm_DIR)/%.c,$(CSRC))
 libm_OBJ:=$(patsubst $(libm_DIR)/%.c,$(libm_OUT)/%.o,$(libm_SRC))
 
@@ -100,7 +103,7 @@
 
 libm_DEF:=$(patsubst %,-DL_%,$(subst .o,,$(notdir $(libm_MOBJ))))
 
-libm_OBJS:=$(libm_OBJ) $(libm_MOBJ)
+libm_OBJS:=$(libm_OBJ) $(libm_MOBJ) $(patsubst %.c,$(libm_OUT)/%.o,$(LIBM_NO_MULTI))
 
 $(libm_MOBJ) $(libm_MOBJ:.o=.os): $(libm_MSRC)
 	$(compile.m)
@@ -113,6 +116,7 @@
 libm-multi-$(UCLIBC_HAS_FLOATS)+=$(libm_SRC) $(libm_MSRC)
 #libm-multi-$(UCLIBC_HAS_FLOATS)+=$(libm_MSRC)
 #libm-nomulti-$(UCLIBC_HAS_FLOATS)+=$(libm_OBJ)
+libm-nomulti-$(UCLIBC_HAS_FLOATS)+=$(patsubst %.c,$(libm_OUT)/%.o,$(LIBM_NO_MULTI))
 
 objclean-y+=libm_clean
 

Modified: trunk/uClibc/libm/fpmacros.c
===================================================================
--- trunk/uClibc/libm/fpmacros.c	2005-10-26 08:15:03 UTC (rev 11922)
+++ trunk/uClibc/libm/fpmacros.c	2005-10-26 10:15:05 UTC (rev 11923)
@@ -160,11 +160,13 @@
 }
 weak_alias (__finitef, finitef)
 
+#if 0 /* use __finite in s_finite.c */
 int __finite ( double x )
 {
 	return ( __fpclassify ( x ) >= FP_ZERO );
 }
 weak_alias (__finite, finite)
+#endif
 
 
 /***********************************************************************

Deleted: trunk/uClibc/libm/s_ceilf.c
===================================================================
--- trunk/uClibc/libm/s_ceilf.c	2005-10-26 08:15:03 UTC (rev 11922)
+++ trunk/uClibc/libm/s_ceilf.c	2005-10-26 10:15:05 UTC (rev 11923)
@@ -1,62 +0,0 @@
-/* s_ceilf.c -- float version of s_ceil.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian at cygnus.com.
- */
-
-/*
- * ====================================================
- * 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.
- * ====================================================
- */
-
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: s_ceilf.c,v 1.4 1995/05/10 20:46:55 jtc Exp $";
-#endif
-
-#include "math.h"
-#include "math_private.h"
-
-#ifdef __STDC__
-static const float huge = 1.0e30;
-#else
-static float huge = 1.0e30;
-#endif
-
-#ifdef __STDC__
-	float __ceilf(float x)
-#else
-	float __ceilf(x)
-	float x;
-#endif
-{
-	int32_t i0,j0;
-	u_int32_t i;
-
-	GET_FLOAT_WORD(i0,x);
-	j0 = ((i0>>23)&0xff)-0x7f;
-	if(j0<23) {
-	    if(j0<0) { 	/* raise inexact if x != 0 */
-		if(huge+x>(float)0.0) {/* return 0*sign(x) if |x|<1 */
-		    if(i0<0) {i0=0x80000000;}
-		    else if(i0!=0) { i0=0x3f800000;}
-		}
-	    } else {
-		i = (0x007fffff)>>j0;
-		if((i0&i)==0) return x; /* x is integral */
-		if(huge+x>(float)0.0) {	/* raise inexact flag */
-		    if(i0>0) i0 += (0x00800000)>>j0;
-		    i0 &= (~i);
-		}
-	    }
-	} else {
-	    if(j0==0x80) return x+x;	/* inf or NaN */
-	    else return x;		/* x is integral */
-	}
-	SET_FLOAT_WORD(x,i0);
-	return x;
-}
-weak_alias (__ceilf, ceilf)

Modified: trunk/uClibc/libm/s_finite.c
===================================================================
--- trunk/uClibc/libm/s_finite.c	2005-10-26 08:15:03 UTC (rev 11922)
+++ trunk/uClibc/libm/s_finite.c	2005-10-26 10:15:05 UTC (rev 11923)
@@ -23,9 +23,9 @@
 #include "math_private.h"
 
 #ifdef __STDC__
-	int finite(double x)
+	int __finite(double x)
 #else
-	int finite(x)
+	int __finite(x)
 	double x;
 #endif
 {
@@ -33,3 +33,4 @@
 	GET_HIGH_WORD(hx,x);
 	return (int)((u_int32_t)((hx&0x7fffffff)-0x7ff00000)>>31);
 }
+weak_alias(__finite,finite)

Deleted: trunk/uClibc/libm/s_floorf.c
===================================================================
--- trunk/uClibc/libm/s_floorf.c	2005-10-26 08:15:03 UTC (rev 11922)
+++ trunk/uClibc/libm/s_floorf.c	2005-10-26 10:15:05 UTC (rev 11923)
@@ -1,71 +0,0 @@
-/* s_floorf.c -- float version of s_floor.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian at cygnus.com.
- */
-
-/*
- * ====================================================
- * 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.
- * ====================================================
- */
-
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: s_floorf.c,v 1.4 1995/05/10 20:47:22 jtc Exp $";
-#endif
-
-/*
- * floorf(x)
- * Return x rounded toward -inf to integral value
- * Method:
- *	Bit twiddling.
- * Exception:
- *	Inexact flag raised if x not equal to floorf(x).
- */
-
-#include "math.h"
-#include "math_private.h"
-
-#ifdef __STDC__
-static const float huge = 1.0e30;
-#else
-static float huge = 1.0e30;
-#endif
-
-#ifdef __STDC__
-	float __floorf(float x)
-#else
-	float __floorf(x)
-	float x;
-#endif
-{
-	int32_t i0,j0;
-	u_int32_t i;
-	GET_FLOAT_WORD(i0,x);
-	j0 = ((i0>>23)&0xff)-0x7f;
-	if(j0<23) {
-	    if(j0<0) { 	/* raise inexact if x != 0 */
-		if(huge+x>(float)0.0) {/* return 0*sign(x) if |x|<1 */
-		    if(i0>=0) {i0=0;}
-		    else if((i0&0x7fffffff)!=0)
-			{ i0=0xbf800000;}
-		}
-	    } else {
-		i = (0x007fffff)>>j0;
-		if((i0&i)==0) return x; /* x is integral */
-		if(huge+x>(float)0.0) {	/* raise inexact flag */
-		    if(i0<0) i0 += (0x00800000)>>j0;
-		    i0 &= (~i);
-		}
-	    }
-	} else {
-	    if(j0==0x80) return x+x;	/* inf or NaN */
-	    else return x;		/* x is integral */
-	}
-	SET_FLOAT_WORD(x,i0);
-	return x;
-}
-weak_alias (__floorf, floorf)




More information about the uClibc-cvs mailing list