This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
[glibc/ibm/2.30/master] [powerpc] libc_feholdsetround_noex_ppc_ctx: optimize FPSCR write
- From: Paul Clarke <pc at sourceware dot org>
- To: glibc-cvs at sourceware dot org
- Date: 14 Nov 2019 01:51:07 -0000
- Subject: [glibc/ibm/2.30/master] [powerpc] libc_feholdsetround_noex_ppc_ctx: optimize FPSCR write
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f8a5de73854ee1d90f2482327f5cf0778e54524b
commit f8a5de73854ee1d90f2482327f5cf0778e54524b
Author: Paul A. Clarke <pc@us.ibm.com>
Date: Thu Sep 19 11:31:31 2019 -0500
[powerpc] libc_feholdsetround_noex_ppc_ctx: optimize FPSCR write
libc_feholdsetround_noex_ppc_ctx currently performs:
1. Read FPSCR, save to context.
2. Create new FPSCR value: clear enables and set new rounding mode.
3. Write new value to FPSCR.
Since other bits just pass through, there is no need to write them.
Instead, write just the changed values (enables and rounding mode),
which can be a bit more efficient.
Diff:
---
ChangeLog | 6 ++++++
sysdeps/powerpc/fpu/fenv_private.h | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index d8e1dd5..c9a4b3c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2019-09-27 Paul A. Clarke <pc@us.ibm.com>
+ * sysdeps/powerpc/fpu/fenv_private.h
+ (libc_feholdsetround_noex_ppc_ctx): Call fesetenv_mode instead
+ of fesetenv_register.
+
+2019-09-27 Paul A. Clarke <pc@us.ibm.com>
+
* sysdeps/powerpc/fpu/fenv_libc.h (fegetenv_status): Rename to
fegetenv_control.
* sysdeps/powerpc/fpu/fedisblxcpt.c (fedisableexcept): Accommodate
diff --git a/sysdeps/powerpc/fpu/fenv_private.h b/sysdeps/powerpc/fpu/fenv_private.h
index d080553..084289e 100644
--- a/sysdeps/powerpc/fpu/fenv_private.h
+++ b/sysdeps/powerpc/fpu/fenv_private.h
@@ -142,7 +142,7 @@ libc_feholdsetround_noex_ppc_ctx (struct rm_ctx *ctx, int r)
if (__glibc_unlikely (new.l != old.l))
{
__TEST_AND_ENTER_NON_STOP (old.l, 0ULL);
- fesetenv_register (new.fenv);
+ fesetenv_mode (new.fenv);
ctx->updated_status = true;
}
else