]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/config/arm/mve.md
arm: Auto-vectorization for MVE: vneg
authorChristophe Lyon <christophe.lyon@linaro.org>
Mon, 7 Dec 2020 14:43:18 +0000 (14:43 +0000)
committerChristophe Lyon <christophe.lyon@linaro.org>
Mon, 14 Dec 2020 10:47:29 +0000 (10:47 +0000)
commit4cbb7cab47a3b91a12ad52baab5bbe6e4373ce73
tree94e038977c65f295ce1daabbc56138fb7e0e805e
parentfd43603414a9b7bdbac5a822af144dcd559733eb
arm: Auto-vectorization for MVE: vneg

This patch enables MVE vneg instructions for auto-vectorization.  MVE
vnegq insns in mve.md are modified to use 'neg' instead of unspec
expression.  The neg<mode>2 expander is added to vec-common.md.

Existing patterns in neon.md are prefixed with neon_.
It's not clear why we have different patterns for VDQW
and VH in neon.md, when WDQWH handles both, and patterns
with VDQ have provision for attributes for FP modes.

Another question is why <absneg_str><mode>2 always sets
neon_abs<q> type when it also handles neon_neq<q> cases.

2020-12-11  Christophe Lyon  <christophe.lyon@linaro.org>

gcc/
* config/arm/mve.md (mve_vnegq_f): Use 'neg' instead of unspec.
(mve_vnegq_s): Likewise.
* config/arm/neon.md (neg<mode>2): Rename into neon_neg<mode>2.
(<absneg_str><mode>2): Rename into neon_<absneg_str><mode>2.
(neon_v<absneg_str><mode>): Call gen_neon_<absneg_str><mode>2.
(vashr<mode>3): Call gen_neon_neg<mode>2.
(vlshr<mode>3): Call gen_neon_neg<mode>2.
(neon_vneg<mode>): Call gen_neon_neg<mode>2.
* config/arm/unspecs.md (VNEGQ_F, VNEGQ_S): Remove.
* config/arm/vec-common.md (neg<mode>2): New expander.

gcc/testsuite/
* gcc.target/arm/simd/mve-vneg.c: Add tests for vneg.
gcc/config/arm/mve.md
gcc/config/arm/neon.md
gcc/config/arm/unspecs.md
gcc/config/arm/vec-common.md
gcc/testsuite/gcc.target/arm/simd/mve-vneg.c [new file with mode: 0644]