This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][AArch64] Vectorise bswap[16,32,64]


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]