a2cf7d
commit 36c17c7079a5243a890ba43affff326a041775a9
a2cf7d
Author: Paul A. Clarke <pc@us.ibm.com>
a2cf7d
Date:   Thu Sep 19 11:31:31 2019 -0500
a2cf7d
a2cf7d
    [powerpc] libc_feholdsetround_noex_ppc_ctx: optimize FPSCR write
a2cf7d
    
a2cf7d
    libc_feholdsetround_noex_ppc_ctx currently performs:
a2cf7d
    1. Read FPSCR, save to context.
a2cf7d
    2. Create new FPSCR value: clear enables and set new rounding mode.
a2cf7d
    3. Write new value to FPSCR.
a2cf7d
    
a2cf7d
    Since other bits just pass through, there is no need to write them.
a2cf7d
    
a2cf7d
    Instead, write just the changed values (enables and rounding mode),
a2cf7d
    which can be a bit more efficient.
a2cf7d
a2cf7d
diff --git a/sysdeps/powerpc/fpu/fenv_private.h b/sysdeps/powerpc/fpu/fenv_private.h
a2cf7d
index 86a3611b3ef41759..c88142fe3053580f 100644
a2cf7d
--- a/sysdeps/powerpc/fpu/fenv_private.h
a2cf7d
+++ b/sysdeps/powerpc/fpu/fenv_private.h
a2cf7d
@@ -142,7 +142,7 @@ libc_feholdsetround_noex_ppc_ctx (struct rm_ctx *ctx, int r)
a2cf7d
   if (__glibc_unlikely (new.l != old.l))
a2cf7d
     {
a2cf7d
       __TEST_AND_ENTER_NON_STOP (old.l, 0ULL);
a2cf7d
-      fesetenv_register (new.fenv);
a2cf7d
+      fesetenv_mode (new.fenv);
a2cf7d
       ctx->updated_status = true;
a2cf7d
     }
a2cf7d
   else