(memop_valid): Memory indirection now valid.

(nonindirect_operand): Remove.
(print_operand): Fix 'J' output modifier.

From-SVN: r13964
This commit is contained in:
Richard Kenner 1997-04-23 09:47:57 -04:00
parent fd07302117
commit 7bbf567063

View File

@ -217,26 +217,35 @@ mod_regno_adjust (instr, op)
} }
/* Auxiliary to `nonindirect_operand': /* Check if op is a valid memory operand for 1750A Load/Store instructions
Check if op is a valid memory operand for 1750A arith./logic (non-move) (memory indirection permitted.) */
instructions. */
int int
memop_valid (op) memop_valid (op)
rtx op; rtx op;
{ {
if (GET_MODE (op) != Pmode && GET_MODE (op) != VOIDmode) static int recurred = 0;
int valid;
if (GET_MODE (op) != Pmode && GET_MODE (op) != VOIDmode
&& GET_MODE (op) != QImode)
return 0; return 0;
switch (GET_CODE (op)) switch (GET_CODE (op))
{ {
case MEM: case MEM:
if (!recurred && GET_CODE (XEXP (op, 0)) == REG)
return 1;
case MINUS: case MINUS:
case MULT: case MULT:
case DIV: case DIV:
return 0; return 0;
case PLUS: case PLUS:
if (!memop_valid (XEXP (op, 0))) recurred = 1;
return 0; valid = memop_valid (XEXP (op, 0));
return memop_valid (XEXP (op, 1)); if (valid)
valid = memop_valid (XEXP (op, 1));
recurred = 0;
return valid;
case REG: case REG:
if (REGNO (op) > 0) if (REGNO (op) > 0)
return 1; return 1;
@ -252,27 +261,6 @@ memop_valid (op)
} }
} }
/* extra predicate for recog: */
int
nonindirect_operand (op, mode)
rtx op;
enum machine_mode mode;
{
int retval;
switch (GET_CODE (op))
{
case MEM:
retval = memop_valid (XEXP (op, 0));
return retval;
case REG:
return 1;
default:
if (!CONSTANT_P (op))
return 0;
}
return 1;
}
/* predicate for the MOV instruction: */ /* predicate for the MOV instruction: */
int int
@ -544,7 +532,7 @@ print_operand (file, x, letter)
case CONST_INT: case CONST_INT:
if (letter == 'J') if (letter == 'J')
fprintf (file, "%d", -INTVAL (x)); fprintf (file, "%d", -INTVAL (x));
if (letter == 'b') else if (letter == 'b')
fprintf (file, "%d", which_bit (INTVAL (x))); fprintf (file, "%d", which_bit (INTVAL (x)));
else if (letter == 'B') else if (letter == 'B')
fprintf (file, "%d", which_bit (~INTVAL (x))); fprintf (file, "%d", which_bit (~INTVAL (x)));