aarch64: Support SVE comparisons for unpacked integers
authorRichard Sandiford <richard.sandiford@arm.com>
Wed, 11 Nov 2020 11:42:46 +0000 (11:42 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Wed, 11 Nov 2020 11:42:46 +0000 (11:42 +0000)
commit46c705e70e078f6a1920d92e49042125d5e18495
tree9b22d8160985c14baf881d68e981f7ee32c9497f
parente29dd0eb733f4b9ae03e44322c7fbe8b51eff0a4
aarch64: Support SVE comparisons for unpacked integers

This patch adds support for comparing unpacked SVE integer vectors,
such as byte elements stored in the bottom bytes of halfword
containers.  It also adds support for selects between unpacked
SVE vectors (both integer and floating-point), since selects and
compares are closely tied via the vcond optab interface.

gcc/
* config/aarch64/aarch64-sve.md (@vcond_mask_<mode><vpred>): Extend
from SVE_FULL to SVE_ALL.
(*vcond_mask_<mode><vpred>): Likewise.
(@aarch64_sel_dup<mode>): Likewise.
(vcond<SVE_FULL:mode><v_int_equiv>): Extend to...
(vcond<SVE_ALL:mode><SVE_I:mode>): ...this, but requiring the
sizes of the container modes to match.
(vcondu<SVE_FULL:mode><v_int_equiv>): Extend to...
(vcondu<SVE_ALL:mode><SVE_I:mode>): ...this.
(vec_cmp<SVE_FULL_I:mode><vpred>): Extend to...
(vec_cmp<SVE_I:mode><vpred>): ...this.
(vec_cmpu<SVE_FULL_I:mode><vpred>): Extend to...
(vec_cmpu<SVE_I:mode><vpred>): ...this.
(@aarch64_pred_cmp<cmp_op><SVE_FULL_I:mode>): Extend to...
(@aarch64_pred_cmp<cmp_op><SVE_I:mode>): ...this.
(*cmp<cmp_op><SVE_FULL_I:mode>_cc): Extend to...
(*cmp<cmp_op><SVE_I:mode>_cc): ...this.
(*cmp<cmp_op><SVE_FULL_I:mode>_ptest): Extend to...
(*cmp<cmp_op><SVE_I:mode>_ptest): ...this.
(*cmp<cmp_op><SVE_FULL_I:mode>_and): Extend to...
(*cmp<cmp_op><SVE_I:mode>_and): ...this.

gcc/testsuite/
* gcc.target/aarch64/sve/cmp_1.c: New test.
* gcc.target/aarch64/sve/cmp_2.c: Likewise.
* gcc.target/aarch64/sve/cond_arith_1.c: Add --param
aarch64-sve-compare-costs=0
* gcc.target/aarch64/sve/cond_arith_1_run.c: Likewise.
* gcc.target/aarch64/sve/cond_arith_3.c: Likewise.
* gcc.target/aarch64/sve/cond_arith_3_run.c: Likewise.
* gcc.target/aarch64/sve/mask_gather_load_7.c: Likewise.
* gcc.target/aarch64/sve/mask_load_slp_1.c: Likewise.
* gcc.target/aarch64/sve/vcond_11.c: Likewise.
* gcc.target/aarch64/sve/vcond_11_run.c: Likewise.
gcc/config/aarch64/aarch64-sve.md
gcc/testsuite/gcc.target/aarch64/sve/cmp_1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/sve/cmp_2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/sve/cond_arith_1.c
gcc/testsuite/gcc.target/aarch64/sve/cond_arith_1_run.c
gcc/testsuite/gcc.target/aarch64/sve/cond_arith_3.c
gcc/testsuite/gcc.target/aarch64/sve/cond_arith_3_run.c
gcc/testsuite/gcc.target/aarch64/sve/mask_gather_load_7.c
gcc/testsuite/gcc.target/aarch64/sve/mask_load_slp_1.c
gcc/testsuite/gcc.target/aarch64/sve/vcond_11.c
gcc/testsuite/gcc.target/aarch64/sve/vcond_11_run.c