[AArch64] Add sign and zero extension for partial SVE modes
commite58703e2c1b09d39714740e00933d32df965de32
authorRichard Sandiford <richard.sandiford@arm.com>
Sat, 16 Nov 2019 11:07:23 +0000 (16 11:07 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Sat, 16 Nov 2019 11:07:23 +0000 (16 11:07 +0000)
tree40e761cc115f68b373d1f519ff642533d4c20111
parentcc68f7c2dabbf9d90ebe025a11f6d6ed5d49a113
[AArch64] Add sign and zero extension for partial SVE modes

This patch adds support for extending from partial SVE modes
to both full vector modes and wider partial modes.

Some tests now need --param aarch64-sve-compare-costs=0 to force
the original full-vector code.

2019-11-16  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* config/aarch64/iterators.md (SVE_HSDI): New mode iterator.
(narrower_mask): Handle VNx4HI, VNx2HI and VNx2SI.
* config/aarch64/aarch64-sve.md
(<ANY_EXTEND:optab><SVE_PARTIAL_I:mode><SVE_HSDI:mode>2): New pattern.
(*<ANY_EXTEND:optab><SVE_PARTIAL_I:mode><SVE_HSDI:mode>2): Likewise.
(@aarch64_pred_sxt<SVE_FULL_HSDI:mode><SVE_PARTIAL_I:mode>): Update
comment.  Avoid new narrower_mask ambiguity.
(@aarch64_cond_sxt<SVE_FULL_HSDI:mode><SVE_PARTIAL_I:mode>): Likewise.
(*cond_uxt<mode>_2): Update comment.
(*cond_uxt<mode>_any): Likewise.

gcc/testsuite/
* gcc.target/aarch64/sve/cost_model_1.c: Expect the loop to be
vectorized with bytes stored in 32-bit containers.
* gcc.target/aarch64/sve/extend_1.c: New test.
* gcc.target/aarch64/sve/extend_2.c: New test.
* gcc.target/aarch64/sve/extend_3.c: New test.
* gcc.target/aarch64/sve/extend_4.c: New test.
* gcc.target/aarch64/sve/load_const_offset_3.c: Add
--param aarch64-sve-compare-costs=0.
* gcc.target/aarch64/sve/mask_struct_store_1.c: Likewise.
* gcc.target/aarch64/sve/mask_struct_store_1_run.c: Likewise.
* gcc.target/aarch64/sve/mask_struct_store_2.c: Likewise.
* gcc.target/aarch64/sve/mask_struct_store_2_run.c: Likewise.
* gcc.target/aarch64/sve/unpack_unsigned_1.c: Likewise.
* gcc.target/aarch64/sve/unpack_unsigned_1_run.c: Likewise.

From-SVN: r278342
16 files changed:
gcc/ChangeLog
gcc/config/aarch64/aarch64-sve.md
gcc/config/aarch64/iterators.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/sve/cost_model_1.c
gcc/testsuite/gcc.target/aarch64/sve/extend_1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/sve/extend_2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/sve/extend_3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/sve/extend_4.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/sve/load_const_offset_3.c
gcc/testsuite/gcc.target/aarch64/sve/mask_struct_store_1.c
gcc/testsuite/gcc.target/aarch64/sve/mask_struct_store_1_run.c
gcc/testsuite/gcc.target/aarch64/sve/mask_struct_store_2.c
gcc/testsuite/gcc.target/aarch64/sve/mask_struct_store_2_run.c
gcc/testsuite/gcc.target/aarch64/sve/unpack_unsigned_1.c
gcc/testsuite/gcc.target/aarch64/sve/unpack_unsigned_1_run.c