aarch64: Add support for unpacked SVE ASRD
authorRichard Sandiford <richard.sandiford@arm.com>
Mon, 11 Jan 2021 18:03:26 +0000 (18:03 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Mon, 11 Jan 2021 18:03:26 +0000 (18:03 +0000)
commita958b2fc6dab3d8b01b6ee32178e2fccd97f77f8
treec4df114cbe0aca1cafd28f6115cb396bdf2b515b
parent37426e0f060447cf059f3846275a157084dfdfe5
aarch64: Add support for unpacked SVE ASRD

This patch adds support for both conditional and unconditional unpacked
ASRD.  This meant adding a new define_insn for the unconditional form,
instead of reusing the conditional instructions.  It also meant
extending the current conditional patterns to support merging with
any independent value, not just zero.

gcc/
* config/aarch64/aarch64-sve.md (sdiv_pow2<mode>3): Extend from
SVE_FULL_I to SVE_I.  Generate an UNSPEC_PRED_X.
(*sdiv_pow2<mode>3): New pattern.
(@cond_<sve_int_op><mode>): Extend from SVE_FULL_I to SVE_I.
Wrap the ASRD in an UNSPEC_PRED_X.
(*cond_<sve_int_op><mode>_2): Likewise.  Replace the UNSPEC_PRED_X
predicate with a constant PTRUE, if it isn't already.
(*cond_<sve_int_op><mode>_z): Replace with...
(*cond_<sve_int_op><mode>_any): ...this new pattern.

gcc/testsuite/
* gcc.target/aarch64/sve/asrdiv_4.c: New test.
* gcc.target/aarch64/sve/cond_asrd_1.c: Likewise.
* gcc.target/aarch64/sve/cond_asrd_1_run.c: Likewise.
* gcc.target/aarch64/sve/cond_asrd_2.c: Likewise.
* gcc.target/aarch64/sve/cond_asrd_2_run.c: Likewise.
* gcc.target/aarch64/sve/cond_asrd_3.c: Likewise.
* gcc.target/aarch64/sve/cond_asrd_3_run.c: Likewise.
gcc/config/aarch64/aarch64-sve.md
gcc/testsuite/gcc.target/aarch64/sve/asrdiv_4.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/sve/cond_asrd_1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/sve/cond_asrd_1_run.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/sve/cond_asrd_2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/sve/cond_asrd_2_run.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/sve/cond_asrd_3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/sve/cond_asrd_3_run.c [new file with mode: 0644]