qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v14 30/33] target-tilegx: Handle atomic instruct


From: Chen Gang
Subject: Re: [Qemu-devel] [PATCH v14 30/33] target-tilegx: Handle atomic instructions
Date: Wed, 26 Aug 2015 05:45:40 +0800

On 8/25/15 22:28, Richard Henderson wrote:
> On 08/25/2015 06:12 AM, Chen Gang wrote:
>>>>
>>>> Consider a bundle like
>>>>
>>>> { add r0, r0, r1 ; exch r2, r0, r3 }
>>>>
>>>> In Chen's implementation, the writeback to r0 would occur before the 
>>>> exception, and so the exch would happen to the wrong address. In my 
>>>> implementation here, the exception would occur before the writeback, and 
>>>> so the result of the add would be discarded.
>>>
>>> We use tmp regs for buffering the r0.
>>>
>>> - calculate x1 pipe, and save result to r0 tmp reg.
>>>
>>
>> Oh, typo, calculate x0 pipe, and save result to r0 tmp reg.
>>
>>> - exch the original r0 and r3 to r2 tmp reg.
>>>
>>> - set exception flag (which will cause exception, later).
>>>
>>> - save the result tmp regs to r0 or r2.
>>>
>>> - gen exception.
>
> Exactly. Now re-read what I wrote and see if you can spot the problem with 
> this.
>

OK, thanks. In my memory, originally, we discussed about related things,
you provided several good ideas (temp regs, and gen exceptions ...).
Based on them, I implemented it in this way, hope it is correct.

At present, for gcc testsuite, I met several (10+) pending issues, which
need to be fixed, next. So I guess, there must be still any issues which
we did not find in the current whole tilegx code.


Thanks.
--
Chen Gang

Open, share, and attitude like air, water, and life which God blessed
                                          

reply via email to

[Prev in Thread] Current Thread [Next in Thread]