aarch64: Add a general vec_concat expander
authorRichard Sandiford <richard.sandiford@arm.com>
Wed, 9 Feb 2022 16:57:05 +0000 (16:57 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Wed, 9 Feb 2022 16:57:05 +0000 (16:57 +0000)
commit4057266ce5afc1fccd5d4e4971103afaa4be63d4
tree04ea2c2249ee2bcf0374f35570b8fb69f059b1a1
parent85ac2fe44fd4acf8350dd74ccb003a2050baad2a
aarch64: Add a general vec_concat expander

After previous patches, we have a (mostly new) group of vec_concat
patterns as well as vestiges of the old move_lo/hi_quad patterns.
(A previous patch removed the move_lo_quad insns, but we still
have the move_hi_quad insns and both sets of expanders.)

This patch is the first of two to remove the old move_lo/hi_quad
stuff.  It isn't technically a regression fix, but it seemed
better to make the changes now rather than leave things in
a half-finished and inconsistent state.

This patch defines an aarch64_vec_concat expander that coerces the
element operands into a valid form, including the ones added by the
previous patch.  This in turn lets us get rid of one move_lo/hi_quad
pair.

As a side-effect, it also means that vcombines of 2 vectors make
better use of the available forms, like vec_inits of 2 scalars
already do.

gcc/
* config/aarch64/aarch64-protos.h (aarch64_split_simd_combine):
Delete.
* config/aarch64/aarch64-simd.md (@aarch64_combinez<mode>): Rename
to...
(*aarch64_combinez<mode>): ...this.
(@aarch64_combinez_be<mode>): Rename to...
(*aarch64_combinez_be<mode>): ...this.
(@aarch64_vec_concat<mode>): New expander.
(aarch64_combine<mode>): Use it.
(@aarch64_simd_combine<mode>): Delete.
* config/aarch64/aarch64.cc (aarch64_split_simd_combine): Delete.
(aarch64_expand_vector_init): Use aarch64_vec_concat.

gcc/testsuite/
* gcc.target/aarch64/vec-init-12.c: New test.
gcc/config/aarch64/aarch64-protos.h
gcc/config/aarch64/aarch64-simd.md
gcc/config/aarch64/aarch64.cc
gcc/testsuite/gcc.target/aarch64/vec-init-12.c [new file with mode: 0644]