This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][ARM][3/3] Implement negsicc, notsicc optabs
- From: Ramana Radhakrishnan <ramana dot radhakrishnan at foss dot arm dot com>
- To: Kyrill Tkachov <kyrylo dot tkachov at arm dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Richard Earnshaw <Richard dot Earnshaw at arm dot com>, Ramana Radhakrishnan <ramana dot radhakrishnan at arm dot com>
- Date: Thu, 10 Sep 2015 10:09:59 +0100
- Subject: Re: [PATCH][ARM][3/3] Implement negsicc, notsicc optabs
- Authentication-results: sourceware.org; auth=none
- References: <55E5BFE9 dot 7030301 at arm dot com>
On 01/09/15 16:10, Kyrill Tkachov wrote:
> [Resending with patch attached]
>
> Hi all,
>
> This third patch implements the new optabs for arm.
> Conveniently, we can reuse the recently refactored *if_neg_move pattern
> and extend it to cover the conditional NOT case.
> Although arm has conditional execution capabilities I have found that
> performing the transformation from patch 1/3 early on benefits arm as well.
> For example for code:
> int
> foonegsi (int a)
> {
> return a ? 25089992 : -25089992;
> }
>
> we currently generate:
> movw r2, #55240
> movw r3, #10296
> cmp r0, #0
> movt r2, 382
> movt r3, 65153
> movne r0, r2
> moveq r0, r3
> bx
>
> whereas with this patch we generate:
> movw r3, #10296
> cmp r0, #0
> movt r3, 65153
> mov r0, r3
> rsbne r0, r3, #0
> bx lr
>
>
> In SPEC2006 this doesn't trigger very often, so there were minimal code differences,
> but overall I claim this patch is an improvement.
>
> Bootstrapped and tested on arm-none-linux-gnueabihf.
>
> Ok for trunk if the midend changes in 1/3 are approved?
OK.
Thanks,
Ramana
>
> Thanks,
> Kyrill
>
> 2015-08-20 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
>
> * config/arm/arm.md (<NOT_NEG_op>sicc): New define_expand.
> (*if_neg_move): Rename to...
> (*if_<NOT_NEG_op>_move): ... This. Use NOT_NEG code iterator.
> * config/arm/iterators.md (NOT_NEG): New code iterator.
> (NOT_NEG_op): New code attribute.
>
> 2015-08-20 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
>
> * gcc.target/arm/cond_op_imm_1.c: New test.