This is the mail archive of the libc-alpha@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]

[PATCH] Use libc_fe*() in 32-bit nearbyint()


I noticed, while doing some sparc optimizations, that while the
wordsize-64 variant of s_nearbyint.c used the proper 'libc_'
prefixed fenv interfaces, the 32-bit wordsize one did not.

Any objections?

2013-01-15  David S. Miller  <davem@davemloft.net>

	* sysdeps/ieee754/dbl-64/s_nearbyint.c (__nearbyint): Use
	libc_feholdexcept and libc_fesetenv.

diff --git a/sysdeps/ieee754/dbl-64/s_nearbyint.c b/sysdeps/ieee754/dbl-64/s_nearbyint.c
index 60afafd..eb40c29 100644
--- a/sysdeps/ieee754/dbl-64/s_nearbyint.c
+++ b/sysdeps/ieee754/dbl-64/s_nearbyint.c
@@ -44,10 +44,10 @@ double __nearbyint(double x)
 	j0 = ((i0>>20)&0x7ff)-0x3ff;
 	if(j0<52) {
 	    if(j0<0) {
-		feholdexcept (&env);
+		libc_feholdexcept (&env);
 	        w = TWO52[sx]+x;
 	        t =  w-TWO52[sx];
-		fesetenv (&env);
+		libc_fesetenv (&env);
 		GET_HIGH_WORD(i0,t);
 		SET_HIGH_WORD(t,(i0&0x7fffffff)|(sx<<31));
 	        return t;
@@ -56,10 +56,10 @@ double __nearbyint(double x)
 	    if(j0==0x400) return x+x;	/* inf or NaN */
 	    else return x;		/* x is integral */
 	}
-	feholdexcept (&env);
+	libc_feholdexcept (&env);
 	w = TWO52[sx]+x;
 	t = w-TWO52[sx];
-	fesetenv (&env);
+	libc_fesetenv (&env);
 	return t;
 }
 weak_alias (__nearbyint, nearbyint)


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