]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/config/arm/mve.md
arm: Auto-vectorization for MVE: vabs
authorChristophe Lyon <christophe.lyon@linaro.org>
Thu, 3 Jun 2021 12:06:38 +0000 (12:06 +0000)
committerChristophe Lyon <christophe.lyon@linaro.org>
Thu, 3 Jun 2021 12:06:38 +0000 (12:06 +0000)
commitf4242710c7966a965bbd14cd50ecdba28fd5717e
tree6680644bbeaba68bfc680b6a61e00a702c81c79c
parent1eff5289b273041c9d71a4829c2600d283186ab6
arm: Auto-vectorization for MVE: vabs

This patch adds support for auto-vectorization of absolute value
computation using vabs.

We use a similar pattern to what is used in neon.md and extend the
existing neg<mode>2 expander to match both 'neg' and 'abs'.  This
implies renaming the existing abs<mode>2 define_insn in neon.md to
avoid a clash with the new expander with the same name.

2021-06-03  Christophe Lyon  <christophe.lyon@linaro.org>

gcc/
* config/arm/mve.md (mve_vabsq_f<mode>): Use 'abs' instead of unspec.
(mve_vabsq_s<mode>): Likewise.
* config/arm/neon.md (abs<mode>2): Rename to neon_abs<mode>2.
* config/arm/unspecs.md (VABSQ_F, VABSQ_S): Delete.
* config/arm/vec-common.md (neg<mode>2): Rename to
<absneg_str><mode>2.

gcc/testsuite/
* gcc.target/arm/simd/mve-vabs.c: New test.
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-vabs.c [new file with mode: 0644]