recog.c (pop_operand): New function.

* recog.c (pop_operand): New function.
        * recog.h (pop_operand): Declare it.
        * genrecog.c (preds): Define it.

From-SVN: r24774
This commit is contained in:
Richard Henderson 1999-01-19 13:55:35 -08:00 committed by Richard Henderson
parent d804ed43d0
commit 6fbe9bd840
4 changed files with 39 additions and 0 deletions

View File

@ -1,5 +1,9 @@
Tue Jan 19 21:20:52 1999 Richard Henderson <rth@cygnus.com>
* recog.c (pop_operand): New function.
* recog.h (pop_operand): Declare it.
* genrecog.c (preds): Define it.
* expr.c (do_jump_for_compare): Handle conditional branch expanders
emitting multiple jump instructions.
* jump.c (condjump_label): New function.

View File

@ -161,6 +161,7 @@ static struct pred_table
{"nonmemory_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF,
LABEL_REF, SUBREG, REG}},
{"push_operand", {MEM}},
{"pop_operand", {MEM}},
{"memory_operand", {SUBREG, MEM}},
{"indirect_operand", {SUBREG, MEM}},
{"comparison_operator", {EQ, NE, LE, LT, GE, GT, LEU, LTU, GEU, GTU}},

View File

@ -41,6 +41,14 @@ Boston, MA 02111-1307, USA. */
#endif
#endif
#ifndef STACK_POP_CODE
#ifdef STACK_GROWS_DOWNWARD
#define STACK_POP_CODE POST_INC
#else
#define STACK_POP_CODE POST_DEC
#endif
#endif
static void validate_replace_rtx_1 PROTO((rtx *, rtx, rtx, rtx));
static rtx *find_single_use_1 PROTO((rtx, rtx *));
static rtx *find_constant_term_loc PROTO((rtx *));
@ -1200,6 +1208,31 @@ push_operand (op, mode)
return XEXP (op, 0) == stack_pointer_rtx;
}
/* Return 1 if OP is a valid operand that stands for popping a
value of mode MODE off the stack.
The main use of this function is as a predicate in match_operand
expressions in the machine description. */
int
pop_operand (op, mode)
rtx op;
enum machine_mode mode;
{
if (GET_CODE (op) != MEM)
return 0;
if (GET_MODE (op) != mode)
return 0;
op = XEXP (op, 0);
if (GET_CODE (op) != STACK_POP_CODE)
return 0;
return XEXP (op, 0) == stack_pointer_rtx;
}
/* Return 1 if ADDR is a valid memory address for mode MODE. */
int

View File

@ -98,6 +98,7 @@ extern int const_double_operand PROTO((rtx, enum machine_mode));
extern int nonimmediate_operand PROTO((rtx, enum machine_mode));
extern int nonmemory_operand PROTO((rtx, enum machine_mode));
extern int push_operand PROTO((rtx, enum machine_mode));
extern int pop_operand PROTO((rtx, enum machine_mode));
extern int memory_operand PROTO((rtx, enum machine_mode));
extern int indirect_operand PROTO((rtx, enum machine_mode));
extern int mode_independent_operand PROTO((rtx, enum machine_mode));