[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210604154718.GE18427@gate.crashing.org>
Date: Fri, 4 Jun 2021 10:47:18 -0500
From: Segher Boessenkool <segher@...nel.crashing.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Will Deacon <will@...nel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
paulmck@...nel.org, stern@...land.harvard.edu,
parri.andrea@...il.com, boqun.feng@...il.com, npiggin@...il.com,
dhowells@...hat.com, j.alglave@....ac.uk, luc.maranget@...ia.fr,
akiyks@...il.com, linux-kernel@...r.kernel.org,
linux-toolchains@...r.kernel.org, linux-arch@...r.kernel.org
Subject: Re: [RFC] LKMM: Add volatile_if()
On Fri, Jun 04, 2021 at 01:31:48PM +0200, Peter Zijlstra wrote:
> On Fri, Jun 04, 2021 at 11:44:00AM +0100, Will Deacon wrote:
> > > +{
> > > + asm_volatile_goto("cbnz %0, %l[l_yes]"
> > > + : : "r" (cond) : "cc", "memory" : l_yes);
> > > + return 0;
> > > +l_yes:
> > > + return 1;
> > > +}
> >
> > nit: you don't need the "cc" clobber here.
>
> Yeah I know, "cc" is implied.
It isn't needed at all here. cbnz does not write to the condition
register. Neither does it change or access memory, but the "memory"
clobber is to force a false dependency. Writing "cc" as well looks a
bit confusing, given that.
Segher
Powered by blists - more mailing lists