This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, i386]: Implement atomic_fetch_sub
- From: Paolo Bonzini <bonzini at gnu dot org>
- To: Richard Henderson <rth at redhat dot com>
- Cc: Uros Bizjak <ubizjak at gmail dot com>, Richard Guenther <richard dot guenther at gmail dot com>, gcc-patches at gcc dot gnu dot org
- Date: Mon, 01 Oct 2012 19:21:48 +0200
- Subject: Re: [PATCH, i386]: Implement atomic_fetch_sub
- References: <CAFULd4ZG8hH20HR0Dix5i7C0hVz7Bm4jvmMPH9UjZYn_5gzSxw@mail.gmail.com> <CAFULd4Yna7o-BFv5CfyZQ6NnKMMyYAnO-FxnNBpOgk1LA=yo_g@mail.gmail.com> <CAFiYyc1FP6oYLh5wFe1Wk0usSUsOct1OUj+r3SqesR2-NU4wGA@mail.gmail.com> <CAFULd4agPWhPKr6DM+2uooCpMdr8tWsoUkDDKMW=bdsKCR4qBQ@mail.gmail.com> <501BE2D1.5060709@redhat.com> <CAFULd4ZeJriy8b5bVwPwpC2PWUywQDhh2kpDfZ3QaUenF2ztOA@mail.gmail.com> <501BE968.5030609@redhat.com>
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