[AArch64] Add support for SVE [SU]{MAX,MIN} immediate

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

This patch adds support for the immediate forms of SVE SMAX, SMIN, UMAX and UMIN. SMAX and SMIN take the same range as MUL, so the patch basically just moves and generalises the existing MUL patterns.

2019-08-14 Richard Sandiford

gcc/
- config/aarch64/constraints.md (vsb): New constraint. (vsm): Generalize description.
- config/aarch64/iterators.md (SVE_INT_BINARY_IMM): New code iterator. (sve_imm_con): Handle smax, smin, umax and umin. (sve_imm_prefix): New code attribute.
- config/aarch64/predicates.md (aarch64_sve_vsb_immediate) (aarch64_sve_vsb_operand): New predicates. (aarch64_sve_mul_immediate): Rename to... (aarch64_sve_vsm_immediate): ...this. (aarch64_sve_mul_operand): Rename to... (aarch64_sve_vsm_operand): ...this.
- config/aarch64/aarch64-sve.md (mul3): Generalize to... (3): ...this. (*mul3, *post_ra_mul3): Generalize to... (*3) (*post_ra_3): ...these and add movprfx support for the immediate alternatives. (3, *3): Delete in favor of the above. (*3): Fix incorrect predicate for operand 3.

gcc/testsuite/
- gcc.target/aarch64/sve/smax_1.c: New test.
- gcc.target/aarch64/sve/smin_1.c: Likewise.
- gcc.target/aarch64/sve/umax_1.c: Likewise.
- gcc.target/aarch64/sve/umin_1.c: Likewise.

0508573c8d6 [AArch64] Add support for SVE [SU]{MAX,MIN} immediate
gcc/ChangeLog | 25 ++++
gcc/config/aarch64/aarch64-sve.md | 177 ++++++++++----------------
gcc/config/aarch64/constraints.md | 12 +-
gcc/config/aarch64/iterators.md | 17 ++-
gcc/config/aarch64/predicates.md | 18 ++-
gcc/testsuite/ChangeLog | 7 +
gcc/testsuite/gcc.target/aarch64/sve/smax_1.c | 71 +++++++++++
gcc/testsuite/gcc.target/aarch64/sve/smin_1.c | 71 +++++++++++
gcc/testsuite/gcc.target/aarch64/sve/umax_1.c | 65 ++++++++++
gcc/testsuite/gcc.target/aarch64/sve/umin_1.c | 65 ++++++++++
10 files changed, 409 insertions(+), 119 deletions(-)

Upstream: gcc.gnu.org


  • Share