From patchwork Mon Sep 9 16:21:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul A. Clarke" X-Patchwork-Id: 34456 Received: (qmail 59384 invoked by alias); 9 Sep 2019 16:21:14 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 59376 invoked by uid 89); 9 Sep 2019 16:21:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 spammy= X-HELO: mx0a-001b2d01.pphosted.com From: "Paul A. Clarke" To: libc-alpha@sourceware.org Cc: tuliom@ascii.art.br, murphyp@linux.ibm.com Subject: [PATCH] [powerpc] libc_feholdsetround_noex_ppc_ctx: optimize FPSCR write Date: Mon, 9 Sep 2019 11:21:07 -0500 Message-Id: <1568046067-6314-1-git-send-email-pc@us.ibm.com> From: "Paul A. Clarke" libc_feholdsetround_noex_ppc_ctx currently does, basically: 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. 2019-09-09 Paul A. Clarke * sysdeps/powerpc/fpu/fenv_private.h (libc_feholdsetround_noex_ppc_ctx): Call fesetenv_mode instead of fesetenv_register. --- Note: this patch probably depends on previously posted patch, "[powerpc] fenv_private.h clean up" to apply properly. sysdeps/powerpc/fpu/fenv_private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysdeps/powerpc/fpu/fenv_private.h b/sysdeps/powerpc/fpu/fenv_private.h index 806a385..3286b4e 100644 --- a/sysdeps/powerpc/fpu/fenv_private.h +++ b/sysdeps/powerpc/fpu/fenv_private.h @@ -177,7 +177,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