Commit 93fa8428 by Andreas Krebbel Committed by Andreas Krebbel

s390.c (s390_decompose_address): Allow SImode for index and base register.

2006-03-24  Andreas Krebbel  <krebbel1@de.ibm.com>

	* config/s390/s390.c (s390_decompose_address): Allow SImode for
	index and base register.
	(s390_expand_plug_operand, legitimate_address_p, preferred_la_operand_p,
	print_operand_address, print_operand): Replaced REG_OK_FOR_BASE_STRICT_P
	with REGNO_OK_FOR_BASE_P and REG_OK_FOR_INDEX_STRICT_P with
	REGNO_OK_FOR_INDEX_P.
	* config/s390/s390.h (REGNO_OK_FOR_INDEX_P): Replaced check with
	ADDR_REGNO_P.
	(REG_OK_FOR_INDEX_NONSTRICT_P, REG_OK_FOR_BASE_NONSTRICT_P,
	REG_OK_FOR_INDEX_STRICT_P, REG_OK_FOR_BASE_STRICT_P, REG_OK_FOR_INDEX_P,
	REG_OK_FOR_BASE_P): Definitions removed.

From-SVN: r112357
parent d0c03515
2006-03-24 Andreas Krebbel <krebbel1@de.ibm.com>
* config/s390/s390.c (s390_decompose_address): Allow SImode for
index and base register.
(s390_expand_plug_operand, legitimate_address_p, preferred_la_operand_p,
print_operand_address, print_operand): Replaced REG_OK_FOR_BASE_STRICT_P
with REGNO_OK_FOR_BASE_P and REG_OK_FOR_INDEX_STRICT_P with
REGNO_OK_FOR_INDEX_P.
* config/s390/s390.h (REGNO_OK_FOR_INDEX_P): Replaced check with
ADDR_REGNO_P.
(REG_OK_FOR_INDEX_NONSTRICT_P, REG_OK_FOR_BASE_NONSTRICT_P,
REG_OK_FOR_INDEX_STRICT_P, REG_OK_FOR_BASE_STRICT_P, REG_OK_FOR_INDEX_P,
REG_OK_FOR_BASE_P): Definitions removed.
2006-03-24 Jakub Jelinek <jakub@redhat.com> 2006-03-24 Jakub Jelinek <jakub@redhat.com>
PR middle-end/26611 PR middle-end/26611
......
...@@ -1617,7 +1617,9 @@ s390_decompose_address (rtx addr, struct s390_address *out) ...@@ -1617,7 +1617,9 @@ s390_decompose_address (rtx addr, struct s390_address *out)
return false; return false;
} }
if (GET_CODE (base) != REG || GET_MODE (base) != Pmode) if (!REG_P (base)
|| (GET_MODE (base) != SImode
&& GET_MODE (base) != Pmode))
return false; return false;
if (REGNO (base) == STACK_POINTER_REGNUM if (REGNO (base) == STACK_POINTER_REGNUM
...@@ -1663,7 +1665,9 @@ s390_decompose_address (rtx addr, struct s390_address *out) ...@@ -1663,7 +1665,9 @@ s390_decompose_address (rtx addr, struct s390_address *out)
return false; return false;
} }
if (GET_CODE (indx) != REG || GET_MODE (indx) != Pmode) if (!REG_P (indx)
|| (GET_MODE (indx) != SImode
&& GET_MODE (indx) != Pmode))
return false; return false;
if (REGNO (indx) == STACK_POINTER_REGNUM if (REGNO (indx) == STACK_POINTER_REGNUM
...@@ -2678,8 +2682,8 @@ s390_expand_plus_operand (rtx target, rtx src, ...@@ -2678,8 +2682,8 @@ s390_expand_plus_operand (rtx target, rtx src,
/* If the address is already strictly valid, there's nothing to do. */ /* If the address is already strictly valid, there's nothing to do. */
if (!s390_decompose_address (src, &ad) if (!s390_decompose_address (src, &ad)
|| (ad.base && !REG_OK_FOR_BASE_STRICT_P (ad.base)) || (ad.base && !REGNO_OK_FOR_BASE_P (REGNO (ad.base)))
|| (ad.indx && !REG_OK_FOR_INDEX_STRICT_P (ad.indx))) || (ad.indx && !REGNO_OK_FOR_INDEX_P (REGNO (ad.indx))))
{ {
/* Otherwise, one of the operands cannot be an address register; /* Otherwise, one of the operands cannot be an address register;
we reload its value into the scratch register. */ we reload its value into the scratch register. */
...@@ -2727,19 +2731,24 @@ legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED, ...@@ -2727,19 +2731,24 @@ legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED,
if (strict) if (strict)
{ {
if (ad.base && !REG_OK_FOR_BASE_STRICT_P (ad.base)) if (ad.base && !REGNO_OK_FOR_BASE_P (REGNO (ad.base)))
return false; return false;
if (ad.indx && !REG_OK_FOR_INDEX_STRICT_P (ad.indx))
if (ad.indx && !REGNO_OK_FOR_INDEX_P (REGNO (ad.indx)))
return false; return false;
} }
else else
{ {
if (ad.base && !REG_OK_FOR_BASE_NONSTRICT_P (ad.base)) if (ad.base
return false; && !(REGNO (ad.base) >= FIRST_PSEUDO_REGISTER
if (ad.indx && !REG_OK_FOR_INDEX_NONSTRICT_P (ad.indx)) || REGNO_REG_CLASS (REGNO (ad.base)) == ADDR_REGS))
return false; return false;
if (ad.indx
&& !(REGNO (ad.indx) >= FIRST_PSEUDO_REGISTER
|| REGNO_REG_CLASS (REGNO (ad.indx)) == ADDR_REGS))
return false;
} }
return true; return true;
} }
...@@ -2770,9 +2779,9 @@ preferred_la_operand_p (rtx op1, rtx op2) ...@@ -2770,9 +2779,9 @@ preferred_la_operand_p (rtx op1, rtx op2)
if (!s390_decompose_address (op1, &addr)) if (!s390_decompose_address (op1, &addr))
return false; return false;
if (addr.base && !REG_OK_FOR_BASE_STRICT_P (addr.base)) if (addr.base && !REGNO_OK_FOR_BASE_P (REGNO (addr.base)))
return false; return false;
if (addr.indx && !REG_OK_FOR_INDEX_STRICT_P (addr.indx)) if (addr.indx && !REGNO_OK_FOR_INDEX_P (REGNO (addr.indx)))
return false; return false;
if (!TARGET_64BIT && !addr.pointer) if (!TARGET_64BIT && !addr.pointer)
...@@ -4500,8 +4509,8 @@ print_operand_address (FILE *file, rtx addr) ...@@ -4500,8 +4509,8 @@ print_operand_address (FILE *file, rtx addr)
struct s390_address ad; struct s390_address ad;
if (!s390_decompose_address (addr, &ad) if (!s390_decompose_address (addr, &ad)
|| (ad.base && !REG_OK_FOR_BASE_STRICT_P (ad.base)) || (ad.base && !REGNO_OK_FOR_BASE_P (REGNO (ad.base)))
|| (ad.indx && !REG_OK_FOR_INDEX_STRICT_P (ad.indx))) || (ad.indx && !REGNO_OK_FOR_INDEX_P (REGNO (ad.indx))))
output_operand_lossage ("cannot decompose address"); output_operand_lossage ("cannot decompose address");
if (ad.disp) if (ad.disp)
...@@ -4585,7 +4594,7 @@ print_operand (FILE *file, rtx x, int code) ...@@ -4585,7 +4594,7 @@ print_operand (FILE *file, rtx x, int code)
gcc_assert (GET_CODE (x) == MEM); gcc_assert (GET_CODE (x) == MEM);
ret = s390_decompose_address (XEXP (x, 0), &ad); ret = s390_decompose_address (XEXP (x, 0), &ad);
gcc_assert (ret); gcc_assert (ret);
gcc_assert (!ad.base || REG_OK_FOR_BASE_STRICT_P (ad.base)); gcc_assert (!ad.base || REGNO_OK_FOR_BASE_P (REGNO (ad.base)));
gcc_assert (!ad.indx); gcc_assert (!ad.indx);
if (ad.disp) if (ad.disp)
...@@ -4603,7 +4612,7 @@ print_operand (FILE *file, rtx x, int code) ...@@ -4603,7 +4612,7 @@ print_operand (FILE *file, rtx x, int code)
gcc_assert (GET_CODE (x) == MEM); gcc_assert (GET_CODE (x) == MEM);
ret = s390_decompose_address (XEXP (x, 0), &ad); ret = s390_decompose_address (XEXP (x, 0), &ad);
gcc_assert (ret); gcc_assert (ret);
gcc_assert (!ad.base || REG_OK_FOR_BASE_STRICT_P (ad.base)); gcc_assert (!ad.base || REGNO_OK_FOR_BASE_P (REGNO (ad.base)));
gcc_assert (!ad.indx); gcc_assert (!ad.indx);
if (ad.base) if (ad.base)
...@@ -4621,7 +4630,7 @@ print_operand (FILE *file, rtx x, int code) ...@@ -4621,7 +4630,7 @@ print_operand (FILE *file, rtx x, int code)
gcc_assert (GET_CODE (x) == MEM); gcc_assert (GET_CODE (x) == MEM);
ret = s390_decompose_address (XEXP (x, 0), &ad); ret = s390_decompose_address (XEXP (x, 0), &ad);
gcc_assert (ret); gcc_assert (ret);
gcc_assert (!ad.base || REG_OK_FOR_BASE_STRICT_P (ad.base)); gcc_assert (!ad.base || REGNO_OK_FOR_BASE_P (REGNO (ad.base)));
gcc_assert (!ad.indx); gcc_assert (!ad.indx);
if (ad.disp) if (ad.disp)
......
...@@ -476,8 +476,8 @@ extern const enum reg_class regclass_map[FIRST_PSEUDO_REGISTER]; ...@@ -476,8 +476,8 @@ extern const enum reg_class regclass_map[FIRST_PSEUDO_REGISTER];
or a pseudo register currently allocated to one such. */ or a pseudo register currently allocated to one such. */
#define REGNO_OK_FOR_INDEX_P(REGNO) \ #define REGNO_OK_FOR_INDEX_P(REGNO) \
(((REGNO) < FIRST_PSEUDO_REGISTER \ (((REGNO) < FIRST_PSEUDO_REGISTER \
&& REGNO_REG_CLASS ((REGNO)) == ADDR_REGS) \ && REGNO_REG_CLASS ((REGNO)) == ADDR_REGS) \
|| (reg_renumber[REGNO] > 0 && reg_renumber[REGNO] < 16)) || ADDR_REGNO_P (reg_renumber[REGNO]))
#define REGNO_OK_FOR_BASE_P(REGNO) REGNO_OK_FOR_INDEX_P (REGNO) #define REGNO_OK_FOR_BASE_P(REGNO) REGNO_OK_FOR_INDEX_P (REGNO)
...@@ -729,38 +729,6 @@ CUMULATIVE_ARGS; ...@@ -729,38 +729,6 @@ CUMULATIVE_ARGS;
/* Maximum number of registers that can appear in a valid memory address. */ /* Maximum number of registers that can appear in a valid memory address. */
#define MAX_REGS_PER_ADDRESS 2 #define MAX_REGS_PER_ADDRESS 2
/* The macros REG_OK_FOR..._P assume that the arg is a REG rtx and check
its validity for a certain class. We have two alternate definitions
for each of them. The usual definition accepts all pseudo regs; the
other rejects them all. The symbol REG_OK_STRICT causes the latter
definition to be used.
Most source files want to accept pseudo regs in the hope that they will
get allocated to the class that the insn wants them to be in.
Some source files that are used after register allocation
need to be strict. */
#define REG_OK_FOR_INDEX_NONSTRICT_P(X) \
((GET_MODE (X) == Pmode) && \
((REGNO (X) >= FIRST_PSEUDO_REGISTER) \
|| REGNO_REG_CLASS (REGNO (X)) == ADDR_REGS))
#define REG_OK_FOR_BASE_NONSTRICT_P(X) REG_OK_FOR_INDEX_NONSTRICT_P (X)
#define REG_OK_FOR_INDEX_STRICT_P(X) \
((GET_MODE (X) == Pmode) && (REGNO_OK_FOR_INDEX_P (REGNO (X))))
#define REG_OK_FOR_BASE_STRICT_P(X) \
((GET_MODE (X) == Pmode) && (REGNO_OK_FOR_BASE_P (REGNO (X))))
#ifndef REG_OK_STRICT
#define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_INDEX_NONSTRICT_P(X)
#define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_NONSTRICT_P(X)
#else
#define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_INDEX_STRICT_P(X)
#define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_STRICT_P(X)
#endif
/* S/390 has no mode dependent addresses. */ /* S/390 has no mode dependent addresses. */
#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL)
......
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