Messages in this thread | | | Date | Thu, 4 Oct 2018 11:18:47 +0200 | From | Peter Zijlstra <> | 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; \ })
| |