On Wed, Apr 11, 2012 at 06:18:56PM +0200, Andi Kleen wrote:
> > I actually think it is a bad idea to imply any memory model
> > from the HLE bits. If anything, we should warn for memmodel
> > + hle bit combinations that are unlikely to DTRT.
>
> This would be a warning with _RELAXED/_CONSUME, but there may be very
> obscure situations where someone really wants that (but then there
> would be no way to get rid of the warning). So if you do that you would
> need another flag to disable the warning.
>
> The "default to ACQUIRE/RELEASE but allow override with no warning" model
> seems
> more user friendly to me.
But such a model isn't possible. The HLE bits are just some high bits
ored into the memory model enum. So, if you use
__ATOMIC_HLE_ACQUIRE, it is the same thing as
__ATOMIC_HLE_ACQUIRE | __ATOMIC_RELAXED and thus it is a relaxed xacquire,
not xacquire with default memory model.
__atomic_* builtins were introduced already in GCC 4.7, so we need to do
a compatible extension...
Jakub