Commit 556ffcc5 by Richard Henderson Committed by Richard Henderson

recog.c (pmode_register_operand): New.

        * recog.c (pmode_register_operand): New.
        * recog.h: Declare it.
        * genrecog.c (pred_codes): Likewise.
        (special_mode_pred_table): Likewise.
        (validate_pattern): Don't warn no mode for address_operand.

        * print-rtl.c (print_rtx) [LABEL_REF]: Only do full subexpression
        if the operand is not insn-like.

From-SVN: r29995
parent 10414089
Thu Oct 14 18:48:54 1999 Richard Henderson <rth@cygnus.com>
* recog.c (pmode_register_operand): New.
* recog.h: Declare it.
* genrecog.c (pred_codes): Likewise.
(special_mode_pred_table): Likewise.
(validate_pattern): Don't warn no mode for address_operand.
* print-rtl.c (print_rtx) [LABEL_REF]: Only do full subexpression
if the operand is not insn-like.
Thu Oct 14 19:38:42 1999 Jeffrey A Law (law@cygnus.com)
Sylvian Pion <Sylvain.Pion@sophia.inria.fr>
......
......@@ -197,6 +197,7 @@ static struct pred_table
{"address_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF,
LABEL_REF, SUBREG, REG, MEM, PLUS, MINUS, MULT}},
{"register_operand", {SUBREG, REG}},
{"pmode_register_operand", {SUBREG, REG}},
{"scratch_operand", {SCRATCH, REG}},
{"immediate_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF,
LABEL_REF}},
......@@ -220,11 +221,11 @@ static const char * special_mode_pred_table[] = {
#ifdef SPECIAL_MODE_PREDICATES
SPECIAL_MODE_PREDICATES
#endif
NULL
"pmode_register_operand"
};
#define NUM_SPECIAL_MODE_PREDS \
(sizeof (special_mode_pred_table) / sizeof (const char *) - 1)
(sizeof (special_mode_pred_table) / sizeof (special_mode_pred_table[0]))
static struct decision *new_decision
PROTO((const char *, struct decision_head *));
......@@ -516,15 +517,18 @@ validate_pattern (pattern, insn, set_dest)
/* A modeless MATCH_OPERAND can be handy when we can
check for multiple modes in the c_test. In most other cases,
it is a mistake. Only DEFINE_INSN is eligible, since SPLIT
and PEEP2 can FAIL within the output pattern. */
and PEEP2 can FAIL within the output pattern. Exclude
address_operand, since its mode is related to the mode of
the memory not the operand. */
if (GET_MODE (pattern) == VOIDmode
&& code == MATCH_OPERAND
&& pred_name[0] != '\0'
&& GET_CODE (insn) == DEFINE_INSN
&& allows_non_const
&& ! special_mode_pred
&& strstr (c_test, "operands") == NULL
&& GET_CODE (insn) == DEFINE_INSN)
&& pred_name[0] != '\0'
&& strcmp (pred_name, "address_operand") != 0
&& strstr (c_test, "operands") == NULL)
{
message_with_line (pattern_lineno,
"warning: operand %d missing mode?",
......
......@@ -299,16 +299,21 @@ print_rtx (in_rtx)
case 'u':
if (XEXP (in_rtx, i) != NULL)
{
if (GET_CODE (XEXP (in_rtx, i)) != CODE_LABEL)
rtx sub = XEXP (in_rtx, i);
enum rtx_code subc = GET_CODE (sub);
if (subc != CODE_LABEL
&& subc != NOTE
&& GET_RTX_CLASS (subc) != 'i')
goto do_e;
if (flag_dump_unnumbered)
fputc ('#', outfile);
else
fprintf (outfile, " %d", INSN_UID (XEXP (in_rtx, i)));
fprintf (outfile, " %d", INSN_UID (sub));
}
else
fputs (" 0", outfile);
fputs (" (nil)", outfile);
sawclose = 0;
break;
......
......@@ -1027,6 +1027,16 @@ register_operand (op, mode)
|| REGNO_REG_CLASS (REGNO (op)) != NO_REGS));
}
/* Return 1 for a register in Pmode; ignore the tested mode. */
int
pmode_register_operand (op, mode)
rtx op;
enum machine_mode mode ATTRIBUTE_UNUSED;
{
return register_operand (op, Pmode);
}
/* Return 1 if OP should match a MATCH_SCRATCH, i.e., if it is a SCRATCH
or a hard register. */
......
......@@ -91,6 +91,7 @@ extern rtx *find_single_use PROTO((rtx, rtx, rtx *));
extern int general_operand PROTO((rtx, enum machine_mode));
extern int address_operand PROTO((rtx, enum machine_mode));
extern int register_operand PROTO((rtx, enum machine_mode));
extern int pmode_register_operand PROTO((rtx, enum machine_mode));
extern int scratch_operand PROTO((rtx, enum machine_mode));
extern int immediate_operand PROTO((rtx, enum machine_mode));
extern int const_int_operand PROTO((rtx, enum machine_mode));
......
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