about summary refs log tree commit diff
path: root/sysdeps/ieee754/dbl-64/wordsize-64
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2012-03-13 14:12:44 +0000
committerJoseph Myers <joseph@codesourcery.com>2012-03-13 14:12:44 +0000
commitf453b98b6bf698ddb4d49cd3dc0f94d2da2a8968 (patch)
treeb14dc65111884a7d94642b63741aa015cd41463d /sysdeps/ieee754/dbl-64/wordsize-64
parent8e59da90ce7ef7b4226b9516116353cfceb5bb1c (diff)
downloadglibc-f453b98b6bf698ddb4d49cd3dc0f94d2da2a8968.tar.gz
glibc-f453b98b6bf698ddb4d49cd3dc0f94d2da2a8968.tar.xz
glibc-f453b98b6bf698ddb4d49cd3dc0f94d2da2a8968.zip
Clean up dbl-64 rint, nearbyint.
Diffstat (limited to 'sysdeps/ieee754/dbl-64/wordsize-64')
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c12
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_rint.c12
2 files changed, 0 insertions, 24 deletions
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c
index a3809984e2..a58a6202ef 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c
@@ -41,29 +41,17 @@ __nearbyint(double x)
 	j0 = ((i0>>52)&0x7ff)-0x3ff;
 	if(__builtin_expect(j0<52, 1)) {
 	    if(j0<0) {
-	      if((i0&UINT64_C(0x7fffffffffffffff))==0) return x;
-		uint64_t i = i0 & UINT64_C(0xfffffffffffff);
-		i0 &= UINT64_C(0xfffe000000000000);
-		i0 |= (((i|-i) >> 12) & UINT64_C(0x8000000000000));
-		INSERT_WORDS64(x,i0);
 		libc_feholdexcept (&env);
 		double w = TWO52[sx]+x;
 		double t =  w-TWO52[sx];
 		math_opt_barrier(t);
 		libc_fesetenv (&env);
 		return copysign(t, x);
-	    } else {
-		uint64_t i = UINT64_C(0x000fffffffffffff)>>j0;
-		if((i0&i)==0) return x; /* x is integral */
-		i>>=1;
-		if((i0&i)!=0)
-		    i0 = (i0&(~i))|(UINT64_C(0x4000000000000)>>j0);
 	    }
 	} else {
 	    if(j0==0x400) return x+x;	/* inf or NaN */
 	    else return x;		/* x is integral */
 	}
-	INSERT_WORDS64(x,i0);
 	libc_feholdexcept (&env);
 	double w = TWO52[sx]+x;
 	double t = w-TWO52[sx];
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_rint.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_rint.c
index 20eef3c5ea..87b2339d43 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_rint.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_rint.c
@@ -38,28 +38,16 @@ __rint(double x)
 	j0 = ((i0>>52)&0x7ff)-0x3ff;
 	if(j0<52) {
 	    if(j0<0) {
-		if((i0 & UINT64_C(0x7fffffffffffffff))==0) return x;
-		uint64_t i = i0 & UINT64_C(0xfffffffffffff);
-		i0 &= UINT64_C(0xfffe000000000000);
-		i0 |= (((i|-i) >> 12) & UINT64_C(0x8000000000000));
-		INSERT_WORDS64(x,i0);
 		double w = TWO52[sx]+x;
 		double t =  w-TWO52[sx];
 		EXTRACT_WORDS64(i0,t);
 		INSERT_WORDS64(t,(i0&UINT64_C(0x7fffffffffffffff))|(sx<<63));
 		return t;
-	    } else {
-		uint64_t i = UINT64_C(0x000fffffffffffff)>>j0;
-		if((i0&i)==0) return x; /* x is integral */
-		i>>=1;
-		if((i0&i)!=0)
-		    i0 = (i0&(~i))|(UINT64_C(0x4000000000000)>>j0);
 	    }
 	} else {
 	    if(j0==0x400) return x+x;	/* inf or NaN */
 	    else return x;		/* x is integral */
 	}
-	INSERT_WORDS64(x,i0);
 	double w = TWO52[sx]+x;
 	return w-TWO52[sx];
 }