linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: masahiroy@kernel.org, linux-kernel@vger.kernel.org,
	christophe.leroy@csgroup.eu, npiggin@gmail.com,
	naveen.n.rao@linux.ibm.com, linuxppc-dev@lists.ozlabs.org,
	Jinglin Wen <jinglin.wen@shingroup.cn>
Subject: Re: [PATCH] powerpc: Fixed duplicate copying in the early boot.
Date: Tue, 18 Jun 2024 08:27:52 -0500	[thread overview]
Message-ID: <20240618132752.GT19790@gate.crashing.org> (raw)
In-Reply-To: <87cyoe1mbd.fsf@mail.lhotse>

On Tue, Jun 18, 2024 at 10:12:54PM +1000, Michael Ellerman wrote:
> Segher Boessenkool <segher@kernel.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

  reply	other threads:[~2024-06-18 13:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-17  2:35 [PATCH] powerpc: Fixed duplicate copying in the early boot Jinglin Wen
2024-06-17 11:28 ` Michael Ellerman
2024-06-18  9:34   ` Jinglin Wen
2024-06-17 16:13 ` Segher Boessenkool
2024-06-18  9:40   ` Jinglin Wen
2024-06-18 12:12   ` Michael Ellerman
2024-06-18 13:27     ` Segher Boessenkool [this message]
2024-06-20  2:41 ` [PATCH v2] powerpc: Fix unnecessary copy to 0 when kernel is booted at address 0 Jinglin Wen
2024-06-24 12:30   ` Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240618132752.GT19790@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=christophe.leroy@csgroup.eu \
    --cc=jinglin.wen@shingroup.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=masahiroy@kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=naveen.n.rao@linux.ibm.com \
    --cc=npiggin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).