+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>
* config/arm/elf.h (ASM_OUTPUT_ALIGNED_COMMON): Define.
COSTS_N_INSNS (2), COSTS_N_INSNS (1) },
/* 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 (4), COSTS_N_INSNS (2),
COSTS_N_INSNS (2), COSTS_N_INSNS (4),
COSTS_N_INSNS (2), COSTS_N_INSNS (1) },
/* 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 (4), COSTS_N_INSNS (2),
COSTS_N_INSNS (2), COSTS_N_INSNS (4), COSTS_N_INSNS (6),
}
/* 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;
/* When optimizing for size, make shift more costly so that
break;
case SImode:
- if (GET_CODE (XEXP (x, 1)) == CONST_INT
- && INTVAL (XEXP (x, 1)) == 65536)
- break;
-
default:
total += m68hc11_cost->multSI;
break;
/* with two registers. */ \
/* 'clr' is slow */ \
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 \
return 0; \
case CONST: \
case LABEL_REF: \
case SYMBOL_REF: \
if ((OUTER_CODE) == SET) \
- return 1; \
+ return 1 - reload_completed; \
return 0; \
case CONST_DOUBLE: \
return 0;