about summary refs log tree commit diff
path: root/sysdeps/ieee754/flt-32/s_modff.c
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/flt-32/s_modff.c
parente58ef0f20437e121a06e0eb3d6c6c10c3630746e (diff)
downloadglibc-daa891c0e8900d0f03c16fde9c09f8d6f9a26a7d.tar.gz
glibc-daa891c0e8900d0f03c16fde9c09f8d6f9a26a7d.tar.xz
glibc-daa891c0e8900d0f03c16fde9c09f8d6f9a26a7d.zip
Optimize s_modf
Diffstat (limited to 'sysdeps/ieee754/flt-32/s_modff.c')
-rw-r--r--sysdeps/ieee754/flt-32/s_modff.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/sysdeps/ieee754/flt-32/s_modff.c b/sysdeps/ieee754/flt-32/s_modff.c
index e6c22b2add..741b1c9b16 100644
--- a/sysdeps/ieee754/flt-32/s_modff.c
+++ b/sysdeps/ieee754/flt-32/s_modff.c
@@ -13,33 +13,21 @@
  * ====================================================
  */
 
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: s_modff.c,v 1.4 1995/05/10 20:47:56 jtc Exp $";
-#endif
-
 #include "math.h"
 #include "math_private.h"
 
-#ifdef __STDC__
 static const float one = 1.0;
-#else
-static float one = 1.0;
-#endif
 
-#ifdef __STDC__
-	float __modff(float x, float *iptr)
-#else
-	float __modff(x, iptr)
-	float x,*iptr;
-#endif
+float
+__modff(float x, float *iptr)
 {
 	int32_t i0,j0;
 	u_int32_t i;
 	GET_FLOAT_WORD(i0,x);
 	j0 = ((i0>>23)&0xff)-0x7f;	/* exponent of x */
-	if(j0<23) {			/* integer part in x */
+	if(__builtin_expect(j0<23, 1)) {		/* integer part in x */
 	    if(j0<0) {			/* |x|<1 */
-	        SET_FLOAT_WORD(*iptr,i0&0x80000000);	/* *iptr = +-0 */
+		SET_FLOAT_WORD(*iptr,i0&0x80000000);	/* *iptr = +-0 */
 		return x;
 	    } else {
 		i = (0x007fffff)>>j0;