sparc.h (BRANCH_COST): Fix macro definition.
* sparc.h (BRANCH_COST): Fix macro definition. * avr.c (avr_operand_rtx_cost): Add speed argument. (avr_rtx_costs): Update calls of avr_operand_rtx_cost. From-SVN: r139824
This commit is contained in:
parent
f5e85907ff
commit
1f494b6d9f
3 changed files with 50 additions and 44 deletions
|
@ -1,3 +1,9 @@
|
|||
2008-08-31 Jan Hubicka <jh@suse.cz>
|
||||
|
||||
* sparc.h (BRANCH_COST): Fix macro definition.
|
||||
* avr.c (avr_operand_rtx_cost): Add speed argument.
|
||||
(avr_rtx_costs): Update calls of avr_operand_rtx_cost.
|
||||
|
||||
2008-08-31 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
* tree-cfg.c (verify_types_in_gimple_assign): Dump mismatched
|
||||
|
|
|
@ -80,7 +80,7 @@ static unsigned int avr_section_type_flags (tree, const char *, int);
|
|||
static void avr_reorg (void);
|
||||
static void avr_asm_out_ctor (rtx, int);
|
||||
static void avr_asm_out_dtor (rtx, int);
|
||||
static int avr_operand_rtx_cost (rtx, enum machine_mode, enum rtx_code);
|
||||
static int avr_operand_rtx_cost (rtx, enum machine_mode, enum rtx_code, bool);
|
||||
static bool avr_rtx_costs (rtx, int, int, int *, bool);
|
||||
static int avr_address_cost (rtx, bool);
|
||||
static bool avr_return_in_memory (const_tree, const_tree);
|
||||
|
@ -4992,7 +4992,7 @@ order_regs_for_local_alloc (void)
|
|||
|
||||
static int
|
||||
avr_operand_rtx_cost (rtx x, enum machine_mode mode, enum rtx_code outer,
|
||||
bool speed ATTRIBUTE_UNUSED)
|
||||
bool speed)
|
||||
{
|
||||
enum rtx_code code = GET_CODE (x);
|
||||
int total;
|
||||
|
@ -5012,7 +5012,7 @@ avr_operand_rtx_cost (rtx x, enum machine_mode mode, enum rtx_code outer,
|
|||
}
|
||||
|
||||
total = 0;
|
||||
avr_rtx_costs (x, code, outer, &total);
|
||||
avr_rtx_costs (x, code, outer, &total, speed);
|
||||
return total;
|
||||
}
|
||||
|
||||
|
@ -5062,7 +5062,7 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total,
|
|||
default:
|
||||
return false;
|
||||
}
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 0), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 0), mode, code, speed);
|
||||
return true;
|
||||
|
||||
case ABS:
|
||||
|
@ -5076,24 +5076,24 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total,
|
|||
default:
|
||||
return false;
|
||||
}
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 0), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 0), mode, code, speed);
|
||||
return true;
|
||||
|
||||
case NOT:
|
||||
*total = COSTS_N_INSNS (GET_MODE_SIZE (mode));
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 0), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 0), mode, code, speed);
|
||||
return true;
|
||||
|
||||
case ZERO_EXTEND:
|
||||
*total = COSTS_N_INSNS (GET_MODE_SIZE (mode)
|
||||
- GET_MODE_SIZE (GET_MODE (XEXP (x, 0))));
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 0), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 0), mode, code, speed);
|
||||
return true;
|
||||
|
||||
case SIGN_EXTEND:
|
||||
*total = COSTS_N_INSNS (GET_MODE_SIZE (mode) + 2
|
||||
- GET_MODE_SIZE (GET_MODE (XEXP (x, 0))));
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 0), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 0), mode, code, speed);
|
||||
return true;
|
||||
|
||||
case PLUS:
|
||||
|
@ -5102,14 +5102,14 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total,
|
|||
case QImode:
|
||||
*total = COSTS_N_INSNS (1);
|
||||
if (GET_CODE (XEXP (x, 1)) != CONST_INT)
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code, speed);
|
||||
break;
|
||||
|
||||
case HImode:
|
||||
if (GET_CODE (XEXP (x, 1)) != CONST_INT)
|
||||
{
|
||||
*total = COSTS_N_INSNS (2);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code, speed);
|
||||
}
|
||||
else if (INTVAL (XEXP (x, 1)) >= -63 && INTVAL (XEXP (x, 1)) <= 63)
|
||||
*total = COSTS_N_INSNS (1);
|
||||
|
@ -5121,7 +5121,7 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total,
|
|||
if (GET_CODE (XEXP (x, 1)) != CONST_INT)
|
||||
{
|
||||
*total = COSTS_N_INSNS (4);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code, speed);
|
||||
}
|
||||
else if (INTVAL (XEXP (x, 1)) >= -63 && INTVAL (XEXP (x, 1)) <= 63)
|
||||
*total = COSTS_N_INSNS (1);
|
||||
|
@ -5132,22 +5132,22 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total,
|
|||
default:
|
||||
return false;
|
||||
}
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 0), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 0), mode, code, speed);
|
||||
return true;
|
||||
|
||||
case MINUS:
|
||||
case AND:
|
||||
case IOR:
|
||||
*total = COSTS_N_INSNS (GET_MODE_SIZE (mode));
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 0), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 0), mode, code, speed);
|
||||
if (GET_CODE (XEXP (x, 1)) != CONST_INT)
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code, speed);
|
||||
return true;
|
||||
|
||||
case XOR:
|
||||
*total = COSTS_N_INSNS (GET_MODE_SIZE (mode));
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 0), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 0), mode, code, speed);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code, speed);
|
||||
return true;
|
||||
|
||||
case MULT:
|
||||
|
@ -5174,8 +5174,8 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total,
|
|||
default:
|
||||
return false;
|
||||
}
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 0), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 0), mode, code, speed);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code, speed);
|
||||
return true;
|
||||
|
||||
case DIV:
|
||||
|
@ -5186,8 +5186,8 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total,
|
|||
*total = COSTS_N_INSNS (AVR_HAVE_JMP_CALL ? 2 : 1);
|
||||
else
|
||||
return false;
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 0), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 0), mode, code, speed);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code, speed);
|
||||
return true;
|
||||
|
||||
case ASHIFT:
|
||||
|
@ -5197,7 +5197,7 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total,
|
|||
if (GET_CODE (XEXP (x, 1)) != CONST_INT)
|
||||
{
|
||||
*total = COSTS_N_INSNS (!speed ? 4 : 17);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code, speed);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -5215,7 +5215,7 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total,
|
|||
if (GET_CODE (XEXP (x, 1)) != CONST_INT)
|
||||
{
|
||||
*total = COSTS_N_INSNS (!speed ? 5 : 41);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code, speed);
|
||||
}
|
||||
else
|
||||
switch (INTVAL (XEXP (x, 1)))
|
||||
|
@ -5245,14 +5245,14 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total,
|
|||
*total = COSTS_N_INSNS (!speed ? 5 : 8);
|
||||
break;
|
||||
case 6:
|
||||
*total = COSTS_N_INSNS (ptimize_size ? 5 : 9);
|
||||
*total = COSTS_N_INSNS (!speed ? 5 : 9);
|
||||
break;
|
||||
case 5:
|
||||
*total = COSTS_N_INSNS (!speed ? 5 : 10);
|
||||
break;
|
||||
default:
|
||||
*total = COSTS_N_INSNS (!speed ? 5 : 41);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code, speed);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -5260,7 +5260,7 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total,
|
|||
if (GET_CODE (XEXP (x, 1)) != CONST_INT)
|
||||
{
|
||||
*total = COSTS_N_INSNS (!speed ? 7 : 113);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code, speed);
|
||||
}
|
||||
else
|
||||
switch (INTVAL (XEXP (x, 1)))
|
||||
|
@ -5284,14 +5284,14 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total,
|
|||
break;
|
||||
default:
|
||||
*total = COSTS_N_INSNS (!speed ? 7 : 113);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code, speed);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 0), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 0), mode, code, speed);
|
||||
return true;
|
||||
|
||||
case ASHIFTRT:
|
||||
|
@ -5301,7 +5301,7 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total,
|
|||
if (GET_CODE (XEXP (x, 1)) != CONST_INT)
|
||||
{
|
||||
*total = COSTS_N_INSNS (!speed ? 4 : 17);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code, speed);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -5321,7 +5321,7 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total,
|
|||
if (GET_CODE (XEXP (x, 1)) != CONST_INT)
|
||||
{
|
||||
*total = COSTS_N_INSNS (!speed ? 5 : 41);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code, speed);
|
||||
}
|
||||
else
|
||||
switch (INTVAL (XEXP (x, 1)))
|
||||
|
@ -5357,7 +5357,7 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total,
|
|||
break;
|
||||
default:
|
||||
*total = COSTS_N_INSNS (!speed ? 5 : 41);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code, speed);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -5365,7 +5365,7 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total,
|
|||
if (GET_CODE (XEXP (x, 1)) != CONST_INT)
|
||||
{
|
||||
*total = COSTS_N_INSNS (!speed ? 7 : 113);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code, speed);
|
||||
}
|
||||
else
|
||||
switch (INTVAL (XEXP (x, 1)))
|
||||
|
@ -5389,14 +5389,14 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total,
|
|||
break;
|
||||
default:
|
||||
*total = COSTS_N_INSNS (!speed ? 7 : 113);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code, speed);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 0), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 0), mode, code, speed);
|
||||
return true;
|
||||
|
||||
case LSHIFTRT:
|
||||
|
@ -5406,7 +5406,7 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total,
|
|||
if (GET_CODE (XEXP (x, 1)) != CONST_INT)
|
||||
{
|
||||
*total = COSTS_N_INSNS (!speed ? 4 : 17);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code, speed);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -5424,7 +5424,7 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total,
|
|||
if (GET_CODE (XEXP (x, 1)) != CONST_INT)
|
||||
{
|
||||
*total = COSTS_N_INSNS (!speed ? 5 : 41);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code, speed);
|
||||
}
|
||||
else
|
||||
switch (INTVAL (XEXP (x, 1)))
|
||||
|
@ -5463,7 +5463,7 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total,
|
|||
break;
|
||||
default:
|
||||
*total = COSTS_N_INSNS (!speed ? 5 : 41);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code, speed);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -5471,7 +5471,7 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total,
|
|||
if (GET_CODE (XEXP (x, 1)) != CONST_INT)
|
||||
{
|
||||
*total = COSTS_N_INSNS (!speed ? 7 : 113);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code, speed);
|
||||
}
|
||||
else
|
||||
switch (INTVAL (XEXP (x, 1)))
|
||||
|
@ -5495,14 +5495,14 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total,
|
|||
break;
|
||||
default:
|
||||
*total = COSTS_N_INSNS (!speed ? 7 : 113);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code, speed);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 0), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 0), mode, code, speed);
|
||||
return true;
|
||||
|
||||
case COMPARE:
|
||||
|
@ -5511,13 +5511,13 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total,
|
|||
case QImode:
|
||||
*total = COSTS_N_INSNS (1);
|
||||
if (GET_CODE (XEXP (x, 1)) != CONST_INT)
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code, speed);
|
||||
break;
|
||||
|
||||
case HImode:
|
||||
*total = COSTS_N_INSNS (2);
|
||||
if (GET_CODE (XEXP (x, 1)) != CONST_INT)
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code, speed);
|
||||
else if (INTVAL (XEXP (x, 1)) != 0)
|
||||
*total += COSTS_N_INSNS (1);
|
||||
break;
|
||||
|
@ -5525,7 +5525,7 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total,
|
|||
case SImode:
|
||||
*total = COSTS_N_INSNS (4);
|
||||
if (GET_CODE (XEXP (x, 1)) != CONST_INT)
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code, speed);
|
||||
else if (INTVAL (XEXP (x, 1)) != 0)
|
||||
*total += COSTS_N_INSNS (3);
|
||||
break;
|
||||
|
@ -5533,7 +5533,7 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total,
|
|||
default:
|
||||
return false;
|
||||
}
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 0), mode, code);
|
||||
*total += avr_operand_rtx_cost (XEXP (x, 0), mode, code, speed);
|
||||
return true;
|
||||
|
||||
default:
|
||||
|
|
|
@ -2196,7 +2196,7 @@ do { \
|
|||
On Niagara-2, a not-taken branch costs 1 cycle whereas a taken
|
||||
branch costs 6 cycles. */
|
||||
|
||||
#define BRANCH_COST (speed_p, predictable_p) \
|
||||
#define BRANCH_COST(speed_p, predictable_p) \
|
||||
((sparc_cpu == PROCESSOR_V9 \
|
||||
|| sparc_cpu == PROCESSOR_ULTRASPARC) \
|
||||
? 7 \
|
||||
|
|
Loading…
Add table
Reference in a new issue