This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][ARM/AArch64] Properly cost rev16 operand
- From: James Greenhalgh <james dot greenhalgh at arm dot com>
- To: Kyrill Tkachov <kyrylo dot tkachov at arm dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Marcus Shawcroft <Marcus dot Shawcroft at arm dot com>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>, Ramana Radhakrishnan <Ramana dot Radhakrishnan at arm dot com>
- Date: Tue, 26 May 2015 09:49:27 +0100
- Subject: Re: [PATCH][ARM/AArch64] Properly cost rev16 operand
- Authentication-results: sourceware.org; auth=none
- References: <55433834 dot 10206 at arm dot com>
On Fri, May 01, 2015 at 09:24:20AM +0100, Kyrill Tkachov wrote:
> Hi all,
>
> It occurs to me that in the IOR-of-shifts form of the rev16 operation we
> should be costing the operand properly. For that we'd want to reuse the
> aarch_rev16_p function that does all the heavy lifting and get it to write
> the innermost operand of the rev16 for further costing. In the process we
> relax that function a bit to accept any rtx as the operand, not just REGs so
> that we can calculate the cost of moving them in a register appropriately.
>
> This patch does just that and updates the arm and aarch64 callsites
> appropriately so that the operands are processed properly.
>
> In practice I don't expect this to make much difference since this patterns
> occurs rarely anyway, but it seems like the 'right thing to do' (TM).
>
> Bootstrapped and tested on arm,aarch64.
>
> Ok for trunk?
Looks OK for aarch64, please wait for an Ack from an arm maintainer.
Cheers,
James
> 2015-05-01 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
>
> * config/arm/aarch-common-protos.h (aarch_rev16_p): Update signature
> to take a second argument.
> * config/arm/aarch-common.c (aarch_rev16_p): Add second argument.
> Write inner-most rev16 argument to it if recognised.
> (aarch_rev16_p_1): Likewise.
> * config/arm/arm.c (arm_new_rtx_costs): Properly cost rev16 operand
> in the IOR case.
> * config/aarch64/aarch64.c (aarch64_rtx_costs): Likewise.