From: Peter Zijlstra <peterz@infradead.org>
To: will.deacon@arm.com, mingo@kernel.org
Cc: linux-kernel@vger.kernel.org, longman@redhat.com,
andrea.parri@amarulasolutions.com, tglx@linutronix.de,
bigeasy@linutronix.de, hpa@linux.intel.com, JBeulich@suse.com,
bp@alien8.de
Subject: Re: [PATCH v2 3/4] x86/asm: Simplify GEN_*_RMWcc() macros
Date: Thu, 4 Oct 2018 11:18:47 +0200 [thread overview]
Message-ID: <20181004091847.GJ19272@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20181003130957.108960094@infradead.org>
On Wed, Oct 03, 2018 at 03:03:00PM +0200, Peter Zijlstra wrote:
> +#define __GEN_RMWcc(fullop, _var, cc, clobbers, ...) \
> +({ \
> + __label__ cc_label; \
> asm_volatile_goto (fullop "; j" #cc " %l[cc_label]" \
> + : : [var] "m" (_var), ## __VA_ARGS__ \
> : clobbers : cc_label); \
> + 0; \
> cc_label: \
> + 1; \
> +})
That's obviously crap...
This one seems to actually compile and generate identical code:
#define __GEN_RMWcc(fullop, _var, cc, clobbers, ...) \
({ \
bool c = false; \
asm_volatile_goto (fullop "; j" #cc " %l[cc_label]" \
: : [var] "m" (_var), ## __VA_ARGS__ \
: clobbers : cc_label); \
if (0) { \
cc_label: c = true; \
} \
c; \
})
next prev parent reply other threads:[~2018-10-04 9:36 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-03 13:02 [PATCH v2 0/4] locking/qspinlock, x86: Improve determinism for x86 Peter Zijlstra
2018-10-03 13:02 ` [PATCH v2 1/4] locking/qspinlock: Re-order code Peter Zijlstra
2018-10-03 13:02 ` [PATCH v2 2/4] locking/qspinlock: Rework some comments Peter Zijlstra
2018-10-10 16:13 ` Will Deacon
2018-10-03 13:03 ` [PATCH v2 3/4] x86/asm: Simplify GEN_*_RMWcc() macros Peter Zijlstra
2018-10-04 9:18 ` Peter Zijlstra [this message]
2018-10-16 16:05 ` [tip:locking/core] x86/asm: 'Simplify' " tip-bot for Peter Zijlstra
2018-10-03 13:03 ` [PATCH v2 4/4] locking/qspinlock, x86: Provide liveness guarantee Peter Zijlstra
2018-10-10 16:12 ` Will Deacon
2018-10-12 9:22 ` Will Deacon
2018-10-16 16:06 ` [tip:locking/core] " tip-bot for Peter Zijlstra
2018-10-16 16:04 ` [tip:locking/core] locking/qspinlock: Re-order code tip-bot for Peter Zijlstra
2018-10-16 16:04 ` [tip:locking/core] locking/qspinlock: Rework some comments tip-bot for Peter Zijlstra
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=20181004091847.GJ19272@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=JBeulich@suse.com \
--cc=andrea.parri@amarulasolutions.com \
--cc=bigeasy@linutronix.de \
--cc=bp@alien8.de \
--cc=hpa@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=longman@redhat.com \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
--cc=will.deacon@arm.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
Powered by JetHome