This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PR66776][PATCH][AARCH64] Add cmovdi_insn_uxtw pattern.
- From: pinskia at gmail dot com
- To: Renlin Li <renlin dot li at arm dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Kyrill Tkachov <kyrylo dot tkachov at arm dot com>, Ramana Radhakrishnan <Ramana dot Radhakrishnan at arm dot com>
- Date: Thu, 6 Aug 2015 11:48:30 +0200
- Subject: Re: [PR66776][PATCH][AARCH64] Add cmovdi_insn_uxtw pattern.
- Authentication-results: sourceware.org; auth=none
- References: <55C32B8A dot 7080007 at arm dot com>
> On Aug 6, 2015, at 11:40 AM, Renlin Li <renlin.li@arm.com> wrote:
>
> Hi all,
>
> This is a simple patch to add a new cmovdi_insn_uxtw rtx pattern to aarch64 backend.
>
> For the following simple test case:
>
> unsigned long
> foo (unsigned int a, unsigned int b, unsigned int c)
> {
> return a ? b : c;
> }
>
> With this new pattern, the new code-generation will be:
>
> cmp w0, wzr
> csel x0, x2, x1, eq
Your example Shows you have the wrong operand types to csel. In the aarch64 abi arguments don't need to be zero extended and your csel will not be zero extending the arguments.
Note you should also use unsigned long long in the testcase so it is ilp32 and llp64l32 friendly.
Thanks,
Andrew
> ret
>
> Without the path, the old code-generation is like this:
> uxtw x1, w1
> cmp w0, wzr
> uxtw x2, w2
> csel x0, x2, x1, eq
> ret
>
>
> aarch64-none-elf regression test Okay. Okay to commit?
>
> Regards,
> Renlin Li
>
> gcc/ChangeLog:
>
> 2015-08-06 Renlin Li <renlin.li@arm.com>
>
> PR target/66776
> * config/aarch64/aarch64.md (cmovdi_insn_uxtw): New pattern.
>
> gcc/testsuite/ChangeLog:
>
> 2015-08-06 Renlin Li <renlin.li@arm.com>
>
> PR target/66776
> * gcc.target/aarch64/pr66776.c: New.
>
>
>
> <new-1.diff>