[PATCH] [AArch64] Distinct costs for sign and zero extension
authorEvandro Menezes <e.menezes@samsung.com>
Tue, 27 Oct 2015 11:57:01 +0000 (11:57 +0000)
committerJames Greenhalgh <jgreenhalgh@gcc.gnu.org>
Tue, 27 Oct 2015 11:57:01 +0000 (11:57 +0000)
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
gcc/config/aarch64/aarch64-protos.h
gcc/config/aarch64/aarch64.c

index 1066861197ab13aae0c94ee1a7683cbd3a02b37e..ff593e13cb8529b19c44d57275ba7ac87d958c79 100644 (file)
@@ -1,3 +1,12 @@
+2015-10-27  Evandro Menezes  <e.menezes@samsung.com>
+
+       * 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  <richard.sandiford@arm.com>
 
        * fold-const.c (fold_minmax): Delete.
index b1bf58235d428178c2d199e2e2a781dd539ec87e..81792bcb7dac408e3a9392c11765b5f9e4c10194 100644 (file)
@@ -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;
 };
 
index 7678840576536ffe592b54f8529d0d50640a6ffb..49650412bb2efec802e2f69c4bd13a23e5378958 100644 (file)
@@ -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: