diff options
author | Richard Sandiford <rsandifo@redhat.com> | 2003-10-06 17:52:37 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2003-10-06 17:52:37 +0000 |
commit | d902180054f1d43e02888702f848a2d8cc97a559 (patch) | |
tree | b43788c1159ac630c454ec47292871d20fd76763 /gcc/config/mips/mips.c | |
parent | 4fef83a7dd56abbc587d91d0bf738942ac510189 (diff) | |
download | gcc-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.c | 16 |
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 |