aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/pdp11/pdp11.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/pdp11/pdp11.c')
-rw-r--r--gcc/config/pdp11/pdp11.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/gcc/config/pdp11/pdp11.c b/gcc/config/pdp11/pdp11.c
index 2730400..cba2b35 100644
--- a/gcc/config/pdp11/pdp11.c
+++ b/gcc/config/pdp11/pdp11.c
@@ -158,7 +158,7 @@ decode_pdp11_d (const struct real_format *fmt ATTRIBUTE_UNUSED,
static const char *singlemove_string (rtx *);
static bool pdp11_assemble_integer (rtx, unsigned int, int);
-static bool pdp11_rtx_costs (rtx, int, int, int, int *, bool);
+static bool pdp11_rtx_costs (rtx, machine_mode, int, int, int *, bool);
static bool pdp11_return_in_memory (const_tree, const_tree);
static rtx pdp11_function_value (const_tree, const_tree, bool);
static rtx pdp11_libcall_value (machine_mode, const_rtx);
@@ -910,10 +910,12 @@ pdp11_register_move_cost (machine_mode mode ATTRIBUTE_UNUSED,
}
static bool
-pdp11_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED,
+pdp11_rtx_costs (rtx x, machine_mode mode, int outer_code ATTRIBUTE_UNUSED,
int opno ATTRIBUTE_UNUSED, int *total,
bool speed ATTRIBUTE_UNUSED)
{
+ int code = GET_CODE (x);
+
switch (code)
{
case CONST_INT:
@@ -972,9 +974,9 @@ pdp11_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED,
return false;
case SIGN_EXTEND:
- if (GET_MODE (x) == HImode)
+ if (mode == HImode)
*total = COSTS_N_INSNS (1);
- else if (GET_MODE (x) == SImode)
+ else if (mode == SImode)
*total = COSTS_N_INSNS (6);
else
*total = COSTS_N_INSNS (2);
@@ -985,14 +987,14 @@ pdp11_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED,
case ASHIFTRT:
if (optimize_size)
*total = COSTS_N_INSNS (1);
- else if (GET_MODE (x) == QImode)
+ else if (mode == QImode)
{
if (GET_CODE (XEXP (x, 1)) != CONST_INT)
*total = COSTS_N_INSNS (8); /* worst case */
else
*total = COSTS_N_INSNS (INTVAL (XEXP (x, 1)));
}
- else if (GET_MODE (x) == HImode)
+ else if (mode == HImode)
{
if (GET_CODE (XEXP (x, 1)) == CONST_INT)
{
@@ -1004,7 +1006,7 @@ pdp11_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED,
else
*total = COSTS_N_INSNS (10); /* worst case */
}
- else if (GET_MODE (x) == SImode)
+ else if (mode == SImode)
{
if (GET_CODE (XEXP (x, 1)) == CONST_INT)
*total = COSTS_N_INSNS (2.5 + 0.5 * INTVAL (XEXP (x, 1)));