about summary refs log tree commit diff
path: root/sysdeps/ieee754/ldbl-96/e_hypotl.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/ldbl-96/e_hypotl.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/ldbl-96/e_hypotl.c')
-rw-r--r--sysdeps/ieee754/ldbl-96/e_hypotl.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/sysdeps/ieee754/ldbl-96/e_hypotl.c b/sysdeps/ieee754/ldbl-96/e_hypotl.c
index 1a40c556dc..a59320b067 100644
--- a/sysdeps/ieee754/ldbl-96/e_hypotl.c
+++ b/sysdeps/ieee754/ldbl-96/e_hypotl.c
@@ -14,10 +14,6 @@
  * ====================================================
  */
 
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
-
 /* __ieee754_hypotl(x,y)
  *
  * Method :
@@ -46,8 +42,8 @@ static char rcsid[] = "$NetBSD: $";
  *	hypot(x,y) is NAN if x or y is NAN.
  *
  * Accuracy:
- * 	hypot(x,y) returns sqrt(x^2+y^2) with error less
- * 	than 1 ulps (units in the last place)
+ *	hypot(x,y) returns sqrt(x^2+y^2) with error less
+ *	than 1 ulps (units in the last place)
  */
 
 #include "math.h"
@@ -72,7 +68,7 @@ static char rcsid[] = "$NetBSD: $";
 	SET_LDOUBLE_EXP(b,eb);	/* b <- |b| */
 	if((ea-eb)>0x46) {return a+b;} /* x/y > 2**70 */
 	k=0;
-	if(ea > 0x5f3f) {	/* a>2**8000 */
+	if(__builtin_expect(ea > 0x5f3f,0)) {	/* a>2**8000 */
 	   if(ea == 0x7fff) {	/* Inf or NaN */
 	       u_int32_t exp,high,low;
 	       w = a+b;			/* for sNaN */
@@ -87,9 +83,9 @@ static char rcsid[] = "$NetBSD: $";
 	   SET_LDOUBLE_EXP(a,ea);
 	   SET_LDOUBLE_EXP(b,eb);
 	}
-	if(eb < 0x20bf) {	/* b < 2**-8000 */
+	if(__builtin_expect(eb < 0x20bf, 0)) {	/* b < 2**-8000 */
 	    if(eb == 0) {	/* subnormal b or 0 */
-	        u_int32_t exp,high,low;
+		u_int32_t exp,high,low;
 		GET_LDOUBLE_WORDS(exp,high,low,b);
 		if((high|low)==0) return a;
 		SET_LDOUBLE_WORDS(t1, 0x7ffd, 0, 0);	/* t1=2^16382 */
@@ -97,7 +93,7 @@ static char rcsid[] = "$NetBSD: $";
 		a *= t1;
 		k -= 16382;
 	    } else {		/* scale a and b by 2^9600 */
-	        ea += 0x2580; 	/* a *= 2^9600 */
+		ea += 0x2580;	/* a *= 2^9600 */
 		eb += 0x2580;	/* b *= 2^9600 */
 		k -= 9600;
 		SET_LDOUBLE_EXP(a,ea);
@@ -131,3 +127,4 @@ static char rcsid[] = "$NetBSD: $";
 	    return t1*w;
 	} else return w;
 }
+strong_alias (__ieee754_hypotl, __hypotl_finite)