lkml.org 
[lkml]   [2018]   [Oct]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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; \
})

\
 
 \ /
  Last update: 2018-10-04 11:36    [W:0.094 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site