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: Base register restrictions


Dobes <bdobry@udel.edu> writes:

> I am working on a port to an architecture with some strict rules.  The
> restriction that I am unable to figure out how to enforce is a base register
> that is allowed in the destination operand, but not in a source operand. 
> For example, this would be allowed "add 4($1), $8, $9", but this would not
> be allowed "add $8, 4($1), $9" because $1 can only be used a base register
> for the destination operand.  Is there any way to get that kind of
> information in GO_IF_LEGITIMATE_ADDRESS or can you think of some other way
> to handle this?  Anyone know of a port with something similar that I could
> look at?  Thanks.

This kind of restriction would normally be handled via appropriate use
of register classes in the define_insn patterns.  You will also want to
make sure that BASE_REG_CLASS and REGNO_OK_FOR_BASE_P are definedly
correctly.

Ian


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