Re: cmpxchg and x86 flags output

From: H. Peter Anvin
Date: Wed Jun 22 2016 - 12:37:46 EST


On 06/22/16 09:11, David Howells wrote:
> H. Peter Anvin <hpa@xxxxxxxxx> wrote:
>
>> The question for me is for things like lock patching that we do on x86...
>
> This might be pertinent to what you're asking:
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70973
>

I am kind of hesitant to put knowledge of this into gcc, because it
freezes something that currently is not gcc-dependent (although we could
separate out the gcc-generated and non-gcc-generated bits if we really
care.) With the gcc flags output we can do this with assembly code as
well today (on x86), so it is unclear if we have any compelling reason
to need intrinsics that we won't be able to rely on existing for a long
time (the difference between gcc versions that have flags support and
don't have it has already been abstracted out in the x86/asm branch of
the tip tree, so we don't need two versions.)

-hpa