On 05/17/2016 10:13 AM, Sergey Fedorov wrote:
>> > +static inline void qemu_spin_lock(QemuSpin *spin)
>> > +{
>> > +    while (atomic_test_and_set_acquire(&spin->value)) {
>>From gcc-4.8 info page, node "__atomic Builtins", description of
> __atomic_test_and_set():
> 
>     It should be only used for operands of type 'bool' or 'char'.
> 

Hum.  I thought I remembered all operand sizes there, but I've just re-checked
and you're right about bool (and really only bool).

Perhaps we should just stick with __sync_test_and_set then.  I'm thinking here
of e.g. armv6, a reasonable host, which can't operate on 1 byte atomic values.


r~

Reply via email to