aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/mips/mips.c
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@redhat.com>2003-10-06 17:52:37 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2003-10-06 17:52:37 +0000
commitd902180054f1d43e02888702f848a2d8cc97a559 (patch)
treeb43788c1159ac630c454ec47292871d20fd76763 /gcc/config/mips/mips.c
parent4fef83a7dd56abbc587d91d0bf738942ac510189 (diff)
downloadgcc-d902180054f1d43e02888702f848a2d8cc97a559.zip
gcc-d902180054f1d43e02888702f848a2d8cc97a559.tar.gz
gcc-d902180054f1d43e02888702f848a2d8cc97a559.tar.bz2
mips.h (PREDICATE_CODES): Add stack_operand.
* config/mips/mips.h (PREDICATE_CODES): Add stack_operand. * config/mips/mips.c (stack_operand): New predicate. * config/mips/mips.md: Use it for the destination of mips16 insns that store $31. From-SVN: r72158
Diffstat (limited to 'gcc/config/mips/mips.c')
-rw-r--r--gcc/config/mips/mips.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 304cf1d..6c9d5ec 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -1543,6 +1543,22 @@ symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
}
+/* Return true if OP is a memory reference that uses the stack pointer
+ as a base register. */
+
+int
+stack_operand (rtx op, enum machine_mode mode)
+{
+ struct mips_address_info addr;
+
+ return ((mode == VOIDmode || mode == GET_MODE (op))
+ && GET_CODE (op) == MEM
+ && mips_classify_address (&addr, XEXP (op, 0),
+ GET_MODE (op), false, true) == ADDRESS_REG
+ && addr.reg == stack_pointer_rtx);
+}
+
+
/* This function is used to implement GO_IF_LEGITIMATE_ADDRESS. It
returns a nonzero value if X is a legitimate address for a memory
operand of the indicated MODE. STRICT is nonzero if this function