aarch64: Reimplement vaddlv* intrinsics using builtins
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>
Thu, 28 Jan 2021 13:10:07 +0000 (13:10 +0000)
committerKyrylo Tkachov <kyrylo.tkachov@arm.com>
Fri, 29 Jan 2021 13:49:19 +0000 (13:49 +0000)
commitcb995de62aa6484dba4f9807ee3c8d2959a40c46
treead8d0d7b7a8db0da9f31d841ace5f36042415e81
parente053f96a9f57bb73a47bdd96512ed1c83ff84c04
aarch64: Reimplement vaddlv* intrinsics using builtins

This patch reimplements the vaddlv* intrinsics using builtins.
The vaddlv_s32 and vaddlv_u32 intrinsics actually perform a pairwise
SADDLP/UADDLP instead of a SADDLV/UADDLV but because they only use
two elements it has the same semantics.

gcc/ChangeLog:

* config/aarch64/aarch64-simd-builtins.def (saddlv, uaddlv):
Define builtins.
* config/aarch64/aarch64-simd.md (aarch64_<su>addlv<mode>):
Define.
* config/aarch64/arm_neon.h (vaddlv_s8): Reimplement using
builtin.
(vaddlv_s16): Likewise.
(vaddlv_u8): Likewise.
(vaddlv_u16): Likewise.
(vaddlvq_s8): Likewise.
(vaddlvq_s16): Likewise.
(vaddlvq_s32): Likewise.
(vaddlvq_u8): Likewise.
(vaddlvq_u16): Likewise.
(vaddlvq_u32): Likewise.
(vaddlv_s32): Likewise.
(vaddlv_u32): Likewise.
* config/aarch64/iterators.md (VDQV_L): New mode iterator.
(unspec): Add UNSPEC_SADDLV, UNSPEC_UADDLV.
(Vwstype): New mode attribute.
(Vwsuf): Likewise.
(VWIDE_S): Likewise.
(USADDLV): New int iterator.
(su): Handle UNSPEC_SADDLV, UNSPEC_UADDLV.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/simd/vaddlv_1.c: New test.
gcc/config/aarch64/aarch64-simd-builtins.def
gcc/config/aarch64/aarch64-simd.md
gcc/config/aarch64/arm_neon.h
gcc/config/aarch64/iterators.md
gcc/testsuite/gcc.target/aarch64/simd/vaddlv_1.c [new file with mode: 0644]