aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/config/m68hc11/m68hc11.c10
-rw-r--r--gcc/config/m68hc11/m68hc11.h6
3 files changed, 17 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5cb1ffc..47cdf86 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+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.
diff --git a/gcc/config/m68hc11/m68hc11.c b/gcc/config/m68hc11/m68hc11.c
index 1ae3979..f649b9f 100644
--- a/gcc/config/m68hc11/m68hc11.c
+++ b/gcc/config/m68hc11/m68hc11.c
@@ -136,7 +136,7 @@ struct processor_costs m6811_cost = {
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),
@@ -171,7 +171,7 @@ struct processor_costs m6812_cost = {
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),
@@ -4975,7 +4975,7 @@ m68hc11_shift_cost (mode, x, shift)
}
/* 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
@@ -5081,10 +5081,6 @@ m68hc11_rtx_costs (x, code, outer_code)
break;
case SImode:
- if (GET_CODE (XEXP (x, 1)) == CONST_INT
- && INTVAL (XEXP (x, 1)) == 65536)
- break;
-
default:
total += m68hc11_cost->multSI;
break;
diff --git a/gcc/config/m68hc11/m68hc11.h b/gcc/config/m68hc11/m68hc11.h
index f58183c..3114a47 100644
--- a/gcc/config/m68hc11/m68hc11.h
+++ b/gcc/config/m68hc11/m68hc11.h
@@ -1481,14 +1481,16 @@ extern unsigned char m68hc11_reg_valid_for_index[FIRST_PSEUDO_REGISTER];
/* 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;