[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240618132752.GT19790@gate.crashing.org>
Date: Tue, 18 Jun 2024 08:27:52 -0500
From: Segher Boessenkool <segher@...nel.crashing.org>
To: Michael Ellerman <mpe@...erman.id.au>
Cc: Jinglin Wen <jinglin.wen@...ngroup.cn>, npiggin@...il.com,
masahiroy@...nel.org, linux-kernel@...r.kernel.org,
christophe.leroy@...roup.eu, naveen.n.rao@...ux.ibm.com,
linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH] powerpc: Fixed duplicate copying in the early boot.
On Tue, Jun 18, 2024 at 10:12:54PM +1000, Michael Ellerman wrote:
> Segher Boessenkool <segher@...nel.crashing.org> writes:
> > On Mon, Jun 17, 2024 at 10:35:09AM +0800, Jinglin Wen wrote:
> >> + cmplwi cr0,r4,0 /* runtime base addr is zero */
> >
> > Just write
> > cmpwi r4,0
> >
> > cr0 is the default, also implicit in many other instructions, please
> > don't clutter the source code. All the extra stuff makes you miss the
> > things that do matter!
> >
> > The "l" is unnecessary, you only care about equality here after all.
>
> In my mind it's an unsigned comparison, so I'd use cmpld, even though as
> you say all we actually care about is equality.
We want to know if it is zero or not, so in my mind "unsigned comparison"
does not apply at all, that is only for range checks. Heh.
But it doesn't matter at all: if you think cmpld looks more natural / is
what you expect to see, then you should use cmpld, that is my point :-)
Segher
Powered by blists - more mailing lists