Message ID | 1568918810-20393-5-git-send-email-pc@us.ibm.com |
---|---|
State | Superseded |
Headers |
Received: (qmail 70745 invoked by alias); 19 Sep 2019 18:47:02 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <libc-alpha.sourceware.org> List-Unsubscribe: <mailto:libc-alpha-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:libc-alpha-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 70690 invoked by uid 89); 19 Sep 2019 18:47:01 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 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=HX-Languages-Length:1226 X-HELO: mx0a-001b2d01.pphosted.com From: "Paul A. Clarke" <pc@us.ibm.com> To: libc-alpha@sourceware.org Cc: tuliom@ascii.art.br, murphyp@linux.ibm.com Subject: [PATCH v2 4/6] [powerpc] libc_feholdsetround_noex_ppc_ctx: optimize FPSCR write Date: Thu, 19 Sep 2019 13:46:48 -0500 Message-Id: <1568918810-20393-5-git-send-email-pc@us.ibm.com> In-Reply-To: <1568918810-20393-1-git-send-email-pc@us.ibm.com> References: <1568918810-20393-1-git-send-email-pc@us.ibm.com> |
Commit Message
Paul A. Clarke
Sept. 19, 2019, 6:46 p.m. UTC
From: "Paul A. Clarke" <pc@us.ibm.com>
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-19 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.
---
v2: No change.
sysdeps/powerpc/fpu/fenv_private.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 9/19/19 1:46 PM, Paul A. Clarke wrote: > From: "Paul A. Clarke" <pc@us.ibm.com> > > libc_feholdsetround_noex_ppc_ctx currently does, basically: The listing reads awkwardly for me. I suggest a little cleanup. There is no need to post a new patch against my suggestion. > 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-19 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. > --- > v2: No change. > > 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 9496026..ade0bfa 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 > OK, with suggested cleanup to commit message. Reviewed-By: Paul E Murphy <murphyp@linux.ibm.com>
Thanks for the review, Paul! Question... On 9/23/19 10:54 AM, Paul E Murphy wrote: > On 9/19/19 1:46 PM, Paul A. Clarke wrote: >> libc_feholdsetround_noex_ppc_ctx currently does, basically: > The listing reads awkwardly for me. I suggest a little cleanup. There is no need to post a new patch against my suggestion. Here you say "listing", and there is a list (1-2-3) immediately below this text, and below you say "commit message", . Where would you like to see improvement? Happy to change, but it's hard for me to see what you're seeing. (And, of course, it's all perfectly clear to me since I wrote it! ;-) >> 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-19 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. >> --- >> v2: No change. >> >> 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 9496026..ade0bfa 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 >> > > OK, with suggested cleanup to commit message. > > Reviewed-By: Paul E Murphy <murphyp@linux.ibm.com> PC
On 9/23/19 12:54 PM, Paul Clarke wrote: > Thanks for the review, Paul! Question... > > On 9/23/19 10:54 AM, Paul E Murphy wrote: >> On 9/19/19 1:46 PM, Paul A. Clarke wrote: >>> libc_feholdsetround_noex_ppc_ctx currently does, basically: >> The listing reads awkwardly for me. I suggest a little cleanup. There is no need to post a new patch against my suggestion. > > Here you say "listing", and there is a list (1-2-3) immediately below this text, and below you say "commit message", . Where would you like to see improvement? Happy to change, but it's hard for me to see what you're seeing. (And, of course, it's all perfectly clear to me since I wrote it! ;-) > >>> 1. Read FPSCR, save to context. >>> 2. Create new FPSCR value: clear enables and set new rounding mode. >>> 3. Write new value to FPSCR. >>> I think the change of tense and verb leading into the list threw me off. Feel free to commit with or without changes as the message does convey the intent of the patch.
diff --git a/sysdeps/powerpc/fpu/fenv_private.h b/sysdeps/powerpc/fpu/fenv_private.h index 9496026..ade0bfa 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