OSDN Git Service

2008-03-15 Paul Brook <paul@codesourcery.com>
authorpbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 15 Mar 2008 22:49:44 +0000 (22:49 +0000)
committerpbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 15 Mar 2008 22:49:44 +0000 (22:49 +0000)
gcc/
* config/arm/arm.c (arm_rtx_costs_1): Add costs for ARMv6 value
extension instructions.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@133260 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/arm/arm.c

index c3f2d7d..fcb1623 100644 (file)
@@ -1,3 +1,8 @@
+2008-03-15  Paul Brook  <paul@codesourcery.com>
+
+       * config/arm/arm.c (arm_rtx_costs_1): Add costs for ARMv6 value
+       extension instructions.
+
 2008-03-15  Richard Guenther  <rguenther@suse.de>
 
        * tree-ssa-ccp.c (ccp_fold): Also read from constant values
index f3febf6..4fb0a0d 100644 (file)
@@ -4904,6 +4904,12 @@ arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer)
       /* Fall through */
 
     case PLUS:
+      if (arm_arch6 && mode == SImode
+         && (GET_CODE (XEXP (x, 0)) == ZERO_EXTEND
+             || GET_CODE (XEXP (x, 0)) == SIGN_EXTEND))
+       return 1 + (GET_CODE (XEXP (XEXP (x, 0), 0)) == MEM ? 10 : 0)
+                + (GET_CODE (XEXP (x, 1)) == MEM ? 10 : 0);
+
       if (GET_CODE (XEXP (x, 0)) == MULT)
        {
          extra_cost = rtx_cost (XEXP (x, 0), code);
@@ -5002,12 +5008,17 @@ arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer)
       return 4 + (mode == DImode ? 4 : 0);
 
     case SIGN_EXTEND:
-      /* ??? value extensions are cheaper on armv6. */
+      if (arm_arch_thumb2 && mode == SImode)
+       return 1 + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0);
+
       if (GET_MODE (XEXP (x, 0)) == QImode)
        return (4 + (mode == DImode ? 4 : 0)
                + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0));
       /* Fall through */
     case ZERO_EXTEND:
+      if (arm_arch6 && mode == SImode)
+       return 1 + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0);
+
       switch (GET_MODE (XEXP (x, 0)))
        {
        case QImode: