[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181004091847.GJ19272@hirez.programming.kicks-ass.net>
Date: Thu, 4 Oct 2018 11:18:47 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: will.deacon@....com, mingo@...nel.org
Cc: linux-kernel@...r.kernel.org, longman@...hat.com,
andrea.parri@...rulasolutions.com, tglx@...utronix.de,
bigeasy@...utronix.de, hpa@...ux.intel.com, JBeulich@...e.com,
bp@...en8.de
Subject: Re: [PATCH v2 3/4] x86/asm: Simplify GEN_*_RMWcc() macros
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; \
})
Powered by blists - more mailing lists