]> git.ipfire.org Git - thirdparty/gcc.git/commit
AArch64: Add better costing for vector constants and operations
authorTamar Christina <tamar.christina@arm.com>
Mon, 1 Nov 2021 13:49:46 +0000 (13:49 +0000)
committerTamar Christina <tamar.christina@arm.com>
Mon, 1 Nov 2021 13:49:46 +0000 (13:49 +0000)
commit1d5c43db79b7ea14f0dc071beb40cf80de90eb86
tree7ff0042d0c3e7465e31e34ee3c79575a845d1298
parent68b48f3f4c49132cc6bfb16e65f8b6fd939689c7
AArch64: Add better costing for vector constants and operations

This patch adds extended costing to cost the creation of constants and the
manipulation of constants.  The default values provided are based on
architectural expectations and each cost models can be individually tweaked as
needed.

The changes in this patch covers:

* Construction of PARALLEL or CONST_VECTOR:
  Adds better costing for vector of constants which is based on the constant
  being created and the instruction that can be used to create it.  i.e. a movi
  is cheaper than a literal load etc.
* Construction of a vector through a vec_dup.

gcc/ChangeLog:

* config/arm/aarch-common-protos.h (struct vector_cost_table): Add
movi, dup and extract costing fields.
* config/aarch64/aarch64-cost-tables.h (qdf24xx_extra_costs,
thunderx_extra_costs, thunderx2t99_extra_costs,
thunderx3t110_extra_costs, tsv110_extra_costs, a64fx_extra_costs): Use
them.
* config/arm/aarch-cost-tables.h (generic_extra_costs,
cortexa53_extra_costs, cortexa57_extra_costs, cortexa76_extra_costs,
exynosm1_extra_costs, xgene1_extra_costs): Likewise
* config/aarch64/aarch64-simd.md (aarch64_simd_dup<mode>): Add r->w dup.
* config/aarch64/aarch64.c (aarch64_rtx_costs): Add extra costs.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/vect-cse-codegen.c: New test.
gcc/config/aarch64/aarch64-cost-tables.h
gcc/config/aarch64/aarch64-simd.md
gcc/config/aarch64/aarch64.c
gcc/config/arm/aarch-common-protos.h
gcc/config/arm/aarch-cost-tables.h
gcc/testsuite/gcc.target/aarch64/vect-cse-codegen.c [new file with mode: 0644]