This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][AArch64] Vectorise bswap[16,32,64]
- From: Eric Christopher <echristo at gmail 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>
- Date: Tue, 15 Apr 2014 10:45:44 -0700
- Subject: Re: [PATCH][AArch64] Vectorise bswap[16,32,64]
- Authentication-results: sourceware.org; auth=none
- References: <534D172D dot 5090308 at arm dot com>
Testcase weirdness?
for (i < 0; i < N; ++i)
{
arr[i] = i;
expect[i] = __builtin_bswap64 (i);
if (y) /* Avoid vectorisation. */
abort ();
}
i < 0 :)
duplicated in all 3 testcases btw.
-eric
On Tue, Apr 15, 2014 at 4:25 AM, Kyrill Tkachov <kyrylo.tkachov@arm.com> wrote:
> Hi all,
>
> This patch enables aarch64 to vectorise bswap[16,32,64] operations by using
> the AdvancedSIMD forms of the rev[16,32,64] instructions.
>
> The TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION hook is extended to return
> the vectorised forms of __builtin_bswap* where possible and vector bswap
> patterns are added.
>
> I've added the tests in vect.exp and a new effective target check
> (vect_bswap) that can be extended for other targets in the future if they
> can also vectorise these operations. Is that ok?
>
> Bootstrapped and tested aarch64-none-linux-gnu.
>
> Ok for trunk?
>
> Thanks,
> Kyrill
>
> 2014-04-15 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
>
> * config/aarch64/aarch64-builtins.c
> (aarch64_builtin_vectorized_function): Handle BUILT_IN_BSWAP16,
> BUILT_IN_BSWAP32, BUILT_IN_BSWAP64.
> * config/aarch64/aarch64-simd.md (bswap<mode>): New pattern.
> * config/aarch64/aarch64-simd-builtins.def: Define vector bswap
> builtins.
> * config/aarch64/iterator.md (VDQHSD): New mode iterator.
> (Vrevsuff): New mode attribute.
>
> 2014-04-15 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
>
> * lib/target-supports.exp (check_effective_target_vect_bswap): New.
> * gcc.dg/vect/vect-bswap16: New test.
> * gcc.dg/vect/vect-bswap32: Likewise.
> * gcc.dg/vect/vect-bswap64: Likewise.