about summary refs log tree commit diff
path: root/sysdeps/ieee754/ldbl-96
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2012-01-10 22:26:22 -0500
committerUlrich Drepper <drepper@gmail.com>2012-01-10 22:26:22 -0500
commitdaa891c0e8900d0f03c16fde9c09f8d6f9a26a7d (patch)
tree3b1bf170ebd79ce294d3a09e2c71d133f4bcdd73 /sysdeps/ieee754/ldbl-96
parente58ef0f20437e121a06e0eb3d6c6c10c3630746e (diff)
downloadglibc-daa891c0e8900d0f03c16fde9c09f8d6f9a26a7d.tar.gz
glibc-daa891c0e8900d0f03c16fde9c09f8d6f9a26a7d.tar.xz
glibc-daa891c0e8900d0f03c16fde9c09f8d6f9a26a7d.zip
Optimize s_modf
Diffstat (limited to 'sysdeps/ieee754/ldbl-96')
-rw-r--r--sysdeps/ieee754/ldbl-96/s_modfl.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/sysdeps/ieee754/ldbl-96/s_modfl.c b/sysdeps/ieee754/ldbl-96/s_modfl.c
index 99c0752efa..c7659119f3 100644
--- a/sysdeps/ieee754/ldbl-96/s_modfl.c
+++ b/sysdeps/ieee754/ldbl-96/s_modfl.c
@@ -14,10 +14,6 @@
  * ====================================================
  */
 
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
-
 /*
  * modfl(long double x, long double *iptr)
  * return fraction part of x, and return x's integral part in *iptr.
@@ -31,18 +27,10 @@ static char rcsid[] = "$NetBSD: $";
 #include "math.h"
 #include "math_private.h"
 
-#ifdef __STDC__
 static const long double one = 1.0;
-#else
-static long double one = 1.0;
-#endif
 
-#ifdef __STDC__
-	long double __modfl(long double x, long double *iptr)
-#else
-	long double __modfl(x, iptr)
-	long double x,*iptr;
-#endif
+long double
+__modfl(long double x, long double *iptr)
 {
 	int32_t i0,i1,j0;
 	u_int32_t i,se;
@@ -50,7 +38,7 @@ static long double one = 1.0;
 	j0 = (se&0x7fff)-0x3fff;	/* exponent of x */
 	if(j0<32) {			/* integer part in high x */
 	    if(j0<0) {			/* |x|<1 */
-	        SET_LDOUBLE_WORDS(*iptr,se&0x8000,0,0);	/* *iptr = +-0 */
+		SET_LDOUBLE_WORDS(*iptr,se&0x8000,0,0);	/* *iptr = +-0 */
 		return x;
 	    } else {
 		i = (0x7fffffff)>>j0;
@@ -63,7 +51,7 @@ static long double one = 1.0;
 		    return x - *iptr;
 		}
 	    }
-	} else if (j0>63) {		/* no fraction part */
+	} else if (__builtin_expect(j0>63, 0)) { /* no fraction part */
 	    *iptr = x*one;
 	    /* We must handle NaNs separately.  */
 	    if (j0 == 0x4000 && ((i0 & 0x7fffffff) | i1))