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, master, updated. glibc-2.14-392-g4855e3d


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, master has been updated
       via  4855e3ddf5061dd8ddcefafc7185f6f70937434b (commit)
      from  23ce5627803ad1e6686355965cd68bb23d05fb28 (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=4855e3ddf5061dd8ddcefafc7185f6f70937434b

commit 4855e3ddf5061dd8ddcefafc7185f6f70937434b
Author: Ulrich Drepper <drepper@gmail.com>
Date:   Tue Oct 18 09:59:04 2011 -0400

    Provide combined internal feholdexcept/fesetround interface

diff --git a/ChangeLog b/ChangeLog
index 3802f85..de8b2c3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2011-10-18  Ulrich Drepper  <drepper@gmail.com>
 
+	* math/math_private.h: Define defaults for libc_feholdexcept_setround,
+	libc_feholdexcept_setroundf, libc_feholdexcept_setroundl.
+	* sysdeps/ieee754/dbl-64/e_exp2.c: Use libc_feholdexcept_setround.
+	* sysdeps/x86_64/fpu/math_private.h: Define special version of
+	libc_feholdexcept_setround.
+
 	* sysdeps/x86_64/fpu/multiarch/Makefile [math] (libm-sysdep-routines):
 	Add s_nearbyint-c and s_nearbyintf-c.
 	* sysdeps/x86_64/fpu/bits/mathinline.h: Define nearbyint and
diff --git a/math/math_private.h b/math/math_private.h
index a1ce014..38ff09e 100644
--- a/math/math_private.h
+++ b/math/math_private.h
@@ -376,6 +376,13 @@ extern void __docos (double __x, double __dx, double __v[]);
 #define libc_feholdexceptf(e) (void) feholdexcept (e)
 #define libc_feholdexceptl(e) (void) feholdexcept (e)
 
+#define libc_feholdexcept_setround(e, r) \
+  do { feholdexcept (e); fesetround (r); } while (0)
+#define libc_feholdexcept_setroundf(e, r) \
+  do { feholdexcept (e); fesetround (r); } while (0)
+#define libc_feholdexcept_setroundl(e, r) \
+  do { feholdexcept (e); fesetround (r); } while (0)
+
 #define libc_fesetenv(e) (void) fesetenv (e)
 #define libc_fesetenvf(e) (void) fesetenv (e)
 #define libc_fesetenvl(e) (void) fesetenv (e)
diff --git a/sysdeps/ieee754/dbl-64/e_exp2.c b/sysdeps/ieee754/dbl-64/e_exp2.c
index 734e476..0b7330a 100644
--- a/sysdeps/ieee754/dbl-64/e_exp2.c
+++ b/sysdeps/ieee754/dbl-64/e_exp2.c
@@ -64,11 +64,7 @@ __ieee754_exp2 (double x)
       union ieee754_double ex2_u, scale_u;
       fenv_t oldenv;
 
-      libc_feholdexcept (&oldenv);
-#ifdef FE_TONEAREST
-      /* If we don't have this, it's too bad.  */
-      libc_fesetround (FE_TONEAREST);
-#endif
+      libc_feholdexcept_setround (&oldenv, FE_TONEAREST);
 
       /* 1. Argument reduction.
 	 Choose integers ex, -256 <= t < 256, and some real
diff --git a/sysdeps/x86_64/fpu/math_private.h b/sysdeps/x86_64/fpu/math_private.h
index 4886c64..28bd9ce 100644
--- a/sysdeps/x86_64/fpu/math_private.h
+++ b/sysdeps/x86_64/fpu/math_private.h
@@ -145,7 +145,7 @@ do {								\
 
 #undef libc_feholdexcept
 #define libc_feholdexcept(e) \
-  do {			     \
+  do {									      \
      unsigned int mxcsr;						      \
      asm ("stmxcsr %0" : "=m" (*&mxcsr));				      \
      (e)->__mxcsr = mxcsr;						      \
@@ -155,6 +155,18 @@ do {								\
 // #define libc_feholdexceptf(e) (void) feholdexcept (e)
 // #define libc_feholdexceptl(e) (void) feholdexcept (e)
 
+#undef libc_feholdexcept_setround
+#define libc_feholdexcept_setround(e, r) \
+  do {									      \
+     unsigned int mxcsr;						      \
+     asm ("stmxcsr %0" : "=m" (*&mxcsr));				      \
+     (e)->__mxcsr = mxcsr;						      \
+     mxcsr = ((mxcsr | 0x1f80) & ~0x603f) | ((r) << 3);			      \
+     asm volatile ("ldmxcsr %0" : : "m" (*&mxcsr));			      \
+  } while (0)
+// #define libc_feholdexcept_setroundf(e, r) ...
+// #define libc_feholdexcept_setroundl(e, r) ...
+
 #undef libc_fesetenv
 #define libc_fesetenv(e) \
   asm volatile ("ldmxcsr %0" : : "m" ((e)->__mxcsr))

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

Summary of changes:
 ChangeLog                         |    6 ++++++
 math/math_private.h               |    7 +++++++
 sysdeps/ieee754/dbl-64/e_exp2.c   |    6 +-----
 sysdeps/x86_64/fpu/math_private.h |   14 +++++++++++++-
 4 files changed, 27 insertions(+), 6 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]