Re: [RFC PATCH 00/15] Provide atomics and bitops implemented with ISO C++11 atomics

From: Peter Zijlstra
Date: Wed May 18 2016 - 13:23:12 EST


On Wed, May 18, 2016 at 04:10:37PM +0100, David Howells wrote:
> There are some advantages to using ISO C++11 atomics:
>
> (1) The compiler can make use of extra information, such as condition
> flags, that are tricky to get out of inline assembly in an efficient
> manner. This should reduce the number of instructions required in
> some cases - such as in x86 where we use SETcc to store the condition
> inside the inline asm and then CMP outside to put it back again.
>
> Whilst this can be alleviated by the use of asm-goto constructs, this
> adds mandatory conditional jumps where the use of CMOVcc and SETcc
> might be better.

Supposedly gcc-6.1 has cc-output which makes this go away.