aboutsummaryrefslogtreecommitdiff
path: root/gcc/collect-utils.c
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@linaro.org>2021-05-21 16:12:58 +0000
committerChristophe Lyon <christophe.lyon@linaro.org>2021-05-26 14:38:41 +0000
commit0e1fd432e9cd5a2a4703c9ef9cc61255ea22cc49 (patch)
tree7db8bc562688d86aa64f87d23a95cd5c59205bfa /gcc/collect-utils.c
parent76898cec437561a5e74d92b98f4631b80300409d (diff)
downloadgcc-0e1fd432e9cd5a2a4703c9ef9cc61255ea22cc49.zip
gcc-0e1fd432e9cd5a2a4703c9ef9cc61255ea22cc49.tar.gz
gcc-0e1fd432e9cd5a2a4703c9ef9cc61255ea22cc49.tar.bz2
arm: Auto-vectorization for MVE: vaddv
This patch adds support for the reduc_plus_scal optab with MVE, which maps to the vaddv instruction. It moves the reduc_plus_scal_<mode> expander from neon.md to vec-common.md and adds support for MVE to it. Since vaddv uses a 32-bits accumulator, we have to truncate it's result. For instance: int32_t test__s8x16 (int8_t *a) { int i; int8_t result = 0; for (i=0; i<16; i++) { result += a[i]; } return result; } is compiled into: vldrb.8 q3, [r0] vaddv.s8 r0, q3 sxtb r0, r0 bx lr If we used uint8_t instead of int8_t, we still use vaddv.s8 r0, q3, but truncate with uxtb r0, r0. 2021-05-25 Christophe Lyon <christophe.lyon@linaro.org> gcc/ * config/arm/mve.md (mve_vaddvq_<supf><mode>): Prefix with '@'. * config/arm/neon.md (reduc_plus_scal_<mode>): Move to .. * config/arm/vec-common.md: .. here. Add support for MVE. gcc/testsuite/ * gcc.target/arm/simd/mve-vaddv-1.c: New test.
Diffstat (limited to 'gcc/collect-utils.c')
0 files changed, 0 insertions, 0 deletions