From: Peter Zijlstra <peterz@infradead.org>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: "Geert Uytterhoeven" <geert@linux-m68k.org>,
"Linus Torvalds" <torvalds@linux-foundation.org>,
"Ingo Molnar" <mingo@kernel.org>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Will Deacon" <will.deacon@arm.com>,
"Paul McKenney" <paulmck@linux.vnet.ibm.com>,
boqun.feng@gmail.com, waiman.long@hpe.com,
"Frédéric Weisbecker" <fweisbec@gmail.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Linux-Arch <linux-arch@vger.kernel.org>,
"Richard Henderson" <rth@twiddle.net>,
"Vineet Gupta" <vgupta@synopsys.com>,
"Russell King" <linux@arm.linux.org.uk>,
"Hans-Christian Noren Egtvedt" <egtvedt@samfundet.no>,
"Miao Steven" <realmz6@gmail.com>,
"Yoshinori Sato" <ysato@users.sourceforge.jp>,
"Richard Kuo" <rkuo@codeaurora.org>,
"Tony Luck" <tony.luck@intel.com>,
"James Hogan" <james.hogan@imgtec.com>,
"Ralf Baechle" <ralf@linux-mips.org>,
"David Howells" <dhowells@redhat.com>
Subject: Re: [PATCH -v2 14/33] locking,m68k: Implement atomic_fetch_{add,sub,and,or,xor}()
Date: Thu, 16 Jun 2016 16:35:30 +0200 [thread overview]
Message-ID: <20160616143530.GG30921@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <mvma8ilxpl6.fsf@hawking.suse.de>
On Thu, Jun 16, 2016 at 02:53:09PM +0200, Andreas Schwab wrote:
> Peter Zijlstra <peterz@infradead.org> writes:
> > OK, care to elucidate? Clearly I need help reading this.
>
> grep '2.*atomic_read'
Much thanks to your detailed answer I found yet another obscure inline
asm syntax 'feature'.
So the "2" input operand actually sets the value of "=&d" (tmp), how
creative...
I would find:
#define ATOMIC_OP_RETURN(op, c_op, asm_op) \
static inline int atomic_##op##_return(int i, atomic_t *v) \
{ \
int t, tmp = atomic_read(v); \
\
__asm__ __volatile__( \
"1: movel %2,%1\n" \
" " #asm_op "l %3,%1\n" \
" casl %2,%1,%0\n" \
" jne 1b" \
: "+m" (*v), "=&d" (t), "+d" (tmp) \
: "g" (i)); \
return t; \
}
Much more obvious.
But you're right, it seems to be sorted. I'll queue a patch removing
that comment.
Thanks!
next prev parent reply other threads:[~2016-06-16 14:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20160531101925.702692792@infradead.org>
[not found] ` <20160531102642.333689893@infradead.org>
2016-06-16 10:08 ` [PATCH -v2 14/33] locking,m68k: Implement atomic_fetch_{add,sub,and,or,xor}() Geert Uytterhoeven
2016-06-16 10:13 ` Peter Zijlstra
[not found] ` <20160616101309.GD30921@twins.programming.kicks-ass.net>
2016-06-16 12:43 ` Andreas Schwab
[not found] ` <mvmk2hpxq1a.fsf@hawking.suse.de>
2016-06-16 12:49 ` Peter Zijlstra
[not found] ` <20160616124949.GF30921@twins.programming.kicks-ass.net>
2016-06-16 12:53 ` Andreas Schwab
[not found] ` <mvma8ilxpl6.fsf@hawking.suse.de>
2016-06-16 14:35 ` Peter Zijlstra [this message]
2016-06-16 14:37 ` Andreas Schwab
[not found] ` <mvma8ilw66n.fsf@hawking.suse.de>
2016-06-16 14:56 ` Peter Zijlstra
[not found] ` <20160616145653.GH30921@twins.programming.kicks-ass.net>
2016-06-16 15:04 ` Andreas Schwab
[not found] ` <mvm4m8tw4xz.fsf@hawking.suse.de>
2016-06-16 17:44 ` Peter Zijlstra
[not found] ` <20160616174421.GK30921@twins.programming.kicks-ass.net>
2016-06-16 19:18 ` Andreas Schwab
2016-06-16 19:55 ` Geert Uytterhoeven
2016-06-17 15:40 ` Peter Zijlstra
[not found] ` <20160617154024.GY30154@twins.programming.kicks-ass.net>
2016-06-20 17:47 ` Andreas Schwab
[not found] ` <87twgniwh7.fsf@linux-m68k.org>
2016-06-21 4:27 ` Finn Thain
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=20160616143530.GG30921@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=boqun.feng@gmail.com \
--cc=dhowells@redhat.com \
--cc=egtvedt@samfundet.no \
--cc=fweisbec@gmail.com \
--cc=geert@linux-m68k.org \
--cc=james.hogan@imgtec.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mingo@kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=ralf@linux-mips.org \
--cc=realmz6@gmail.com \
--cc=rkuo@codeaurora.org \
--cc=rth@twiddle.net \
--cc=schwab@linux-m68k.org \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=torvalds@linux-foundation.org \
--cc=vgupta@synopsys.com \
--cc=waiman.long@hpe.com \
--cc=will.deacon@arm.com \
--cc=ysato@users.sourceforge.jp \
/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