This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch master updated. glibc-2.19-345-g4fa262f
- From: davem at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 30 Apr 2014 22:15:30 -0000
- Subject: GNU C Library master sources branch master updated. glibc-2.19-345-g4fa262f
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 4fa262fa9e8836f2e513e3ea56797dab2d75e6de (commit)
from 1d3d93ef73c7712a7b903140e524f081d349865b (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://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=4fa262fa9e8836f2e513e3ea56797dab2d75e6de
commit 4fa262fa9e8836f2e513e3ea56797dab2d75e6de
Author: David S. Miller <davem@davemloft.net>
Date: Wed Apr 30 15:14:58 2014 -0700
Add round-mode context support to sparc.
* sysdeps/sparc/fpu/fenv_private.h (HAVE_RM_CTX): Define.
(libc_feholdexcept_setround_sparc_ctx): New function.
(libc_fesetenv_sparc_ctx): Likewise.
(libc_feupdateenv_sparc_ctx): Likewise.
(libc_feholdsetround_sparc_ctx): Likewise.
(libc_feholdexcept_setround_ctx): Define.
(libc_feholdexcept_setroundf_ctx): Likewise.
(libc_feholdexcept_setroundl_ctx): Likewise.
(libc_fesetenv_ctx): Likewise.
(libc_fesetenvf_ctx): Likewise.
(libc_fesetenvl_ctx): Likewise.
(libc_feupdateenv_ctx): Likewise.
(libc_feupdateenvf_ctx): Likewise.
(libc_feupdateenvl_ctx): Likewise.
(libc_feresetround_ctx): Likewise.
(libc_feresetroundf_ctx): Likewise.
(libc_feresetroundl_ctx): Likewise.
(libc_feholdsetround_ctx): Likewise.
(libc_feholdsetroundf_ctx): Likewise.
(libc_feholdsetroundl_ctx): Likewise.
diff --git a/ChangeLog b/ChangeLog
index 44ddb28..72cc597 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,26 @@
2014-04-30 David S. Miller <davem@davemloft.net>
+ * sysdeps/sparc/fpu/fenv_private.h (HAVE_RM_CTX): Define.
+ (libc_feholdexcept_setround_sparc_ctx): New function.
+ (libc_fesetenv_sparc_ctx): Likewise.
+ (libc_feupdateenv_sparc_ctx): Likewise.
+ (libc_feholdsetround_sparc_ctx): Likewise.
+ (libc_feholdexcept_setround_ctx): Define.
+ (libc_feholdexcept_setroundf_ctx): Likewise.
+ (libc_feholdexcept_setroundl_ctx): Likewise.
+ (libc_fesetenv_ctx): Likewise.
+ (libc_fesetenvf_ctx): Likewise.
+ (libc_fesetenvl_ctx): Likewise.
+ (libc_feupdateenv_ctx): Likewise.
+ (libc_feupdateenvf_ctx): Likewise.
+ (libc_feupdateenvl_ctx): Likewise.
+ (libc_feresetround_ctx): Likewise.
+ (libc_feresetroundf_ctx): Likewise.
+ (libc_feresetroundl_ctx): Likewise.
+ (libc_feholdsetround_ctx): Likewise.
+ (libc_feholdsetroundf_ctx): Likewise.
+ (libc_feholdsetroundl_ctx): Likewise.
+
* sysdeps/unix/sysv/linux/sparc/bits/siginfo.h (EMT_TAGOVF): Protect
with __USE_GNU instead of XOPEN cpp guards.
diff --git a/sysdeps/sparc/fpu/fenv_private.h b/sysdeps/sparc/fpu/fenv_private.h
index 8690879..29b5d12 100644
--- a/sysdeps/sparc/fpu/fenv_private.h
+++ b/sysdeps/sparc/fpu/fenv_private.h
@@ -115,4 +115,68 @@ libc_feresetround (fenv_t *e)
#define libc_feholdsetroundl libc_feholdsetround
#define libc_feresetroundl libc_feresetround
+/* We have support for rounding mode context. */
+#define HAVE_RM_CTX 1
+
+static __always_inline void
+libc_feholdexcept_setround_sparc_ctx (struct rm_ctx *ctx, int round)
+{
+ fenv_t new;
+
+ __fenv_stfsr(ctx->env);
+ new = ctx->env & ~((0x1f << 23) | FE_ALL_EXCEPT);
+ new = (new & ~__FE_ROUND_MASK) | round;
+ if (__glibc_unlikely (new != ctx->env))
+ {
+ __fenv_ldfsr(new);
+ ctx->updated_status = true;
+ }
+ else
+ ctx->updated_status = false;
+}
+
+static __always_inline void
+libc_fesetenv_sparc_ctx (struct rm_ctx *ctx)
+{
+ libc_fesetenv(&ctx->env);
+}
+
+static __always_inline void
+libc_feupdateenv_sparc_ctx (struct rm_ctx *ctx)
+{
+ if (__glibc_unlikely (ctx->updated_status))
+ libc_feupdateenv_test (&ctx->env, 0);
+}
+
+static __always_inline void
+libc_feholdsetround_sparc_ctx (struct rm_ctx *ctx, int round)
+{
+ fenv_t new;
+
+ __fenv_stfsr(ctx->env);
+ new = (ctx->env & ~__FE_ROUND_MASK) | round;
+ if (__glibc_unlikely (new != ctx->env))
+ {
+ __fenv_ldfsr(new);
+ ctx->updated_status = true;
+ }
+ else
+ ctx->updated_status = false;
+}
+#define libc_feholdexcept_setround_ctx libc_feholdexcept_setround_sparc_ctx
+#define libc_feholdexcept_setroundf_ctx libc_feholdexcept_setround_sparc_ctx
+#define libc_feholdexcept_setroundl_ctx libc_feholdexcept_setround_sparc_ctx
+#define libc_fesetenv_ctx libc_fesetenv_sparc_ctx
+#define libc_fesetenvf_ctx libc_fesetenv_sparc_ctx
+#define libc_fesetenvl_ctx libc_fesetenv_sparc_ctx
+#define libc_feupdateenv_ctx libc_feupdateenv_sparc_ctx
+#define libc_feupdateenvf_ctx libc_feupdateenv_sparc_ctx
+#define libc_feupdateenvl_ctx libc_feupdateenv_sparc_ctx
+#define libc_feresetround_ctx libc_feupdateenv_sparc_ctx
+#define libc_feresetroundf_ctx libc_feupdateenv_sparc_ctx
+#define libc_feresetroundl_ctx libc_feupdateenv_sparc_ctx
+#define libc_feholdsetround_ctx libc_feholdsetround_sparc_ctx
+#define libc_feholdsetroundf_ctx libc_feholdsetround_sparc_ctx
+#define libc_feholdsetroundl_ctx libc_feholdsetround_sparc_ctx
+
#endif /* FENV_PRIVATE_H */
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 21 ++++++++++++
sysdeps/sparc/fpu/fenv_private.h | 64 ++++++++++++++++++++++++++++++++++++++
2 files changed, 85 insertions(+), 0 deletions(-)
hooks/post-receive
--
GNU C Library master sources