Commit 2266617f by Joern Rennecke Committed by Joern Rennecke

epiphany.c (epiphany_address_cost): Use MODE parameter.

        * config/epiphany/epiphany.c (epiphany_address_cost):
        Use MODE parameter.

From-SVN: r193205
parent 3649b9b7
2012-11-06 Joern Rennecke <joern.rennecke@embecosm.com>
* config/epiphany/epiphany.c (epiphany_address_cost):
Use MODE parameter.
2012-11-05 Sriraman Tallam <tmsriram@google.com> 2012-11-05 Sriraman Tallam <tmsriram@google.com>
* doc/tm.texi.in (TARGET_OPTION_FUNCTION_VERSIONS): New hook * doc/tm.texi.in (TARGET_OPTION_FUNCTION_VERSIONS): New hook
...@@ -729,7 +729,7 @@ epiphany_rtx_costs (rtx x, int code, int outer_code, int opno ATTRIBUTE_UNUSED, ...@@ -729,7 +729,7 @@ epiphany_rtx_costs (rtx x, int code, int outer_code, int opno ATTRIBUTE_UNUSED,
If ADDR is not a valid address, its cost is irrelevant. */ If ADDR is not a valid address, its cost is irrelevant. */
static int static int
epiphany_address_cost (rtx addr, enum machine_mode mode ATTRIBUTE_UNUSED, epiphany_address_cost (rtx addr, enum machine_mode mode,
addr_space_t as ATTRIBUTE_UNUSED, bool speed) addr_space_t as ATTRIBUTE_UNUSED, bool speed)
{ {
rtx reg; rtx reg;
...@@ -761,19 +761,28 @@ epiphany_address_cost (rtx addr, enum machine_mode mode ATTRIBUTE_UNUSED, ...@@ -761,19 +761,28 @@ epiphany_address_cost (rtx addr, enum machine_mode mode ATTRIBUTE_UNUSED,
} }
if (!satisfies_constraint_Rgs (reg)) if (!satisfies_constraint_Rgs (reg))
return 1; return 1;
/* ??? We don't know the mode of the memory access. We are going to assume /* The offset range available for short instructions depends on the mode
SImode, unless lack of offset alignment indicates a smaller access. */ of the memory access. */
/* First, make sure we have a valid integer. */ /* First, make sure we have a valid integer. */
if (!satisfies_constraint_L (off)) if (!satisfies_constraint_L (off))
return 1; return 1;
i = INTVAL (off); i = INTVAL (off);
if ((i & 1) == 0) switch (GET_MODE_SIZE (mode))
i >>= 1; {
if ((i & 1) == 0) default:
case 4:
if (i & 1)
return 1;
i >>= 1; i >>= 1;
if (i < -7 || i > 7) /* Fall through. */
case 2:
if (i & 1)
return 1; return 1;
return 0; i >>= 1;
/* Fall through. */
case 1:
return i < -7 || i > 7;
}
} }
/* Compute the cost of moving data between registers and memory. /* Compute the cost of moving data between registers and memory.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment