This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][RTL-ifcvt] Improve conditional select ops on immediates
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>, "Zamyatin, Igor" <igor dot zamyatin at intel dot com>
- Cc: Kyrill Tkachov <kyrylo dot tkachov at arm dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Jeff Law <law at redhat dot com>
- Date: Mon, 3 Aug 2015 07:37:16 -0700
- Subject: Re: [PATCH][RTL-ifcvt] Improve conditional select ops on immediates
- Authentication-results: sourceware.org; auth=none
- References: <CAFULd4aZ21S9=hRi9A0LT+AmaMMQG5PQw_nLyi57DLgKR5_2RA at mail dot gmail dot com> <55BF666A dot 5000008 at arm dot com> <CAFULd4abNWwCBPsMm3qkUdXb4sa1TwDAK1AcxRURfOD3rJoiAA at mail dot gmail dot com>
On Mon, Aug 3, 2015 at 7:04 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Mon, Aug 3, 2015 at 3:02 PM, Kyrill Tkachov <kyrylo.tkachov@arm.com> wrote:
>>
>> On 03/08/15 13:33, Uros Bizjak wrote:
>>>
>>> Hello!
>>>
>>>> 2015-07-30 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
>>>>
>>>> * ifcvt.c (noce_try_store_flag_constants): Make logic of the case
>>>> when diff == STORE_FLAG_VALUE or diff == -STORE_FLAG_VALUE more
>>>> explicit. Prefer to add the flag whenever possible.
>>>> (noce_process_if_block): Try noce_try_store_flag_constants before
>>>> noce_try_cmove.
>>>>
>>>> 2015-07-30 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
>>>>
>>>> * gcc.target/aarch64/csel_bfx_1.c: New test.
>>>> * gcc.target/aarch64/csel_imms_inc_1.c: Likewise.
>>>
>>> This patch regressed following tests on x86_64:
>>>
>>> FAIL: gcc.target/i386/cmov2.c scan-assembler sbb
>>> FAIL: gcc.target/i386/cmov3.c scan-assembler cmov[^3]
>
> The difference for cmov3.c on x86_64 is:
>
> cmpl %esi, %edi
> movl $-5, %edx
> movl $5, %eax
> cmovg %edx, %eax
> ret
>
> vs. new code:
>
> xorl %eax, %eax
> cmpl %esi, %edi
> setle %al
> negl %eax
> andl $10, %eax
> subl $5, %eax
> ret
>
> I'm not sure old code is really better than new. HJ, do you have any
> better insight?
We are looking into it.
--
H.J.