This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: How to define predicates for the particular set of registers?
- From: Peter Barada <pbarada at mail dot wm dot sps dot mot dot com>
- To: aaganichev at yandex dot ru
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 27 May 2003 11:24:31 -0400
- Subject: Re: How to define predicates for the particular set of registers?
- References: <3ED361E3.00000A.17182@camay.yandex.ru>
>I wonder how to define predicates for the particular set of registers?
>For example, if insn should accept only stack pointer register should
>I check the operand like this:
>
>REG_P (operand) && (REGNO (operand) == SP_REGISTER)
>
>or this:
>
>(operand == stack_pointer_rtx)
>
>or should I do something like that:
>
>register_operand (operand, mode)
>&& (!REG_P (operand) || (REGNO (operand) == SP_REGISTER))
>
>because of register_operand contains some logic on handling
>SUBREGs and RTLs which will be reloaded?
Look at push_operand in gcc/recog.c to get an idea.
--
Peter Barada Peter.Barada@motorola.com
Wizard 781-852-2768 (direct)
WaveMark Solutions(A Motorola Company) 781-270-0193 (fax)