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