svn commit: r358928 - in head/sys/powerpc: booke powerpc
Justin Hibbits
jhibbits at FreeBSD.org
Fri Mar 13 01:27:39 UTC 2020
Author: jhibbits
Date: Fri Mar 13 01:27:37 2020
New Revision: 358928
URL: https://svnweb.freebsd.org/changeset/base/358928
Log:
powerpc: Simplify _nodrop variants of FPU and vector register saves
No need for an extra temporary. It doesn't even help with readability.
Suggested by: kib (almost 2 years ago)
Modified:
head/sys/powerpc/booke/spe.c
head/sys/powerpc/powerpc/altivec.c
head/sys/powerpc/powerpc/fpu.c
Modified: head/sys/powerpc/booke/spe.c
==============================================================================
--- head/sys/powerpc/booke/spe.c Fri Mar 13 01:06:08 2020 (r358927)
+++ head/sys/powerpc/booke/spe.c Fri Mar 13 01:27:37 2020 (r358928)
@@ -183,14 +183,11 @@ save_vec(struct thread *td)
void
save_vec_nodrop(struct thread *td)
{
- struct thread *vtd;
struct pcb *pcb;
int i;
- vtd = PCPU_GET(vecthread);
- if (td == vtd) {
+ if (td == PCPU_GET(vecthread))
save_vec_int(td);
- }
pcb = td->td_pcb;
Modified: head/sys/powerpc/powerpc/altivec.c
==============================================================================
--- head/sys/powerpc/powerpc/altivec.c Fri Mar 13 01:06:08 2020 (r358927)
+++ head/sys/powerpc/powerpc/altivec.c Fri Mar 13 01:27:37 2020 (r358928)
@@ -168,12 +168,7 @@ save_vec(struct thread *td)
void
save_vec_nodrop(struct thread *td)
{
- struct thread *vtd;
- vtd = PCPU_GET(vecthread);
- if (td != vtd) {
- return;
- }
-
- save_vec_int(td);
+ if (td == PCPU_GET(vecthread))
+ save_vec_int(td);
}
Modified: head/sys/powerpc/powerpc/fpu.c
==============================================================================
--- head/sys/powerpc/powerpc/fpu.c Fri Mar 13 01:06:08 2020 (r358927)
+++ head/sys/powerpc/powerpc/fpu.c Fri Mar 13 01:27:37 2020 (r358928)
@@ -204,12 +204,7 @@ save_fpu(struct thread *td)
void
save_fpu_nodrop(struct thread *td)
{
- struct thread *ftd;
- ftd = PCPU_GET(fputhread);
- if (td != ftd) {
- return;
- }
-
- save_fpu_int(td);
+ if (td == PCPU_GET(fputhread))
+ save_fpu_int(td);
}
More information about the svn-src-head
mailing list