aarch64: Add general unpacked SVE conditional binary arithmetic
authorRichard Sandiford <richard.sandiford@arm.com>
Mon, 11 Jan 2021 18:03:22 +0000 (18:03 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Mon, 11 Jan 2021 18:03:22 +0000 (18:03 +0000)
commitab76e3db6b8ca92cdd76870e0e9f217abcc62131
tree6348044abb6e2e355eba798214ae8b238c6fb230
parent48c7f5b88116c894d76209db0f47216ed5ccd333
aarch64: Add general unpacked SVE conditional binary arithmetic

This patch adds support for conditional binary ADD, SUB, MUL, SMAX,
UMAX, SMIN, UMIN, LSL, LSR, ASR, AND, ORR and EOR.  It's not really
possible to split it up further given how the patterns are written.

Min, max and right-shift need the element size rather than the container
size.  The others would work with both, although MUL should be more
efficient when applied to elements instead of containers.

gcc/
* config/aarch64/aarch64-sve.md (@cond_<SVE_INT_BINARY:optab><mode>)
(*cond_<SVE_INT_BINARY:optab><mode>_2): Extend from SVE_FULL_I
to SVE_I.
(*cond_<SVE_INT_BINARY:optab><mode>_3): Likewise.
(*cond_<SVE_INT_BINARY:optab><mode>_any): Likewise.
(*cond_<SVE_INT_BINARY:optab><mode>_2_const): Likewise.
(*cond_<SVE_INT_BINARY:optab><mode>_any_const): Likewise.

gcc/testsuite/
* g++.target/aarch64/sve/cond_arith_1.C: New test.
* g++.target/aarch64/sve/cond_arith_2.C: Likewise.
* g++.target/aarch64/sve/cond_arith_3.C: Likewise.
* g++.target/aarch64/sve/cond_arith_4.C: Likewise.
* g++.target/aarch64/sve/cond_shift_1.C: New test.
* g++.target/aarch64/sve/cond_shift_2.C: Likewise.
* g++.target/aarch64/sve/cond_shift_3.C: Likewise.
* g++.target/aarch64/sve/cond_shift_4.C: Likewise.
gcc/config/aarch64/aarch64-sve.md
gcc/testsuite/g++.target/aarch64/sve/cond_arith_1.C [new file with mode: 0644]
gcc/testsuite/g++.target/aarch64/sve/cond_arith_2.C [new file with mode: 0644]
gcc/testsuite/g++.target/aarch64/sve/cond_arith_3.C [new file with mode: 0644]
gcc/testsuite/g++.target/aarch64/sve/cond_arith_4.C [new file with mode: 0644]
gcc/testsuite/g++.target/aarch64/sve/cond_shift_1.C [new file with mode: 0644]
gcc/testsuite/g++.target/aarch64/sve/cond_shift_2.C [new file with mode: 0644]
gcc/testsuite/g++.target/aarch64/sve/cond_shift_3.C [new file with mode: 0644]
gcc/testsuite/g++.target/aarch64/sve/cond_shift_4.C [new file with mode: 0644]