Commit 80b093df by DJ Delorie Committed by DJ Delorie

m32c.c (m32c_return_addr_rtx): Change pointer type for A24 to PSImode.

* config/m32c/m32c.c (m32c_return_addr_rtx): Change pointer type
for A24 to PSImode.
(m32c_address_cost): Detail costs for indirect offsets.

From-SVN: r135842
parent e7854e7d
2008-05-23 DJ Delorie <dj@redhat.com>
* config/m32c/m32c.c (m32c_return_addr_rtx): Change pointer type
for A24 to PSImode.
(m32c_address_cost): Detail costs for indirect offsets.
2008-05-23 Rafael Espindola <espindola@google.com> 2008-05-23 Rafael Espindola <espindola@google.com>
* see.c (see_get_extension_data): Don't use SUBREG_REG to test * see.c (see_get_extension_data): Don't use SUBREG_REG to test
......
...@@ -1099,7 +1099,8 @@ m32c_return_addr_rtx (int count) ...@@ -1099,7 +1099,8 @@ m32c_return_addr_rtx (int count)
if (TARGET_A24) if (TARGET_A24)
{ {
mode = SImode; /* It's four bytes */
mode = PSImode;
offset = 4; offset = 4;
} }
else else
...@@ -2199,16 +2200,36 @@ m32c_rtx_costs (rtx x, int code, int outer_code, int *total) ...@@ -2199,16 +2200,36 @@ m32c_rtx_costs (rtx x, int code, int outer_code, int *total)
static int static int
m32c_address_cost (rtx addr) m32c_address_cost (rtx addr)
{ {
int i;
/* fprintf(stderr, "\naddress_cost\n"); /* fprintf(stderr, "\naddress_cost\n");
debug_rtx(addr);*/ debug_rtx(addr);*/
switch (GET_CODE (addr)) switch (GET_CODE (addr))
{ {
case CONST_INT: case CONST_INT:
return COSTS_N_INSNS(1); i = INTVAL (addr);
if (i == 0)
return COSTS_N_INSNS(1);
if (0 < i && i <= 255)
return COSTS_N_INSNS(2);
if (0 < i && i <= 65535)
return COSTS_N_INSNS(3);
return COSTS_N_INSNS(4);
case SYMBOL_REF: case SYMBOL_REF:
return COSTS_N_INSNS(3); return COSTS_N_INSNS(4);
case REG: case REG:
return COSTS_N_INSNS(2); return COSTS_N_INSNS(1);
case PLUS:
if (GET_CODE (XEXP (addr, 1)) == CONST_INT)
{
i = INTVAL (XEXP (addr, 1));
if (i == 0)
return COSTS_N_INSNS(1);
if (0 < i && i <= 255)
return COSTS_N_INSNS(2);
if (0 < i && i <= 65535)
return COSTS_N_INSNS(3);
}
return COSTS_N_INSNS(4);
default: default:
return 0; return 0;
} }
......
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