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.19-870-g656b84c


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  656b84c2ef525e3b69802c9057c5897e327b0332 (commit)
      from  538e9e454de75c5528d1a7c8f57ede9ccad39d00 (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=656b84c2ef525e3b69802c9057c5897e327b0332

commit 656b84c2ef525e3b69802c9057c5897e327b0332
Author: Wilco Dijkstra <wdijkstr@arm.com>
Date:   Thu Aug 7 16:29:55 2014 +0000

    This patch adds new function libc_feholdsetround_noex_aarch64_ctx, enabling
    further optimization. libc_feholdsetround_aarch64_ctx now only needs to
    read the FPCR in the typical case, avoiding a redundant FPSR read.
    Performance results show a good improvement (5-10% on sin()) on cores with
    expensive FPCR/FPSR instructions.

diff --git a/ChangeLog b/ChangeLog
index f1c965e..1702300 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2014-08-07  Wilco Dijkstra  <wdijkstr@arm.com>
 
+	* sysdeps/aarch64/fpu/math_private.h
+	(libc_feholdsetround_noex_aarch64_ctx): New function.
+
+2014-08-07  Wilco Dijkstra  <wdijkstr@arm.com>
+
 	* sysdeps/arm/armv6/strcpy.S (strcpy):
 	Fix performance issue in misaligned cases.
 
diff --git a/sysdeps/aarch64/fpu/math_private.h b/sysdeps/aarch64/fpu/math_private.h
index 023c9d0..b13c030 100644
--- a/sysdeps/aarch64/fpu/math_private.h
+++ b/sysdeps/aarch64/fpu/math_private.h
@@ -228,12 +228,9 @@ static __always_inline void
 libc_feholdsetround_aarch64_ctx (struct rm_ctx *ctx, int r)
 {
   fpu_control_t fpcr;
-  fpu_fpsr_t fpsr;
   int round;
 
   _FPU_GETCW (fpcr);
-  _FPU_GETFPSR (fpsr);
-  ctx->env.__fpsr = fpsr;
 
   /* Check whether rounding modes are different.  */
   round = (fpcr ^ r) & _FPU_FPCR_RM_MASK;
@@ -264,6 +261,33 @@ libc_feresetround_aarch64_ctx (struct rm_ctx *ctx)
 #define libc_feresetroundl_ctx		libc_feresetround_aarch64_ctx
 
 static __always_inline void
+libc_feholdsetround_noex_aarch64_ctx (struct rm_ctx *ctx, int r)
+{
+  fpu_control_t fpcr;
+  fpu_fpsr_t fpsr;
+  int round;
+
+  _FPU_GETCW (fpcr);
+  _FPU_GETFPSR (fpsr);
+  ctx->env.__fpsr = fpsr;
+
+  /* Check whether rounding modes are different.  */
+  round = (fpcr ^ r) & _FPU_FPCR_RM_MASK;
+  ctx->updated_status = round != 0;
+
+  /* Set the rounding mode if changed.  */
+  if (__glibc_unlikely (round != 0))
+    {
+      ctx->env.__fpcr = fpcr;
+      _FPU_SETCW (fpcr ^ round);
+    }
+}
+
+#define libc_feholdsetround_noex_ctx	libc_feholdsetround_noex_aarch64_ctx
+#define libc_feholdsetround_noexf_ctx	libc_feholdsetround_noex_aarch64_ctx
+#define libc_feholdsetround_noexl_ctx	libc_feholdsetround_noex_aarch64_ctx
+
+static __always_inline void
 libc_feresetround_noex_aarch64_ctx (struct rm_ctx *ctx)
 {
   /* Restore the rounding mode if updated.  */

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

Summary of changes:
 ChangeLog                          |    5 +++++
 sysdeps/aarch64/fpu/math_private.h |   30 +++++++++++++++++++++++++++---
 2 files changed, 32 insertions(+), 3 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]