[AArch64] Use SVE UXT[BHW] as a form of predicated AND

Programming / Compilers / GCC - rsandifo [138bc75d-0d04-0410-961f-82ee72b054a4] - 14 August 2019 11:00 EDT

UXTB, UXTH and UXTW are equivalent to predicated ANDs with the constants 0xff, 0xffff and 0xffffffff respectively. This patch uses them in the patterns for IFN_COND_AND.

2019-08-14 Richard Sandiford

gcc/
- config/aarch64/aarch64.c (aarch64_print_operand): Allow %e to take the equivalent mask, as well as a bit count.
- config/aarch64/predicates.md (aarch64_sve_uxtb_immediate) (aarch64_sve_uxth_immediate, aarch64_sve_uxt_immediate) (aarch64_sve_pred_and_operand): New predicates.
- config/aarch64/iterators.md (sve_pred_int_rhs2_operand): New code attribute.
- config/aarch64/aarch64-sve.md (cond_): Use it. (*cond_uxt_2, *cond_uxt_any): New patterns.

gcc/testsuite/
- gcc.target/aarch64/sve/cond_uxt_1.c: New test.
- gcc.target/aarch64/sve/cond_uxt_1_run.c: Likewise.
- gcc.target/aarch64/sve/cond_uxt_2.c: Likewise.
- gcc.target/aarch64/sve/cond_uxt_2_run.c: Likewise.
- gcc.target/aarch64/sve/cond_uxt_3.c: Likewise.
- gcc.target/aarch64/sve/cond_uxt_3_run.c: Likewise.
- gcc.target/aarch64/sve/cond_uxt_4.c: Likewise.
- gcc.target/aarch64/sve/cond_uxt_4_run.c: Likewise.

0472dd7fa73 [AArch64] Use SVE UXT[BHW] as a form of predicated AND
gcc/ChangeLog | 13 +++++
gcc/config/aarch64/aarch64-sve.md | 55 +++++++++++++++++++++-
gcc/config/aarch64/aarch64.c | 28 +++++------
gcc/config/aarch64/iterators.md | 14 ++++++
gcc/config/aarch64/predicates.md | 19 ++++++++
gcc/testsuite/ChangeLog | 11 +++++
gcc/testsuite/gcc.target/aarch64/sve/cond_uxt_1.c | 40 ++++++++++++++++
.../gcc.target/aarch64/sve/cond_uxt_1_run.c | 27 +++++++++++
gcc/testsuite/gcc.target/aarch64/sve/cond_uxt_2.c | 40 ++++++++++++++++
.../gcc.target/aarch64/sve/cond_uxt_2_run.c | 27 +++++++++++
gcc/testsuite/gcc.target/aarch64/sve/cond_uxt_3.c | 39 +++++++++++++++
.../gcc.target/aarch64/sve/cond_uxt_3_run.c | 27 +++++++++++
gcc/testsuite/gcc.target/aarch64/sve/cond_uxt_4.c | 36 ++++++++++++++
.../gcc.target/aarch64/sve/cond_uxt_4_run.c | 27 +++++++++++
14 files changed, 386 insertions(+), 17 deletions(-)

Upstream: gcc.gnu.org


  • Share