[AArch64] Add truncation for partial SVE modes
authorRichard Sandiford <richard.sandiford@arm.com>
Sat, 16 Nov 2019 11:14:51 +0000 (11:14 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Sat, 16 Nov 2019 11:14:51 +0000 (11:14 +0000)
commit2d56600c8de397d09a16dedd33d310a763a832ae
tree56564f83914ac39ee039165188613c4b2820732e
parent217ccab8f46ca5b260319e7b71b421daec6d11c8
[AArch64] Add truncation for partial SVE modes

This patch adds support for "truncating" to a partial SVE vector from
either a full SVE vector or a wider partial vector.  This truncation is
actually a no-op and so should have zero cost in the vector cost model.

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

gcc/
* config/aarch64/aarch64-sve.md
(trunc<SVE_HSDI:mode><SVE_PARTIAL_I:mode>2): New pattern.
* config/aarch64/aarch64.c (aarch64_integer_truncation_p): New
function.
(aarch64_sve_adjust_stmt_cost): Call it.

gcc/testsuite/
* gcc.target/aarch64/sve/mask_struct_load_1.c: Add
--param aarch64-sve-compare-costs=0.
* gcc.target/aarch64/sve/mask_struct_load_2.c: Likewise.
* gcc.target/aarch64/sve/mask_struct_load_3.c: Likewise.
* gcc.target/aarch64/sve/mask_struct_load_4.c: Likewise.
* gcc.target/aarch64/sve/mask_struct_load_5.c: Likewise.
* gcc.target/aarch64/sve/pack_1.c: Likewise.
* gcc.target/aarch64/sve/truncate_1.c: New test.

From-SVN: r278344
gcc/ChangeLog
gcc/config/aarch64/aarch64-sve.md
gcc/config/aarch64/aarch64.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_1.c
gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_2.c
gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_3.c
gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_4.c
gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_5.c
gcc/testsuite/gcc.target/aarch64/sve/pack_1.c
gcc/testsuite/gcc.target/aarch64/sve/truncate_1.c [new file with mode: 0644]