This patch adds regmove_costs for Cortex-A57 and A53, and sets the cost of GP2FP/FP2GP higher than memory cost to block the register allocator allocating integer values in FP registers.
Overall these patches give 2-3% speedup on SPEC. This passes all regression tests (with this fix https://gcc.gnu.org/ml/gcc-patches/2014-09/msg00356.html). OK for commit? Wilco ChangeLog: 2014-09-04 Wilco Dijkstra <wdijk...@arm.com> * gcc/config/aarch64/aarch64.c: Add cortexa57_regmove_cost and cortexa53_regmove_cost to avoid spilling from integer to FP registers. --- gcc/config/aarch64/aarch64.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 2c7c7c3..53d7818 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -215,6 +215,26 @@ EXTENSION static const struct cpu_regmove_cost generic_regmove_cost = NAMED_PARAM (FP2FP, 2) }; +EXTENSION static const struct cpu_regmove_cost cortexa57_regmove_cost = +{ + NAMED_PARAM (GP2GP, 2), + /* Avoid the use of slow int<->fp moves for spilling by setting + their cost higher than memmov_cost. */ + NAMED_PARAM (GP2FP, 5), + NAMED_PARAM (FP2GP, 5), + NAMED_PARAM (FP2FP, 2) +}; + +EXTENSION static const struct cpu_regmove_cost cortexa53_regmove_cost = +{ + NAMED_PARAM (GP2GP, 2), + /* Avoid the use of slow int<->fp moves for spilling by setting + their cost higher than memmov_cost. */ + NAMED_PARAM (GP2FP, 5), + NAMED_PARAM (FP2GP, 5), + NAMED_PARAM (FP2FP, 2) +}; + /* Generic costs for vector insn classes. */ EXTENSION static const struct cpu_vector_cost generic_vector_cost = { @@ -263,7 +283,7 @@ EXTENSION static const struct tune_params cortexa53_tunings = { &cortexa53_extra_costs, &generic_addrcost_table, - &generic_regmove_cost, + &cortexa53_regmove_cost, &generic_vector_cost, NAMED_PARAM (memmov_cost, 4), NAMED_PARAM (issue_rate, 2) @@ -273,7 +293,7 @@ EXTENSION static const struct tune_params cortexa57_tunings = { &cortexa57_extra_costs, &cortexa57_addrcost_table, - &generic_regmove_cost, + &cortexa57_regmove_cost, &cortexa57_vector_cost, NAMED_PARAM (memmov_cost, 4), NAMED_PARAM (issue_rate, 3) -- 1.9.1