[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] target-sh4: add atomic tas
From: |
Laurent Vivier |
Subject: |
Re: [Qemu-devel] [PATCH] target-sh4: add atomic tas |
Date: |
Thu, 3 Nov 2016 14:32:10 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 |
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