On Tue, Apr 10, 2012 at 07:42:53AM -0700, H.J. Lu wrote: > > Attached patch implements HLE support for __atomic_compare_exchange_n. > > > > So, to emit HLE prefix, it is possible to do: > > int > > foo2 (int *p, int oldv, int newv) > > { > > __atomic_compare_exchange_n (p, &oldv, newv, 0, __ATOMIC_ACQUIRE | > > __ATOMIC_USE_HLE, __ATOMIC_ACQUIRE); > > return oldv; > > } > > This is wrong since HLE ACQUIRE/RELEASE has nothing to do with > C++ atomic acquire/release. You can have HLE RELEASE with C++ > atomic acquire.
Yes, of course, there should be two bits for HLE rather than one. Jakub