From 783879e617bf3b4d0d94ccabb9a6f40b43c985a2 Mon Sep 17 00:00:00 2001 From: Evandro Menezes Date: Tue, 27 Oct 2015 11:57:01 +0000 Subject: [PATCH] [PATCH] [AArch64] Distinct costs for sign and zero extension gcc/ * config/aarch64/aarch64-protos.h (cpu_addrcost_table): Split member for register extension into sign and zero register extension. * config/aarch64/aarch64.c (generic_addrcost_table): Infer values for sign and zero register extension. (cortexa57_addrcost_table): Likewise. (xgene1_addrcost_table): Likewise. From-SVN: r229431 --- gcc/ChangeLog | 9 +++++++++ gcc/config/aarch64/aarch64-protos.h | 3 ++- gcc/config/aarch64/aarch64.c | 16 +++++++++++----- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1066861197a..ff593e13cb8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2015-10-27 Evandro Menezes + + * config/aarch64/aarch64-protos.h (cpu_addrcost_table): Split member + for register extension into sign and zero register extension. + * config/aarch64/aarch64.c (generic_addrcost_table): Infer values + for sign and zero register extension. + (cortexa57_addrcost_table): Likewise. + (xgene1_addrcost_table): Likewise. + 2015-10-27 Richard Sandiford * fold-const.c (fold_minmax): Delete. diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h index b1bf58235d4..81792bcb7da 100644 --- a/gcc/config/aarch64/aarch64-protos.h +++ b/gcc/config/aarch64/aarch64-protos.h @@ -134,7 +134,8 @@ struct cpu_addrcost_table const int pre_modify; const int post_modify; const int register_offset; - const int register_extend; + const int register_sextend; + const int register_zextend; const int imm_offset; }; diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 76788405765..49650412bb2 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -194,7 +194,8 @@ static const struct cpu_addrcost_table generic_addrcost_table = 0, /* pre_modify */ 0, /* post_modify */ 0, /* register_offset */ - 0, /* register_extend */ + 0, /* register_sextend */ + 0, /* register_zextend */ 0 /* imm_offset */ }; @@ -209,7 +210,8 @@ static const struct cpu_addrcost_table cortexa57_addrcost_table = 0, /* pre_modify */ 0, /* post_modify */ 0, /* register_offset */ - 0, /* register_extend */ + 0, /* register_sextend */ + 0, /* register_zextend */ 0, /* imm_offset */ }; @@ -224,7 +226,8 @@ static const struct cpu_addrcost_table xgene1_addrcost_table = 1, /* pre_modify */ 0, /* post_modify */ 0, /* register_offset */ - 1, /* register_extend */ + 1, /* register_sextend */ + 1, /* register_zextend */ 0, /* imm_offset */ }; @@ -5530,9 +5533,12 @@ aarch64_address_cost (rtx x, cost += addr_cost->register_offset; break; - case ADDRESS_REG_UXTW: case ADDRESS_REG_SXTW: - cost += addr_cost->register_extend; + cost += addr_cost->register_sextend; + break; + + case ADDRESS_REG_UXTW: + cost += addr_cost->register_zextend; break; default: -- 2.30.2