summary refs log tree commit diff
path: root/sysdeps/ieee754/flt-32/e_fmodf.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-10-12 11:27:51 -0400
committerUlrich Drepper <drepper@gmail.com>2011-10-12 11:27:51 -0400
commit0ac5ae2335292908f39031b1ea9fe8edce433c0f (patch)
treef9d26c8abc0de39d18d4c13e70f6022cdc6b461f /sysdeps/ieee754/flt-32/e_fmodf.c
parenta843a204a3e8a0dd53584dad3668771abaec84ac (diff)
downloadglibc-0ac5ae2335292908f39031b1ea9fe8edce433c0f.tar.gz
glibc-0ac5ae2335292908f39031b1ea9fe8edce433c0f.tar.xz
glibc-0ac5ae2335292908f39031b1ea9fe8edce433c0f.zip
Optimize libm
libm is now somewhat integrated with gcc's -ffinite-math-only option
and lots of the wrapper functions have been optimized.
Diffstat (limited to 'sysdeps/ieee754/flt-32/e_fmodf.c')
-rw-r--r--sysdeps/ieee754/flt-32/e_fmodf.c33
1 files changed, 11 insertions, 22 deletions
diff --git a/sysdeps/ieee754/flt-32/e_fmodf.c b/sysdeps/ieee754/flt-32/e_fmodf.c
index 47b312392c..e82a9ceab7 100644
--- a/sysdeps/ieee754/flt-32/e_fmodf.c
+++ b/sysdeps/ieee754/flt-32/e_fmodf.c
@@ -8,16 +8,12 @@
  *
  * Developed at SunPro, a Sun Microsystems, Inc. business.
  * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice 
+ * software is freely granted, provided that this notice
  * is preserved.
  * ====================================================
  */
 
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: e_fmodf.c,v 1.4 1995/05/10 20:45:10 jtc Exp $";
-#endif
-
-/* 
+/*
  * __ieee754_fmodf(x,y)
  * Return x mod y in exact arithmetic
  * Method: shift and subtract
@@ -26,18 +22,10 @@ static char rcsid[] = "$NetBSD: e_fmodf.c,v 1.4 1995/05/10 20:45:10 jtc Exp $";
 #include "math.h"
 #include "math_private.h"
 
-#ifdef __STDC__
 static const float one = 1.0, Zero[] = {0.0, -0.0,};
-#else
-static float one = 1.0, Zero[] = {0.0, -0.0,};
-#endif
 
-#ifdef __STDC__
-	float __ieee754_fmodf(float x, float y)
-#else
-	float __ieee754_fmodf(x,y)
-	float x,y ;
-#endif
+float
+__ieee754_fmodf (float x, float y)
 {
 	int32_t n,hx,hy,hz,ix,iy,sx,i;
 
@@ -66,13 +54,13 @@ static float one = 1.0, Zero[] = {0.0, -0.0,};
 	} else iy = (hy>>23)-127;
 
     /* set up {hx,lx}, {hy,ly} and align y to x */
-	if(ix >= -126) 
+	if(ix >= -126)
 	    hx = 0x00800000|(0x007fffff&hx);
 	else {		/* subnormal x, shift x to normal */
 	    n = -126-ix;
 	    hx = hx<<n;
 	}
-	if(iy >= -126) 
+	if(iy >= -126)
 	    hy = 0x00800000|(0x007fffff&hy);
 	else {		/* subnormal y, shift y to normal */
 	    n = -126-iy;
@@ -85,17 +73,17 @@ static float one = 1.0, Zero[] = {0.0, -0.0,};
 	    hz=hx-hy;
 	    if(hz<0){hx = hx+hx;}
 	    else {
-	    	if(hz==0) 		/* return sign(x)*0 */
+		if(hz==0)		/* return sign(x)*0 */
 		    return Zero[(u_int32_t)sx>>31];
-	    	hx = hz+hz;
+		hx = hz+hz;
 	    }
 	}
 	hz=hx-hy;
 	if(hz>=0) {hx=hz;}
 
     /* convert back to floating value and restore the sign */
-	if(hx==0) 			/* return sign(x)*0 */
-	    return Zero[(u_int32_t)sx>>31];	
+	if(hx==0)			/* return sign(x)*0 */
+	    return Zero[(u_int32_t)sx>>31];
 	while(hx<0x00800000) {		/* normalize x */
 	    hx = hx+hx;
 	    iy -= 1;
@@ -111,3 +99,4 @@ static float one = 1.0, Zero[] = {0.0, -0.0,};
 	}
 	return x;		/* exact output */
 }
+strong_alias (__ieee754_fmodf, __fmodf_finite)