[PATCH, i386]: Implement atomic_fetch_sub
Paolo Bonzini
bonzini@gnu.org
Mon Oct 1 17:22:00 GMT 2012
Il 03/08/2012 17:08, Richard Henderson ha scritto:
> On 2012-08-03 08:01, Uros Bizjak wrote:
>> On Fri, Aug 3, 2012 at 4:40 PM, Richard Henderson <rth@redhat.com> wrote:
>>> On 2012-08-03 01:51, Uros Bizjak wrote:
>>>> The same reasoning goes for dynamic negation: for neg %eax,%eax value
>>>> 0x80000000 stays the same, but we have changed (x)sub to an (x)add in
>>>> the code stream.
>>>
>>> So? Did you think the xadd will trap?
>>
>> No, but can we ignore the fact that we changed xsub -0x80000000, mem
>> to xadd -0x080000000, mem?
>
> Yes, since it'll have the same effect on the bits.
In fact we can even use this trick for "xxor"...
Paolo
More information about the Gcc-patches
mailing list