]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
[powerpc] libc_feholdsetround_noex_ppc_ctx: optimize FPSCR write
authorPaul A. Clarke <pc@us.ibm.com>
Thu, 19 Sep 2019 16:31:31 +0000 (11:31 -0500)
committerPaul A. Clarke <pc@us.ibm.com>
Fri, 27 Sep 2019 16:01:54 +0000 (11:01 -0500)
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.

ChangeLog
sysdeps/powerpc/fpu/fenv_private.h

index 6c28351c37e242ffe861631be463323aca7e0997..3c792b4317bd7102eeac77286ffdac03feba5aba 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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
index 94960262dde24912bef4b9f50bae9f506d0dfec1..ade0bfaf5f4053133291662c1bed5d220d7b3ac9 100644 (file)
@@ -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