This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to define predicates for the particular set of registers?


>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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]