Le 03/11/2016 à 14:29, Paolo Bonzini a écrit :
> 
> 
> On 03/11/2016 14:12, Laurent Vivier wrote:
>> Implement real atomic tas.
>>
>> As tas is:
>>
>>     When (Rn) = 0, 1 -> T
>>     Otherwise, 0 -> T
>>     In both cases, 1 -> MSB of (Rn)
>>
>> It can't be implemented using cmpxchg().
> 
> Why not?

Only because I don't know :)

> This is essentially
> 
>     movi              temp0, 0x80
>     atomic_fetch_or_i32 temp1, Rn, temp0, ctx->memidx, MO_UB
>     setcondi_i32      cpu_sr_t, TCG_COND_EQ, temp1, 0
> 
> But the patch looks good anyway.

I'm going to rewrite it as you say...

Thanks,
Laurent

Reply via email to