This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch, release/2.15/master, updated. glibc-2.15-17-gc444059


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, release/2.15/master has been updated
       via  c4440594575b59affb2f6e56059d145405fc5b7d (commit)
       via  228abdc27750245b0c7d80a4db6cf66621e657f9 (commit)
       via  e02cc8de8c21f26e58c8463cdb4caf0d8cbbc6a5 (commit)
       via  21902de70da58fa02f2a2a0ce583263170203332 (commit)
      from  b657f1c5583edc7205604bacc657b5cea47e99fc (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=c4440594575b59affb2f6e56059d145405fc5b7d

commit c4440594575b59affb2f6e56059d145405fc5b7d
Author: David S. Miller <davem@davemloft.net>
Date:   Mon Feb 27 14:51:45 2012 -0800

    Fix ldbl-128 rintl/nearbyintl just like flt-32 variants.
    
    	* sysdeps/ieee754/ldbl-128/s_nearbyintl.c (__nearbyintl): Do not
    	manipulate bits before adding and subtracting TWO112[sx].
    	* sysdeps/ieee754/ldbl-128/s_rintl.c (__rintl): Likewise.
    
    (cherry-picked from commit a78bc6549cfedeea0828b718aca00593d8164c2b)

diff --git a/ChangeLog b/ChangeLog
index 86b074b..73e2fd7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-02-27  David S. Miller  <davem@davemloft.net>
+
+	* sysdeps/ieee754/ldbl-128/s_nearbyintl.c (__nearbyintl): Do not
+	manipulate bits before adding and subtracting TWO112[sx].
+	* sysdeps/ieee754/ldbl-128/s_rintl.c (__rintl): Likewise.
+
 2012-02-22  Joseph Myers  <joseph@codesourcery.com>
 
 	[BZ #2547]
diff --git a/NEWS b/NEWS
index a342ba8..82e2b2c 100644
--- a/NEWS
+++ b/NEWS
@@ -9,7 +9,7 @@ Version 2.15.1
 
 * The following bugs are resolved with this release:
 
-  411, 2547, 2548, 11365, 13731, 13732, 13748
+  411, 2547, 2548, 11365, 13731, 13732, 13733, 13748
 
 Version 2.15
 
diff --git a/sysdeps/ieee754/ldbl-128/s_nearbyintl.c b/sysdeps/ieee754/ldbl-128/s_nearbyintl.c
index bea3183..0019abc 100644
--- a/sysdeps/ieee754/ldbl-128/s_nearbyintl.c
+++ b/sysdeps/ieee754/ldbl-128/s_nearbyintl.c
@@ -46,18 +46,13 @@ TWO112[2]={
 {
 	fenv_t env;
 	int64_t i0,j0,sx;
-	u_int64_t i,i1;
+	u_int64_t i1;
 	long double w,t;
 	GET_LDOUBLE_WORDS64(i0,i1,x);
 	sx = (((u_int64_t)i0)>>63);
 	j0 = ((i0>>48)&0x7fff)-0x3fff;
-	if(j0<48) {
+	if(j0<112) {
 	    if(j0<0) {
-		if(((i0&0x7fffffffffffffffLL)|i1)==0) return x;
-		i1 |= (i0&0x0000ffffffffffffLL);
-		i0 &= 0xffffe00000000000ULL;
-		i0 |= ((i1|-i1)>>16)&0x0000800000000000LL;
-		SET_LDOUBLE_MSW64(x,i0);
 		feholdexcept (&env);
 	        w = TWO112[sx]+x;
 	        t = w-TWO112[sx];
@@ -65,25 +60,11 @@ TWO112[2]={
 		GET_LDOUBLE_MSW64(i0,t);
 		SET_LDOUBLE_MSW64(t,(i0&0x7fffffffffffffffLL)|(sx<<63));
 	        return t;
-	    } else {
-		i = (0x0000ffffffffffffLL)>>j0;
-		if(((i0&i)|i1)==0) return x; /* x is integral */
-		i>>=1;
-		if(((i0&i)|i1)!=0) {
-		    if(j0==47) i1 = 0x4000000000000000ULL; else
-		    i0 = (i0&(~i))|((0x0000200000000000LL)>>j0);
-		}
 	    }
-	} else if (j0>111) {
+	} else {
 	    if(j0==0x4000) return x+x;	/* inf or NaN */
 	    else return x;		/* x is integral */
-	} else {
-	    i = -1ULL>>(j0-48);
-	    if((i1&i)==0) return x;	/* x is integral */
-	    i>>=1;
-	    if((i1&i)!=0) i1 = (i1&(~i))|((0x4000000000000000LL)>>(j0-48));
 	}
-	SET_LDOUBLE_WORDS64(x,i0,i1);
 	feholdexcept (&env);
 	w = TWO112[sx]+x;
 	t = w-TWO112[sx];
diff --git a/sysdeps/ieee754/ldbl-128/s_rintl.c b/sysdeps/ieee754/ldbl-128/s_rintl.c
index c3fc3ba..163897f 100644
--- a/sysdeps/ieee754/ldbl-128/s_rintl.c
+++ b/sysdeps/ieee754/ldbl-128/s_rintl.c
@@ -48,42 +48,23 @@ TWO112[2]={
 #endif
 {
 	int64_t i0,j0,sx;
-	u_int64_t i,i1;
+	u_int64_t i1;
 	long double w,t;
 	GET_LDOUBLE_WORDS64(i0,i1,x);
 	sx = (((u_int64_t)i0)>>63);
 	j0 = ((i0>>48)&0x7fff)-0x3fff;
-	if(j0<48) {
+	if(j0<112) {
 	    if(j0<0) {
-		if(((i0&0x7fffffffffffffffLL)|i1)==0) return x;
-		i1 |= (i0&0x0000ffffffffffffLL);
-		i0 &= 0xffffe00000000000ULL;
-		i0 |= ((i1|-i1)>>16)&0x0000800000000000LL;
-		SET_LDOUBLE_MSW64(x,i0);
 	        w = TWO112[sx]+x;
 	        t = w-TWO112[sx];
 		GET_LDOUBLE_MSW64(i0,t);
 		SET_LDOUBLE_MSW64(t,(i0&0x7fffffffffffffffLL)|(sx<<63));
 	        return t;
-	    } else {
-		i = (0x0000ffffffffffffLL)>>j0;
-		if(((i0&i)|i1)==0) return x; /* x is integral */
-		i>>=1;
-		if(((i0&i)|i1)!=0) {
-		    if(j0==47) i1 = 0x4000000000000000ULL; else
-		    i0 = (i0&(~i))|((0x0000200000000000LL)>>j0);
-		}
 	    }
-	} else if (j0>111) {
+	} else {
 	    if(j0==0x4000) return x+x;	/* inf or NaN */
 	    else return x;		/* x is integral */
-	} else {
-	    i = -1ULL>>(j0-48);
-	    if((i1&i)==0) return x;	/* x is integral */
-	    i>>=1;
-	    if((i1&i)!=0) i1 = (i1&(~i))|((0x4000000000000000LL)>>(j0-48));
 	}
-	SET_LDOUBLE_WORDS64(x,i0,i1);
 	w = TWO112[sx]+x;
 	return w-TWO112[sx];
 }

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=228abdc27750245b0c7d80a4db6cf66621e657f9

commit 228abdc27750245b0c7d80a4db6cf66621e657f9
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Feb 22 13:01:20 2012 +0000

    Fix rintf rounding.
    
    (cherry-picked from commit fe45ce09f366f2260aef528d37ae35070b3a2a36)

diff --git a/ChangeLog b/ChangeLog
index fea7772..86b074b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,17 @@
 	manipulate bits before adding and subtracting TWO23[sx].
 	* math/libm-test.inc (nearbyint_test): Add more tests.
 
+2012-02-22  Joseph Myers  <joseph@codesourcery.com>
+
+	[BZ #2548]
+	* sysdeps/ieee754/flt-32/s_rintf.c (__rintf): Do not manipulate
+	bits before adding and subtracting TWO23[sx].
+	* math/libm-test.inc (rint_test): Add more tests.
+	(rint_test_tonearest): Likewise.
+	(rint_test_towardzero): Likewise.
+	(rint_test_downward): Likewise.
+	(rint_test_upward: Likewise.
+
 2012-02-21  David S. Miller  <davem@davemloft.net>
 
 	* sysdeps/sparc/sparc32/fpu/libm-test-ulps: More jn test ULP updates.
diff --git a/NEWS b/NEWS
index 2b097a3..a342ba8 100644
--- a/NEWS
+++ b/NEWS
@@ -9,7 +9,7 @@ Version 2.15.1
 
 * The following bugs are resolved with this release:
 
-  411, 2547, 11365, 13731, 13732, 13748
+  411, 2547, 2548, 11365, 13731, 13732, 13748
 
 Version 2.15
 
diff --git a/math/libm-test.inc b/math/libm-test.inc
index 025a8ea..475857d 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -5061,6 +5061,22 @@ rint_test (void)
   TEST_f_f (rint, 262142.75, 262143.0);
   TEST_f_f (rint, 524286.75, 524287.0);
   TEST_f_f (rint, 524288.75, 524289.0);
+  TEST_f_f (rint, 1048576.75, 1048577.0);
+  TEST_f_f (rint, 2097152.75, 2097153.0);
+  TEST_f_f (rint, -1048576.75, -1048577.0);
+  TEST_f_f (rint, -2097152.75, -2097153.0);
+#ifndef TEST_FLOAT
+  TEST_f_f (rint, 70368744177664.75, 70368744177665.0);
+  TEST_f_f (rint, 140737488355328.75, 140737488355329.0);
+  TEST_f_f (rint, 281474976710656.75, 281474976710657.0);
+  TEST_f_f (rint, 562949953421312.75, 562949953421313.0);
+  TEST_f_f (rint, 1125899906842624.75, 1125899906842625.0);
+  TEST_f_f (rint, -70368744177664.75, -70368744177665.0);
+  TEST_f_f (rint, -140737488355328.75, -140737488355329.0);
+  TEST_f_f (rint, -281474976710656.75, -281474976710657.0);
+  TEST_f_f (rint, -562949953421312.75, -562949953421313.0);
+  TEST_f_f (rint, -1125899906842624.75, -1125899906842625.0);
+#endif
 #ifdef TEST_LDOUBLE
   /* The result can only be represented in long double.  */
   TEST_f_f (rint, 4503599627370495.5L, 4503599627370496.0L);
@@ -5161,6 +5177,22 @@ rint_test_tonearest (void)
       TEST_f_f (rint, -0.1, -0.0);
       TEST_f_f (rint, -0.25, -0.0);
       TEST_f_f (rint, -0.625, -1.0);
+      TEST_f_f (rint, 1048576.75, 1048577.0);
+      TEST_f_f (rint, 2097152.75, 2097153.0);
+      TEST_f_f (rint, -1048576.75, -1048577.0);
+      TEST_f_f (rint, -2097152.75, -2097153.0);
+#ifndef TEST_FLOAT
+      TEST_f_f (rint, 70368744177664.75, 70368744177665.0);
+      TEST_f_f (rint, 140737488355328.75, 140737488355329.0);
+      TEST_f_f (rint, 281474976710656.75, 281474976710657.0);
+      TEST_f_f (rint, 562949953421312.75, 562949953421313.0);
+      TEST_f_f (rint, 1125899906842624.75, 1125899906842625.0);
+      TEST_f_f (rint, -70368744177664.75, -70368744177665.0);
+      TEST_f_f (rint, -140737488355328.75, -140737488355329.0);
+      TEST_f_f (rint, -281474976710656.75, -281474976710657.0);
+      TEST_f_f (rint, -562949953421312.75, -562949953421313.0);
+      TEST_f_f (rint, -1125899906842624.75, -1125899906842625.0);
+#endif
 #ifdef TEST_LDOUBLE
       /* The result can only be represented in long double.  */
       TEST_f_f (rint, 4503599627370495.5L, 4503599627370496.0L);
@@ -5231,6 +5263,22 @@ rint_test_towardzero (void)
       TEST_f_f (rint, -0.1, -0.0);
       TEST_f_f (rint, -0.25, -0.0);
       TEST_f_f (rint, -0.625, -0.0);
+      TEST_f_f (rint, 1048576.75, 1048576.0);
+      TEST_f_f (rint, 2097152.75, 2097152.0);
+      TEST_f_f (rint, -1048576.75, -1048576.0);
+      TEST_f_f (rint, -2097152.75, -2097152.0);
+#ifndef TEST_FLOAT
+      TEST_f_f (rint, 70368744177664.75, 70368744177664.0);
+      TEST_f_f (rint, 140737488355328.75, 140737488355328.0);
+      TEST_f_f (rint, 281474976710656.75, 281474976710656.0);
+      TEST_f_f (rint, 562949953421312.75, 562949953421312.0);
+      TEST_f_f (rint, 1125899906842624.75, 1125899906842624.0);
+      TEST_f_f (rint, -70368744177664.75, -70368744177664.0);
+      TEST_f_f (rint, -140737488355328.75, -140737488355328.0);
+      TEST_f_f (rint, -281474976710656.75, -281474976710656.0);
+      TEST_f_f (rint, -562949953421312.75, -562949953421312.0);
+      TEST_f_f (rint, -1125899906842624.75, -1125899906842624.0);
+#endif
 #ifdef TEST_LDOUBLE
       /* The result can only be represented in long double.  */
       TEST_f_f (rint, 4503599627370495.5L, 4503599627370495.0L);
@@ -5301,6 +5349,22 @@ rint_test_downward (void)
       TEST_f_f (rint, -0.1, -1.0);
       TEST_f_f (rint, -0.25, -1.0);
       TEST_f_f (rint, -0.625, -1.0);
+      TEST_f_f (rint, 1048576.75, 1048576.0);
+      TEST_f_f (rint, 2097152.75, 2097152.0);
+      TEST_f_f (rint, -1048576.75, -1048577.0);
+      TEST_f_f (rint, -2097152.75, -2097153.0);
+#ifndef TEST_FLOAT
+      TEST_f_f (rint, 70368744177664.75, 70368744177664.0);
+      TEST_f_f (rint, 140737488355328.75, 140737488355328.0);
+      TEST_f_f (rint, 281474976710656.75, 281474976710656.0);
+      TEST_f_f (rint, 562949953421312.75, 562949953421312.0);
+      TEST_f_f (rint, 1125899906842624.75, 1125899906842624.0);
+      TEST_f_f (rint, -70368744177664.75, -70368744177665.0);
+      TEST_f_f (rint, -140737488355328.75, -140737488355329.0);
+      TEST_f_f (rint, -281474976710656.75, -281474976710657.0);
+      TEST_f_f (rint, -562949953421312.75, -562949953421313.0);
+      TEST_f_f (rint, -1125899906842624.75, -1125899906842625.0);
+#endif
 #ifdef TEST_LDOUBLE
       /* The result can only be represented in long double.  */
       TEST_f_f (rint, 4503599627370495.5L, 4503599627370495.0L);
@@ -5371,6 +5435,22 @@ rint_test_upward (void)
       TEST_f_f (rint, -0.1, -0.0);
       TEST_f_f (rint, -0.25, -0.0);
       TEST_f_f (rint, -0.625, -0.0);
+      TEST_f_f (rint, 1048576.75, 1048577.0);
+      TEST_f_f (rint, 2097152.75, 2097153.0);
+      TEST_f_f (rint, -1048576.75, -1048576.0);
+      TEST_f_f (rint, -2097152.75, -2097152.0);
+#ifndef TEST_FLOAT
+      TEST_f_f (rint, 70368744177664.75, 70368744177665.0);
+      TEST_f_f (rint, 140737488355328.75, 140737488355329.0);
+      TEST_f_f (rint, 281474976710656.75, 281474976710657.0);
+      TEST_f_f (rint, 562949953421312.75, 562949953421313.0);
+      TEST_f_f (rint, 1125899906842624.75, 1125899906842625.0);
+      TEST_f_f (rint, -70368744177664.75, -70368744177664.0);
+      TEST_f_f (rint, -140737488355328.75, -140737488355328.0);
+      TEST_f_f (rint, -281474976710656.75, -281474976710656.0);
+      TEST_f_f (rint, -562949953421312.75, -562949953421312.0);
+      TEST_f_f (rint, -1125899906842624.75, -1125899906842624.0);
+#endif
 #ifdef TEST_LDOUBLE
       /* The result can only be represented in long double.  */
       TEST_f_f (rint, 4503599627370495.5L, 4503599627370496.0L);
diff --git a/sysdeps/ieee754/flt-32/s_rintf.c b/sysdeps/ieee754/flt-32/s_rintf.c
index 9ea9b6f..9ba6b57 100644
--- a/sysdeps/ieee754/flt-32/s_rintf.c
+++ b/sysdeps/ieee754/flt-32/s_rintf.c
@@ -26,34 +26,22 @@ float
 __rintf(float x)
 {
 	int32_t i0,j0,sx;
-	u_int32_t i,i1;
 	float w,t;
 	GET_FLOAT_WORD(i0,x);
 	sx = (i0>>31)&1;
 	j0 = ((i0>>23)&0xff)-0x7f;
 	if(j0<23) {
 	    if(j0<0) {
-		if((i0&0x7fffffff)==0) return x;
-		i1 = (i0&0x07fffff);
-		i0 &= 0xfff00000;
-		i0 |= ((i1|-i1)>>9)&0x400000;
-		SET_FLOAT_WORD(x,i0);
 		w = TWO23[sx]+x;
 		t =  w-TWO23[sx];
 		GET_FLOAT_WORD(i0,t);
 		SET_FLOAT_WORD(t,(i0&0x7fffffff)|(sx<<31));
 		return t;
-	    } else {
-		i = (0x007fffff)>>j0;
-		if((i0&i)==0) return x; /* x is integral */
-		i>>=1;
-		if((i0&i)!=0) i0 = (i0&(~i))|((0x100000)>>j0);
 	    }
 	} else {
 	    if(j0==0x80) return x+x;	/* inf or NaN */
 	    else return x;		/* x is integral */
 	}
-	SET_FLOAT_WORD(x,i0);
 	w = TWO23[sx]+x;
 	return w-TWO23[sx];
 }

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e02cc8de8c21f26e58c8463cdb4caf0d8cbbc6a5

commit e02cc8de8c21f26e58c8463cdb4caf0d8cbbc6a5
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Feb 22 13:03:40 2012 +0000

    Fix nearbyintf rounding.
    
    (cherry-picked from commit 6cbeae4719aeb3edb6143fe5dd6d2a5ab45c0248)

diff --git a/ChangeLog b/ChangeLog
index 6d01b56..fea7772 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2012-02-22  Joseph Myers  <joseph@codesourcery.com>
+
+	[BZ #2547]
+	[BZ #11365]
+	* sysdeps/ieee754/flt-32/s_nearbyintf.c (__nearbyintf): Do not
+	manipulate bits before adding and subtracting TWO23[sx].
+	* math/libm-test.inc (nearbyint_test): Add more tests.
+
 2012-02-21  David S. Miller  <davem@davemloft.net>
 
 	* sysdeps/sparc/sparc32/fpu/libm-test-ulps: More jn test ULP updates.
diff --git a/NEWS b/NEWS
index b92705d..2b097a3 100644
--- a/NEWS
+++ b/NEWS
@@ -9,7 +9,7 @@ Version 2.15.1
 
 * The following bugs are resolved with this release:
 
-  411, 13731, 13732, 13748
+  411, 2547, 11365, 13731, 13732, 13748
 
 Version 2.15
 
diff --git a/math/libm-test.inc b/math/libm-test.inc
index 2c739fa..025a8ea 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -4633,6 +4633,29 @@ nearbyint_test (void)
   TEST_f_f (nearbyint, 524286.75, 524287.0);
   TEST_f_f (nearbyint, 524288.75, 524289.0);
 
+  TEST_f_f (nearbyint, 1048576.75, 1048577.0);
+  TEST_f_f (nearbyint, 2097152.75, 2097153.0);
+  TEST_f_f (nearbyint, 2492472.75, 2492473.0);
+  TEST_f_f (nearbyint, 2886220.75, 2886221.0);
+  TEST_f_f (nearbyint, 3058792.75, 3058793.0);
+  TEST_f_f (nearbyint, -1048576.75, -1048577.0);
+  TEST_f_f (nearbyint, -2097152.75, -2097153.0);
+  TEST_f_f (nearbyint, -2492472.75, -2492473.0);
+  TEST_f_f (nearbyint, -2886220.75, -2886221.0);
+  TEST_f_f (nearbyint, -3058792.75, -3058793.0);
+#ifndef TEST_FLOAT
+  TEST_f_f (nearbyint, 70368744177664.75, 70368744177665.0);
+  TEST_f_f (nearbyint, 140737488355328.75, 140737488355329.0);
+  TEST_f_f (nearbyint, 281474976710656.75, 281474976710657.0);
+  TEST_f_f (nearbyint, 562949953421312.75, 562949953421313.0);
+  TEST_f_f (nearbyint, 1125899906842624.75, 1125899906842625.0);
+  TEST_f_f (nearbyint, -70368744177664.75, -70368744177665.0);
+  TEST_f_f (nearbyint, -140737488355328.75, -140737488355329.0);
+  TEST_f_f (nearbyint, -281474976710656.75, -281474976710657.0);
+  TEST_f_f (nearbyint, -562949953421312.75, -562949953421313.0);
+  TEST_f_f (nearbyint, -1125899906842624.75, -1125899906842625.0);
+#endif
+
   END (nearbyint);
 }
 
diff --git a/sysdeps/ieee754/flt-32/s_nearbyintf.c b/sysdeps/ieee754/flt-32/s_nearbyintf.c
index 04ef9ab..a6d602b 100644
--- a/sysdeps/ieee754/flt-32/s_nearbyintf.c
+++ b/sysdeps/ieee754/flt-32/s_nearbyintf.c
@@ -30,18 +30,12 @@ __nearbyintf(float x)
 {
 	fenv_t env;
 	int32_t i0,j0,sx;
-	u_int32_t i,i1;
 	float w,t;
 	GET_FLOAT_WORD(i0,x);
 	sx = (i0>>31)&1;
 	j0 = ((i0>>23)&0xff)-0x7f;
 	if(j0<23) {
 	    if(j0<0) {
-		if((i0&0x7fffffff)==0) return x;
-		i1 = (i0&0x07fffff);
-		i0 &= 0xfff00000;
-		i0 |= ((i1|-i1)>>9)&0x400000;
-		SET_FLOAT_WORD(x,i0);
 		libc_feholdexceptf (&env);
 		w = TWO23[sx]+x;
 		t =  w-TWO23[sx];
@@ -49,17 +43,11 @@ __nearbyintf(float x)
 		GET_FLOAT_WORD(i0,t);
 		SET_FLOAT_WORD(t,(i0&0x7fffffff)|(sx<<31));
 		return t;
-	    } else {
-		i = (0x007fffff)>>j0;
-		if((i0&i)==0) return x; /* x is integral */
-		i>>=1;
-		if((i0&i)!=0) i0 = (i0&(~i))|((0x100000)>>j0);
 	    }
 	} else {
 	    if(__builtin_expect(j0==0x80, 0)) return x+x;	/* inf or NaN */
 	    else return x;		/* x is integral */
 	}
-	SET_FLOAT_WORD(x,i0);
 	libc_feholdexceptf (&env);
 	w = TWO23[sx]+x;
 	t = w-TWO23[sx];

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=21902de70da58fa02f2a2a0ce583263170203332

commit 21902de70da58fa02f2a2a0ce583263170203332
Author: Aurelien Jarno <aurelien@aurel32.net>
Date:   Sun Feb 19 11:20:18 2012 +0100

    Use non-signaling floating-point comparisons in math functions.
    
    (cherry-picked from commit 92221550d72bafcd322ac5ab2a951054184b7f1a)

diff --git a/ChangeLog b/ChangeLog
index 0b9a6e5..6d01b56 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,49 @@
 	* sysdeps/sparc/sparc32/fpu/libm-test-ulps: More jn test ULP updates.
 	* sysdeps/sparc/sparc64/fpu/libm-test-ulps: Likewise.
 
+2012-02-19  Aurelien Jarno  <aurelien@aurel32.net>
+
+	* math/w_acos.c: Use non-signaling floating-point comparisons.
+	* math/w_acosf.c: Likewise.
+	* math/w_acosh.c: Likewise.
+	* math/w_acoshf.c: Likewise.
+	* math/w_acoshl.c: Likewise.
+	* math/w_acosl.c: Likewise.
+	* math/w_asin.c: Likewise.
+	* math/w_asinf.c: Likewise.
+	* math/w_asinl.c: Likewise.
+	* math/w_atanh.c: Likewise.
+	* math/w_atanhf.c: Likewise.
+	* math/w_atanhl.c: Likewise.
+	* math/w_exp2.c: Likewise.
+	* math/w_exp2f.c: Likewise.
+	* math/w_exp2l.c: Likewise.
+	* math/w_j0.c: Likewise.
+	* math/w_j0f.c: Likewise.
+	* math/w_j0l.c: Likewise.
+	* math/w_j1.c: Likewise.
+	* math/w_j1f.c: Likewise.
+	* math/w_j1l.c: Likewise.
+	* math/w_jn.c: Likewise.
+	* math/w_jnf.c: Likewise.
+	* math/w_log.c: Likewise.
+	* math/w_log10.c: Likewise.
+	* math/w_log10f.c: Likewise.
+	* math/w_log10l.c: Likewise.
+	* math/w_log2.c: Likewise.
+	* math/w_log2f.c: Likewise.
+	* math/w_log2l.c: Likewise.
+	* math/w_logf.c: Likewise.
+	* math/w_logl.c: Likewise.
+	* math/w_sqrt.c: Likewise.
+	* math/w_sqrtf.c: Likewise.
+	* math/w_sqrtl.c: Likewise.
+	* sysdeps/ieee754/dbl-64/e_atanh.c: Likewise.
+	* sysdeps/ieee754/dbl-64/w_exp.c: Likewise.
+	* sysdeps/ieee754/flt-32/e_atanhf.c: Likewise.
+	* sysdeps/ieee754/flt-32/w_expf.c: Likewise.
+	* sysdeps/ieee754/ldbl-96/w_expl.c: Likewise.
+
 2012-02-22  Carlos O'Donell  <carlos_odonell@mentor.com>
 
 	[BZ #411]
diff --git a/NEWS b/NEWS
index 6f899b6..b92705d 100644
--- a/NEWS
+++ b/NEWS
@@ -9,7 +9,7 @@ Version 2.15.1
 
 * The following bugs are resolved with this release:
 
-  411, 13731, 13748
+  411, 13731, 13732, 13748
 
 Version 2.15
 
diff --git a/math/w_acos.c b/math/w_acos.c
index 617cfda..0a0ab9c 100644
--- a/math/w_acos.c
+++ b/math/w_acos.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -26,7 +26,8 @@
 double
 __acos (double x)
 {
-  if (__builtin_expect (fabs (x) > 1.0, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (isgreater (fabs (x), 1.0), 0)
+      && _LIB_VERSION != _IEEE_)
     {
       /* acos(|x|>1) */
       feraiseexcept (FE_INVALID);
diff --git a/math/w_acosf.c b/math/w_acosf.c
index bb3aae0..040f5d6 100644
--- a/math/w_acosf.c
+++ b/math/w_acosf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -26,7 +26,8 @@
 float
 __acosf (float x)
 {
-  if (__builtin_expect (fabsf (x) > 1.0f, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (isgreater (fabsf (x), 1.0f), 0)
+      && _LIB_VERSION != _IEEE_)
     {
       /* acos(|x|>1) */
       feraiseexcept (FE_INVALID);
diff --git a/math/w_acosh.c b/math/w_acosh.c
index 50201b4..d512704 100644
--- a/math/w_acosh.c
+++ b/math/w_acosh.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -25,7 +25,7 @@
 double
 __acosh (double x)
 {
-  if (__builtin_expect (x < 1.0, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (isless (x,  1.0), 0) && _LIB_VERSION != _IEEE_)
     /* acosh(x<1) */
     return __kernel_standard (x, x, 29);
 
diff --git a/math/w_acoshf.c b/math/w_acoshf.c
index 2b07824..c00a8c8 100644
--- a/math/w_acoshf.c
+++ b/math/w_acoshf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -25,7 +25,7 @@
 float
 __acoshf (float x)
 {
-  if (__builtin_expect (x < 1.0f, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (isless (x, 1.0f), 0) && _LIB_VERSION != _IEEE_)
     /* acosh(x<1) */
     return __kernel_standard_f (x, x, 129);
 
diff --git a/math/w_acoshl.c b/math/w_acoshl.c
index 0f7068a..80ac67e 100644
--- a/math/w_acoshl.c
+++ b/math/w_acoshl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -25,7 +25,7 @@
 long double
 __acoshl (long double x)
 {
-  if (__builtin_expect (x < 1.0L, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (isless (x, 1.0L), 0) && _LIB_VERSION != _IEEE_)
     /* acosh(x<1) */
     return __kernel_standard (x, x, 229);
 
diff --git a/math/w_acosl.c b/math/w_acosl.c
index dd1039e..c112950 100644
--- a/math/w_acosl.c
+++ b/math/w_acosl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -26,7 +26,8 @@
 long double
 __acosl (long double x)
 {
-  if (__builtin_expect (fabsl (x) > 1.0L, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (isgreater (fabsl (x), 1.0L), 0)
+      && _LIB_VERSION != _IEEE_)
     {
       /* acos(|x|>1) */
       feraiseexcept (FE_INVALID);
diff --git a/math/w_asin.c b/math/w_asin.c
index feb5c6a..b8c645c 100644
--- a/math/w_asin.c
+++ b/math/w_asin.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -26,7 +26,8 @@
 double
 __asin (double x)
 {
-  if (__builtin_expect (fabs (x) > 1.0, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (isgreater (fabs (x),  1.0), 0)
+      && _LIB_VERSION != _IEEE_)
     {
       /* asin(|x|>1) */
       feraiseexcept (FE_INVALID);
diff --git a/math/w_asinf.c b/math/w_asinf.c
index 1a21dc3..ff4afef 100644
--- a/math/w_asinf.c
+++ b/math/w_asinf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -26,7 +26,8 @@
 float
 __asinf (float x)
 {
-  if (__builtin_expect (fabsf (x) > 1.0f, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (isgreater (fabsf (x), 1.0f), 0)
+      && _LIB_VERSION != _IEEE_)
     {
       /* asin(|x|>1) */
       feraiseexcept (FE_INVALID);
diff --git a/math/w_asinl.c b/math/w_asinl.c
index a9f14fb..05ba88e 100644
--- a/math/w_asinl.c
+++ b/math/w_asinl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -26,7 +26,8 @@
 long double
 __asinl (long double x)
 {
-  if (__builtin_expect (fabsl (x) > 1.0L, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (isgreater (fabsl (x), 1.0L), 0)
+      && _LIB_VERSION != _IEEE_)
     {
       /* asin(|x|>1) */
       feraiseexcept (FE_INVALID);
diff --git a/math/w_atanh.c b/math/w_atanh.c
index 61ea0d8..830528a 100644
--- a/math/w_atanh.c
+++ b/math/w_atanh.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -25,7 +25,8 @@
 double
 __atanh (double x)
 {
-  if (__builtin_expect (fabs (x) >= 1.0, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (isgreaterequal (fabs (x), 1.0), 0)
+      && _LIB_VERSION != _IEEE_)
     return __kernel_standard (x, x,
 			      fabs (x) > 1.0
 			      ? 30		/* atanh(|x|>1) */
diff --git a/math/w_atanhf.c b/math/w_atanhf.c
index fd1dbae..36c2938 100644
--- a/math/w_atanhf.c
+++ b/math/w_atanhf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -25,7 +25,8 @@
 float
 __atanhf (float x)
 {
-  if (__builtin_expect (fabsf (x) >= 1.0f, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (isgreaterequal (fabsf (x), 1.0f), 0)
+      && _LIB_VERSION != _IEEE_)
     return __kernel_standard_f (x, x,
 				fabsf (x) > 1.0f
 				? 130		/* atanh(|x|>1) */
diff --git a/math/w_atanhl.c b/math/w_atanhl.c
index 7c958f1..6d7617d 100644
--- a/math/w_atanhl.c
+++ b/math/w_atanhl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -25,7 +25,8 @@
 long double
 __atanhl (long double x)
 {
-  if (__builtin_expect (fabsl (x) >= 1.0L, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (isgreaterequal (fabsl (x), 1.0L), 0)
+      && _LIB_VERSION != _IEEE_)
     return __kernel_standard (x, x,
 			      fabsl (x) > 1.0L
 			      ? 230		/* atanh(|x|>1) */
diff --git a/math/w_exp2.c b/math/w_exp2.c
index bf22326..7a3b0af 100644
--- a/math/w_exp2.c
+++ b/math/w_exp2.c
@@ -12,7 +12,8 @@ static const double u_threshold = (double) (DBL_MIN_EXP - DBL_MANT_DIG - 1);
 double
 __exp2 (double x)
 {
-  if (__builtin_expect (x <= u_threshold || x > o_threshold, 0)
+  if (__builtin_expect (islessequal (x, u_threshold)
+			|| isgreater (x, o_threshold), 0)
       && _LIB_VERSION != _IEEE_ && __finite (x))
     /* exp2 overflow: 44, exp2 underflow: 45 */
     return __kernel_standard (x, x, 44 + (x <= o_threshold));
diff --git a/math/w_exp2f.c b/math/w_exp2f.c
index 7215fca..c4e9e94 100644
--- a/math/w_exp2f.c
+++ b/math/w_exp2f.c
@@ -12,7 +12,8 @@ static const float u_threshold = (float) (FLT_MIN_EXP - FLT_MANT_DIG - 1);
 float
 __exp2f (float x)
 {
-  if (__builtin_expect (x <= u_threshold || x > o_threshold, 0)
+  if (__builtin_expect (islessequal (x, u_threshold)
+			|| isgreater (x, o_threshold), 0)
       && _LIB_VERSION != _IEEE_ && __finitef (x))
     /* exp2 overflow: 144, exp2 underflow: 145 */
     return __kernel_standard_f (x, x, 144 + (x <= o_threshold));
diff --git a/math/w_exp2l.c b/math/w_exp2l.c
index ac8d231..442a637 100644
--- a/math/w_exp2l.c
+++ b/math/w_exp2l.c
@@ -13,7 +13,8 @@ static const long double u_threshold
 long double
 __exp2l (long double x)
 {
-  if (__builtin_expect (x <= u_threshold || x > o_threshold, 0)
+  if (__builtin_expect (islessequal (x, u_threshold)
+			|| isgreater (x, o_threshold), 0)
       && _LIB_VERSION != _IEEE_ && __finitel (x))
     /* exp2 overflow: 244, exp2 underflow: 245 */
     return __kernel_standard (x, x, 244 + (x <= o_threshold));
diff --git a/math/w_j0.c b/math/w_j0.c
index 3613520..af714dd 100644
--- a/math/w_j0.c
+++ b/math/w_j0.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -26,7 +26,8 @@
 double
 j0 (double x)
 {
-  if (__builtin_expect (fabs (x) > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (isgreater (fabs (x), X_TLOSS), 0)
+      && _LIB_VERSION != _IEEE_)
     /* j0(|x|>X_TLOSS) */
     return __kernel_standard (x, x, 34);
 
@@ -41,7 +42,8 @@ strong_alias (j0, j0l)
 double
 y0 (double x)
 {
-  if (__builtin_expect (x <= 0.0 || x > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (islessequal (x, 0.0) || isgreater (x, X_TLOSS), 0)
+      && _LIB_VERSION != _IEEE_)
     {
       if (x < 0.0)
 	{
diff --git a/math/w_j0f.c b/math/w_j0f.c
index ff1ac3c..2ba994f 100644
--- a/math/w_j0f.c
+++ b/math/w_j0f.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -26,7 +26,7 @@
 float
 j0f (float x)
 {
-  if (__builtin_expect (fabsf (x) > (float) X_TLOSS, 0)
+  if (__builtin_expect (isgreater (fabsf (x), (float) X_TLOSS), 0)
       && _LIB_VERSION != _IEEE_)
     /* j0(|x|>X_TLOSS) */
     return __kernel_standard_f (x, x, 134);
@@ -39,7 +39,8 @@ j0f (float x)
 float
 y0f (float x)
 {
-  if (__builtin_expect (x <= 0.0f || x > (float) X_TLOSS, 0)
+  if (__builtin_expect (islessequal (x, 0.0f)
+                        || isgreater (x, (float) X_TLOSS), 0)
       && _LIB_VERSION != _IEEE_)
     {
       if (x < 0.0f)
diff --git a/math/w_j0l.c b/math/w_j0l.c
index a16363d..117581f 100644
--- a/math/w_j0l.c
+++ b/math/w_j0l.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -26,7 +26,8 @@
 long double
 __j0l (long double x)
 {
-  if (__builtin_expect (fabsl (x) > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (isgreater (fabsl (x), X_TLOSS), 0)
+      && _LIB_VERSION != _IEEE_)
     /* j0(|x|>X_TLOSS) */
     return __kernel_standard (x, x, 234);
 
@@ -39,7 +40,8 @@ weak_alias (__j0l, j0l)
 long double
 __y0l (long double x)
 {
-  if (__builtin_expect (x <= 0.0L || x > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (islessequal (x, 0.0L) || isgreater (x, X_TLOSS), 0)
+      && _LIB_VERSION != _IEEE_)
     {
       if (x < 0.0L)
 	{
diff --git a/math/w_j1.c b/math/w_j1.c
index 09cacb8..d4703bd 100644
--- a/math/w_j1.c
+++ b/math/w_j1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -26,7 +26,8 @@
 double
 j1 (double x)
 {
-  if (__builtin_expect (fabs (x) > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (isgreater (fabs (x), X_TLOSS), 0)
+      && _LIB_VERSION != _IEEE_)
     /* j1(|x|>X_TLOSS) */
     return __kernel_standard (x, x, 36);
 
@@ -41,7 +42,8 @@ strong_alias (j1, j1l)
 double
 y1 (double x)
 {
-  if (__builtin_expect (x <= 0.0 || x > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (islessequal (x, 0.0) || isgreater (x, X_TLOSS), 0)
+      && _LIB_VERSION != _IEEE_)
     {
       if (x < 0.0)
 	{
diff --git a/math/w_j1f.c b/math/w_j1f.c
index 40a2cf3..6134f55 100644
--- a/math/w_j1f.c
+++ b/math/w_j1f.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -26,7 +26,8 @@
 float
 j1f (float x)
 {
-  if (__builtin_expect (fabsf (x) > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (isgreater (fabsf (x), X_TLOSS), 0)
+      && _LIB_VERSION != _IEEE_)
     /* j1(|x|>X_TLOSS) */
     return __kernel_standard_f (x, x, 136);
 
@@ -38,7 +39,8 @@ j1f (float x)
 float
 y1f (float x)
 {
-  if (__builtin_expect (x <= 0.0f || x > (float) X_TLOSS, 0)
+  if (__builtin_expect (islessequal (x, 0.0f)
+			|| isgreater (x, (float) X_TLOSS), 0)
       && _LIB_VERSION != _IEEE_)
     {
       if (x < 0.0f)
diff --git a/math/w_j1l.c b/math/w_j1l.c
index 91b56e3..a35662e 100644
--- a/math/w_j1l.c
+++ b/math/w_j1l.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -26,7 +26,8 @@
 long double
 __j1l (long double x)
 {
-  if (__builtin_expect (fabsl (x) > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (isgreater (fabsl (x), X_TLOSS), 0)
+      && _LIB_VERSION != _IEEE_)
     /* j1(|x|>X_TLOSS) */
     return __kernel_standard (x, x, 236);
 
@@ -39,7 +40,8 @@ weak_alias (__j1l, j1l)
 long double
 __y1l (long double x)
 {
-  if (__builtin_expect (x <= 0.0L || x > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (islessequal (x, 0.0L) || isgreater (x, X_TLOSS), 0)
+      && _LIB_VERSION != _IEEE_)
     {
       if (x < 0.0L)
 	{
diff --git a/math/w_jn.c b/math/w_jn.c
index 36fb448..ff0e24d 100644
--- a/math/w_jn.c
+++ b/math/w_jn.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -26,7 +26,8 @@
 double
 jn (int n, double x)
 {
-  if (__builtin_expect (fabs (x) > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (isgreater (fabs (x), X_TLOSS), 0)
+      && _LIB_VERSION != _IEEE_)
     /* jn(n,|x|>X_TLOSS) */
     return __kernel_standard (n, x, 38);
 
@@ -41,7 +42,8 @@ strong_alias (jn, jnl)
 double
 yn (int n, double x)
 {
-  if (__builtin_expect (x <= 0.0 || x > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (islessequal (x, 0.0) || isgreater (x, X_TLOSS), 0)
+      && _LIB_VERSION != _IEEE_)
     {
       if (x < 0.0)
 	{
diff --git a/math/w_jnf.c b/math/w_jnf.c
index 7b35955..7d72099 100644
--- a/math/w_jnf.c
+++ b/math/w_jnf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -26,7 +26,7 @@
 float
 jnf (int n, float x)
 {
-  if (__builtin_expect (fabsf (x) > (float) X_TLOSS, 0)
+  if (__builtin_expect (isgreater (fabsf (x), (float) X_TLOSS), 0)
       && _LIB_VERSION != _IEEE_)
     /* jn(n,|x|>X_TLOSS) */
     return __kernel_standard_f (n, x, 138);
@@ -39,7 +39,8 @@ jnf (int n, float x)
 float
 ynf (int n, float x)
 {
-  if (__builtin_expect (x <= 0.0f || x > (float) X_TLOSS, 0)
+  if (__builtin_expect (islessequal (x, 0.0f)
+			|| isgreater (x, (float) X_TLOSS), 0)
       && _LIB_VERSION != _IEEE_)
     {
       if (x < 0.0f)
diff --git a/math/w_log.c b/math/w_log.c
index b43af79..f7169ed 100644
--- a/math/w_log.c
+++ b/math/w_log.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -26,7 +26,7 @@
 double
 __log (double x)
 {
-  if (__builtin_expect (x <= 0.0, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (islessequal (x, 0.0), 0) && _LIB_VERSION != _IEEE_)
     {
       if (x == 0.0)
 	{
diff --git a/math/w_log10.c b/math/w_log10.c
index 75ae580..ec4dcba 100644
--- a/math/w_log10.c
+++ b/math/w_log10.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -26,7 +26,7 @@
 double
 __log10 (double x)
 {
-  if (__builtin_expect (x <= 0.0, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (islessequal (x, 0.0), 0) && _LIB_VERSION != _IEEE_)
     {
       if (x == 0.0)
 	{
diff --git a/math/w_log10f.c b/math/w_log10f.c
index 3426e2d..0c7605d 100644
--- a/math/w_log10f.c
+++ b/math/w_log10f.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -26,7 +26,7 @@
 float
 __log10f (float x)
 {
-  if (__builtin_expect (x <= 0.0f, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (islessequal (x, 0.0f), 0) && _LIB_VERSION != _IEEE_)
     {
       if (x == 0.0f)
 	{
diff --git a/math/w_log10l.c b/math/w_log10l.c
index 6f81f39..4d347b8 100644
--- a/math/w_log10l.c
+++ b/math/w_log10l.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -26,7 +26,7 @@
 long double
 __log10l (long double x)
 {
-  if (__builtin_expect (x <= 0.0L, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (islessequal (x, 0.0L), 0) && _LIB_VERSION != _IEEE_)
     {
       if (x == 0.0L)
 	{
diff --git a/math/w_log2.c b/math/w_log2.c
index 6d42043..43e718b 100644
--- a/math/w_log2.c
+++ b/math/w_log2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -26,7 +26,7 @@
 double
 __log2 (double x)
 {
-  if (__builtin_expect (x <= 0.0, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (islessequal (x, 0.0), 0) && _LIB_VERSION != _IEEE_)
     {
       if (x == 0.0)
 	{
diff --git a/math/w_log2f.c b/math/w_log2f.c
index 7c64ad8..0cf2ef9 100644
--- a/math/w_log2f.c
+++ b/math/w_log2f.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -26,7 +26,7 @@
 float
 __log2f (float x)
 {
-  if (__builtin_expect (x <= 0.0f, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (islessequal (x, 0.0f), 0) && _LIB_VERSION != _IEEE_)
     {
       if (x == 0.0)
 	{
diff --git a/math/w_log2l.c b/math/w_log2l.c
index f589768..f465379 100644
--- a/math/w_log2l.c
+++ b/math/w_log2l.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -26,7 +26,7 @@
 long double
 __log2l (long double x)
 {
-  if (__builtin_expect (x <= 0.0L, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (islessequal (x, 0.0L), 0) && _LIB_VERSION != _IEEE_)
     {
       if (x == 0.0L)
 	{
diff --git a/math/w_logf.c b/math/w_logf.c
index 52b9bef..8b88b4b 100644
--- a/math/w_logf.c
+++ b/math/w_logf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -26,7 +26,7 @@
 float
 __logf (float x)
 {
-  if (__builtin_expect (x <= 0.0f, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (islessequal (x, 0.0f), 0) && _LIB_VERSION != _IEEE_)
     {
       if (x == 0.0f)
 	{
diff --git a/math/w_logl.c b/math/w_logl.c
index 9f2bdf0..75623e9 100644
--- a/math/w_logl.c
+++ b/math/w_logl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -26,7 +26,7 @@
 long double
 __logl (long double x)
 {
-  if (__builtin_expect (x <= 0.0L, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (islessequal (x, 0.0L), 0) && _LIB_VERSION != _IEEE_)
     {
       if (x == 0.0L)
 	{
diff --git a/math/w_sqrt.c b/math/w_sqrt.c
index 8a435ef..b49296d 100644
--- a/math/w_sqrt.c
+++ b/math/w_sqrt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -25,7 +25,7 @@
 double
 __sqrt (double x)
 {
-  if (__builtin_expect (x < 0.0, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (isless (x, 0.0), 0) && _LIB_VERSION != _IEEE_)
     return __kernel_standard (x, x, 26); /* sqrt(negative) */
 
   return __ieee754_sqrt (x);
diff --git a/math/w_sqrtf.c b/math/w_sqrtf.c
index fc088b6..565504a 100644
--- a/math/w_sqrtf.c
+++ b/math/w_sqrtf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -25,7 +25,7 @@
 float
 __sqrtf (float x)
 {
-  if (__builtin_expect (x < 0.0f, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (isless (x, 0.0f), 0) && _LIB_VERSION != _IEEE_)
     return __kernel_standard_f (x, x, 126); /* sqrt(negative) */
 
   return __ieee754_sqrtf (x);
diff --git a/math/w_sqrtl.c b/math/w_sqrtl.c
index 0c44629..539c89a 100644
--- a/math/w_sqrtl.c
+++ b/math/w_sqrtl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -25,7 +25,7 @@
 long double
 __sqrtl (long double x)
 {
-  if (__builtin_expect (x < 0.0L, 0) && _LIB_VERSION != _IEEE_)
+  if (__builtin_expect (isless (x, 0.0L), 0) && _LIB_VERSION != _IEEE_)
     return __kernel_standard (x, x, 226); /* sqrt(negative) */
 
   return __ieee754_sqrtl (x);
diff --git a/sysdeps/ieee754/dbl-64/e_atanh.c b/sysdeps/ieee754/dbl-64/e_atanh.c
index 1f83e31..4366ddd 100644
--- a/sysdeps/ieee754/dbl-64/e_atanh.c
+++ b/sysdeps/ieee754/dbl-64/e_atanh.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -47,7 +47,7 @@ __ieee754_atanh (double x)
 {
   double xa = fabs (x);
   double t;
-  if (xa < 0.5)
+  if (isless (xa, 0.5))
     {
       if (__builtin_expect (xa < 0x1.0p-28, 0))
 	{
@@ -58,11 +58,11 @@ __ieee754_atanh (double x)
       t = xa + xa;
       t = 0.5 * __log1p (t + t * xa / (1.0 - xa));
     }
-  else if (__builtin_expect (xa < 1.0, 1))
+  else if (__builtin_expect (isless (xa, 1.0), 1))
     t = 0.5 * __log1p ((xa + xa) / (1.0 - xa));
   else
     {
-      if (xa > 1.0)
+      if (isgreater (xa, 1.0))
 	return (x - x) / (x - x);
 
       return x / 0.0;
diff --git a/sysdeps/ieee754/dbl-64/w_exp.c b/sysdeps/ieee754/dbl-64/w_exp.c
index f1becff..f5af6b1 100644
--- a/sysdeps/ieee754/dbl-64/w_exp.c
+++ b/sysdeps/ieee754/dbl-64/w_exp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -29,12 +29,12 @@ u_threshold= -7.45133219101941108420e+02;  /* 0xc0874910, 0xD52D3051 */
 double
 __exp (double x)
 {
-  if (__builtin_expect (x > o_threshold, 0))
+  if (__builtin_expect (isgreater (x, o_threshold), 0))
     {
       if (_LIB_VERSION != _IEEE_)
 	return __kernel_standard_f (x, x, 6);
     }
-  else if (__builtin_expect (x < u_threshold, 0))
+  else if (__builtin_expect (isless (x, u_threshold), 0))
     {
       if (_LIB_VERSION != _IEEE_)
 	return __kernel_standard_f (x, x, 7);
diff --git a/sysdeps/ieee754/flt-32/e_atanhf.c b/sysdeps/ieee754/flt-32/e_atanhf.c
index d98a11e..a1d03b4 100644
--- a/sysdeps/ieee754/flt-32/e_atanhf.c
+++ b/sysdeps/ieee754/flt-32/e_atanhf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -47,7 +47,7 @@ __ieee754_atanhf (float x)
 {
   float xa = fabsf (x);
   float t;
-  if (xa < 0.5f)
+  if (isless (xa, 0.5f))
     {
       if (__builtin_expect (xa < 0x1.0p-28f, 0))
 	{
@@ -58,11 +58,11 @@ __ieee754_atanhf (float x)
       t = xa + xa;
       t = 0.5f * __log1pf (t + t * xa / (1.0f - xa));
     }
-  else if (__builtin_expect (xa < 1.0f, 1))
+  else if (__builtin_expect (isless (xa, 1.0f), 1))
     t = 0.5f * __log1pf ((xa + xa) / (1.0f - xa));
   else
     {
-      if (xa > 1.0f)
+      if (isgreater (xa, 1.0f))
 	return (x - x) / (x - x);
 
       return x / 0.0f;
diff --git a/sysdeps/ieee754/flt-32/w_expf.c b/sysdeps/ieee754/flt-32/w_expf.c
index 151c584..b4d0824 100644
--- a/sysdeps/ieee754/flt-32/w_expf.c
+++ b/sysdeps/ieee754/flt-32/w_expf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -29,12 +29,12 @@ u_threshold= -1.0397208405e+02;  /* 0xc2cff1b5 */
 float
 __expf (float x)
 {
-  if (__builtin_expect (x > o_threshold, 0))
+  if (__builtin_expect (isgreater (x, o_threshold), 0))
     {
       if (_LIB_VERSION != _IEEE_)
 	return __kernel_standard_f (x, x, 106);
     }
-  else if (__builtin_expect (x < u_threshold, 0))
+  else if (__builtin_expect (isless (x, u_threshold), 0))
     {
       if (_LIB_VERSION != _IEEE_)
 	return __kernel_standard_f (x, x, 107);
diff --git a/sysdeps/ieee754/ldbl-96/w_expl.c b/sysdeps/ieee754/ldbl-96/w_expl.c
index 703a0a2..b66d03e 100644
--- a/sysdeps/ieee754/ldbl-96/w_expl.c
+++ b/sysdeps/ieee754/ldbl-96/w_expl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -31,12 +31,12 @@ u_threshold= -1.140019167866942050398521670162263001513e4;
 long double
 __expl (long double x)
 {
-  if (__builtin_expect (x > o_threshold, 0))
+  if (__builtin_expect (isgreater (x, o_threshold), 0))
     {
       if (_LIB_VERSION != _IEEE_)
 	return __kernel_standard (x, x, 206);
     }
-  else if (__builtin_expect (x < u_threshold, 0))
+  else if (__builtin_expect (isless (x, u_threshold), 0))
     {
       if (_LIB_VERSION != _IEEE_)
 	return __kernel_standard (x, x, 207);

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                               |   68 ++++++++++++++++++++
 NEWS                                    |    2 +-
 math/libm-test.inc                      |  103 +++++++++++++++++++++++++++++++
 math/w_acos.c                           |    5 +-
 math/w_acosf.c                          |    5 +-
 math/w_acosh.c                          |    4 +-
 math/w_acoshf.c                         |    4 +-
 math/w_acoshl.c                         |    4 +-
 math/w_acosl.c                          |    5 +-
 math/w_asin.c                           |    5 +-
 math/w_asinf.c                          |    5 +-
 math/w_asinl.c                          |    5 +-
 math/w_atanh.c                          |    5 +-
 math/w_atanhf.c                         |    5 +-
 math/w_atanhl.c                         |    5 +-
 math/w_exp2.c                           |    3 +-
 math/w_exp2f.c                          |    3 +-
 math/w_exp2l.c                          |    3 +-
 math/w_j0.c                             |    8 ++-
 math/w_j0f.c                            |    7 +-
 math/w_j0l.c                            |    8 ++-
 math/w_j1.c                             |    8 ++-
 math/w_j1f.c                            |    8 ++-
 math/w_j1l.c                            |    8 ++-
 math/w_jn.c                             |    8 ++-
 math/w_jnf.c                            |    7 +-
 math/w_log.c                            |    4 +-
 math/w_log10.c                          |    4 +-
 math/w_log10f.c                         |    4 +-
 math/w_log10l.c                         |    4 +-
 math/w_log2.c                           |    4 +-
 math/w_log2f.c                          |    4 +-
 math/w_log2l.c                          |    4 +-
 math/w_logf.c                           |    4 +-
 math/w_logl.c                           |    4 +-
 math/w_sqrt.c                           |    4 +-
 math/w_sqrtf.c                          |    4 +-
 math/w_sqrtl.c                          |    4 +-
 sysdeps/ieee754/dbl-64/e_atanh.c        |    8 +-
 sysdeps/ieee754/dbl-64/w_exp.c          |    6 +-
 sysdeps/ieee754/flt-32/e_atanhf.c       |    8 +-
 sysdeps/ieee754/flt-32/s_nearbyintf.c   |   12 ----
 sysdeps/ieee754/flt-32/s_rintf.c        |   12 ----
 sysdeps/ieee754/flt-32/w_expf.c         |    6 +-
 sysdeps/ieee754/ldbl-128/s_nearbyintl.c |   25 +-------
 sysdeps/ieee754/ldbl-128/s_rintl.c      |   25 +-------
 sysdeps/ieee754/ldbl-96/w_expl.c        |    6 +-
 47 files changed, 296 insertions(+), 161 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]