From 8d36d33b3c4a51c43ae60aed8328f6cbe5f41843 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Thu, 17 Nov 1994 14:43:33 -0500 Subject: [PATCH] (some_operand): New function. From-SVN: r8481 --- gcc/config/alpha/alpha.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index 6cf81d1ce7f..12608fe1b53 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -280,6 +280,30 @@ reg_or_cint_operand (op, mode) return GET_CODE (op) == CONST_INT || register_operand (op, mode); } +/* Return 1 if OP is something that can be reloaded into a register; + if it is a MEM, it need not be valid. */ + +int +some_operand (op, mode) + register rtx op; + enum machine_mode mode; +{ + if (mode != VOIDmode && GET_MODE (op) != VOIDmode && mode != GET_MODE (op)) + return 0; + + switch (GET_CODE (op)) + { + case REG: case MEM: case CONST_DOUBLE: + case CONST_INT: case LABEL_REF: case SYMBOL_REF: case CONST: + return 1; + + case SUBREG: + return some_operand (SUBREG_REG (op), VOIDmode); + } + + return 0; +} + /* Return 1 if OP is a valid operand for the source of a move insn. */ int