Commit 5a62a693 by Stephane Carrez Committed by Stephane Carrez

m68hc11.h (CONST_COSTS): Make the cost of constants cheap after reload.

	* config/m68hc11/m68hc11.h (CONST_COSTS): Make the cost of
	constants cheap after reload.
	* config/m68hc11/m68hc11.c (m68hc11_shift_cost): Shift by 16 and 32
	are cheap.
	(m68hc11_rtx_costs): Cost of multiplication by 65536 is expensive
	so that gcc prefers a shift by 16.
	(m6811_cost, m6812_cost): Make the shift cheap compared to an add.

From-SVN: r41834
parent 30506ece
2001-05-04 Stephane Carrez <Stephane.Carrez@worldnet.fr>
* config/m68hc11/m68hc11.h (CONST_COSTS): Make the cost of
constants cheap after reload.
* config/m68hc11/m68hc11.c (m68hc11_shift_cost): Shift by 16 and 32
are cheap.
(m68hc11_rtx_costs): Cost of multiplication by 65536 is expensive
so that gcc prefers a shift by 16.
(m6811_cost, m6812_cost): Make the shift cheap compared to an add.
2001-05-04 Nick Clifton <nickc@cambridge.redhat.com> 2001-05-04 Nick Clifton <nickc@cambridge.redhat.com>
* config/arm/elf.h (ASM_OUTPUT_ALIGNED_COMMON): Define. * config/arm/elf.h (ASM_OUTPUT_ALIGNED_COMMON): Define.
......
...@@ -136,7 +136,7 @@ struct processor_costs m6811_cost = { ...@@ -136,7 +136,7 @@ struct processor_costs m6811_cost = {
COSTS_N_INSNS (2), COSTS_N_INSNS (1) }, COSTS_N_INSNS (2), COSTS_N_INSNS (1) },
/* shiftHI const */ /* shiftHI const */
{ COSTS_N_INSNS (0), COSTS_N_INSNS (2), COSTS_N_INSNS (4), { COSTS_N_INSNS (0), COSTS_N_INSNS (1), COSTS_N_INSNS (4),
COSTS_N_INSNS (6), COSTS_N_INSNS (8), COSTS_N_INSNS (6), COSTS_N_INSNS (6), COSTS_N_INSNS (8), COSTS_N_INSNS (6),
COSTS_N_INSNS (4), COSTS_N_INSNS (2), COSTS_N_INSNS (4), COSTS_N_INSNS (2),
COSTS_N_INSNS (2), COSTS_N_INSNS (4), COSTS_N_INSNS (2), COSTS_N_INSNS (4),
...@@ -171,7 +171,7 @@ struct processor_costs m6812_cost = { ...@@ -171,7 +171,7 @@ struct processor_costs m6812_cost = {
COSTS_N_INSNS (2), COSTS_N_INSNS (1) }, COSTS_N_INSNS (2), COSTS_N_INSNS (1) },
/* shiftHI const */ /* shiftHI const */
{ COSTS_N_INSNS (0), COSTS_N_INSNS (2), COSTS_N_INSNS (4), { COSTS_N_INSNS (0), COSTS_N_INSNS (1), COSTS_N_INSNS (4),
COSTS_N_INSNS (6), COSTS_N_INSNS (8), COSTS_N_INSNS (6), COSTS_N_INSNS (6), COSTS_N_INSNS (8), COSTS_N_INSNS (6),
COSTS_N_INSNS (4), COSTS_N_INSNS (2), COSTS_N_INSNS (4), COSTS_N_INSNS (2),
COSTS_N_INSNS (2), COSTS_N_INSNS (4), COSTS_N_INSNS (6), COSTS_N_INSNS (2), COSTS_N_INSNS (4), COSTS_N_INSNS (6),
...@@ -4975,7 +4975,7 @@ m68hc11_shift_cost (mode, x, shift) ...@@ -4975,7 +4975,7 @@ m68hc11_shift_cost (mode, x, shift)
} }
/* For SI and others, the cost is higher. */ /* For SI and others, the cost is higher. */
if (GET_MODE_SIZE (mode) > 2) if (GET_MODE_SIZE (mode) > 2 && (shift % 16) != 0)
total *= GET_MODE_SIZE (mode) / 2; total *= GET_MODE_SIZE (mode) / 2;
/* When optimizing for size, make shift more costly so that /* When optimizing for size, make shift more costly so that
...@@ -5081,10 +5081,6 @@ m68hc11_rtx_costs (x, code, outer_code) ...@@ -5081,10 +5081,6 @@ m68hc11_rtx_costs (x, code, outer_code)
break; break;
case SImode: case SImode:
if (GET_CODE (XEXP (x, 1)) == CONST_INT
&& INTVAL (XEXP (x, 1)) == 65536)
break;
default: default:
total += m68hc11_cost->multSI; total += m68hc11_cost->multSI;
break; break;
......
...@@ -1481,14 +1481,16 @@ extern unsigned char m68hc11_reg_valid_for_index[FIRST_PSEUDO_REGISTER]; ...@@ -1481,14 +1481,16 @@ extern unsigned char m68hc11_reg_valid_for_index[FIRST_PSEUDO_REGISTER];
/* with two registers. */ \ /* with two registers. */ \
/* 'clr' is slow */ \ /* 'clr' is slow */ \
if ((OUTER_CODE) == SET && (RTX) == const0_rtx) \ if ((OUTER_CODE) == SET && (RTX) == const0_rtx) \
return 1; \ /* After reload, the reload_cse pass checks the cost */ \
/* to change a SET into a PLUS. Make const0 cheap. */ \
return 1 - reload_completed; \
else \ else \
return 0; \ return 0; \
case CONST: \ case CONST: \
case LABEL_REF: \ case LABEL_REF: \
case SYMBOL_REF: \ case SYMBOL_REF: \
if ((OUTER_CODE) == SET) \ if ((OUTER_CODE) == SET) \
return 1; \ return 1 - reload_completed; \
return 0; \ return 0; \
case CONST_DOUBLE: \ case CONST_DOUBLE: \
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