m68hc11.c (m68hc11_small_indexed_indirect_p): Look for reg_equiv_memory_loc when the operand is a register that does not get...

* config/m68hc11/m68hc11.c (m68hc11_small_indexed_indirect_p): Look
	for reg_equiv_memory_loc when the operand is a register that does
	not get a hard register (stack location).
	(tst_operand): After reload, accept all memory operand.
	(symbolic_memory_operand): Fix detection of symbolic references.
	* config/m68hc11/m68hc11.h (VALID_CONSTANT_OFFSET_P): For 68HC12
	accept symbols and any constant.

From-SVN: r50839
This commit is contained in:
Stephane Carrez 2002-03-15 22:54:58 +01:00 committed by Stephane Carrez
parent 6272bc6859
commit fdffea1abb
3 changed files with 35 additions and 7 deletions

View File

@ -1,3 +1,13 @@
2002-03-15 Stephane Carrez <Stephane.Carrez@worldnet.fr>
* config/m68hc11/m68hc11.c (m68hc11_small_indexed_indirect_p): Look
for reg_equiv_memory_loc when the operand is a register that does
not get a hard register (stack location).
(tst_operand): After reload, accept all memory operand.
(symbolic_memory_operand): Fix detection of symbolic references.
* config/m68hc11/m68hc11.h (VALID_CONSTANT_OFFSET_P): For 68HC12
accept symbols and any constant.
2002-03-15 Stephane Carrez <Stephane.Carrez@worldnet.fr>
* config/m68hc11/m68hc11.c (emit_move_after_reload): Add a REG_INC

View File

@ -551,6 +551,14 @@ m68hc11_small_indexed_indirect_p (operand, mode)
{
rtx base, offset;
if (GET_CODE (operand) == REG && reload_in_progress
&& REGNO (operand) >= FIRST_PSEUDO_REGISTER
&& reg_equiv_memory_loc[REGNO (operand)])
{
operand = reg_equiv_memory_loc[REGNO (operand)];
operand = eliminate_regs (operand, 0, NULL_RTX);
}
if (GET_CODE (operand) != MEM)
return 0;
@ -561,8 +569,7 @@ m68hc11_small_indexed_indirect_p (operand, mode)
if (PUSH_POP_ADDRESS_P (operand))
return 1;
if (!register_indirect_p (operand, mode,
(reload_completed | reload_in_progress)))
if (!register_indirect_p (operand, mode, reload_completed))
return 0;
if (TARGET_M6812 && GET_CODE (operand) == PLUS
@ -570,6 +577,12 @@ m68hc11_small_indexed_indirect_p (operand, mode)
{
base = XEXP (operand, 0);
offset = XEXP (operand, 1);
/* The offset can be a symbol address and this is too big
for the operand constraint. */
if (GET_CODE (base) != CONST_INT && GET_CODE (offset) != CONST_INT)
return 0;
if (GET_CODE (base) == CONST_INT)
offset = base;
@ -853,7 +866,7 @@ tst_operand (operand, mode)
rtx operand;
enum machine_mode mode;
{
if (GET_CODE (operand) == MEM)
if (GET_CODE (operand) == MEM && reload_completed == 0)
{
rtx addr = XEXP (operand, 0);
if (m68hc11_auto_inc_p (addr))
@ -1010,6 +1023,7 @@ symbolic_memory_operand (op, mode)
return 1;
case CONST:
op = XEXP (op, 0);
return ((GET_CODE (XEXP (op, 0)) == SYMBOL_REF
|| GET_CODE (XEXP (op, 0)) == LABEL_REF)
&& GET_CODE (XEXP (op, 1)) == CONST_INT);

View File

@ -1275,10 +1275,14 @@ extern unsigned char m68hc11_reg_valid_for_index[FIRST_PSEUDO_REGISTER];
a mode offset to access the lowest part of the data.
(For example, for an SImode, the last valid offset is 252.) */
#define VALID_CONSTANT_OFFSET_P(X,MODE) \
((GET_CODE (X) == CONST_INT) && \
((INTVAL (X) >= VALID_MIN_OFFSET) \
&& ((INTVAL (X) <= VALID_MAX_OFFSET \
- (HOST_WIDE_INT) (GET_MODE_SIZE (MODE) + 1)))))
(((GET_CODE (X) == CONST_INT) && \
((INTVAL (X) >= VALID_MIN_OFFSET) \
&& ((INTVAL (X) <= VALID_MAX_OFFSET \
- (HOST_WIDE_INT) (GET_MODE_SIZE (MODE) + 1))))) \
|| (TARGET_M6812 \
&& ((GET_CODE (X) == SYMBOL_REF) \
|| GET_CODE (X) == LABEL_REF \
|| GET_CODE (X) == CONST)))
/* This is included to allow stack push/pop operations. Special hacks in the
md and m6811.c files exist to support this. */