about summary refs log tree commit diff
path: root/math/w_hypotf.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 /math/w_hypotf.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 'math/w_hypotf.c')
-rw-r--r--math/w_hypotf.c31
1 files changed, 9 insertions, 22 deletions
diff --git a/math/w_hypotf.c b/math/w_hypotf.c
index e1f074f75e..6042b8802d 100644
--- a/math/w_hypotf.c
+++ b/math/w_hypotf.c
@@ -8,15 +8,11 @@
  *
  * 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: w_hypotf.c,v 1.3 1995/05/10 20:49:09 jtc Exp $";
-#endif
-
 /*
  * wrapper hypotf(x,y)
  */
@@ -25,24 +21,15 @@ static char rcsid[] = "$NetBSD: w_hypotf.c,v 1.3 1995/05/10 20:49:09 jtc Exp $";
 #include <math_private.h>
 
 
-#ifdef __STDC__
-	float __hypotf(float x, float y)	/* wrapper hypotf */
-#else
-	float __hypotf(x,y)		/* wrapper hypotf */
-	float x,y;
-#endif
+float
+__hypotf(float x, float y)
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_hypotf(x,y);
-#else
-	float z;
-	z = __ieee754_hypotf(x,y);
-	if(_LIB_VERSION == _IEEE_) return z;
-	if((!__finitef(z))&&__finitef(x)&&__finitef(y))
+	float z = __ieee754_hypotf(x,y);
+	if(__builtin_expect(!__finitef(z), 0)
+	   && __finitef(x) && __finitef(y) && _LIB_VERSION != _IEEE_)
 	    /* hypot overflow */
-	    return (float)__kernel_standard((double)x,(double)y,104);
-	else
-	    return z;
-#endif
+	    return __kernel_standard_f(x, y, 104);
+
+	return z;
 }
 weak_alias (__hypotf, hypotf)