This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Base register restrictions
- From: Ian Lance Taylor <iant at google dot com>
- To: Dobes <bdobry at udel dot edu>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 29 Jun 2009 14:11:13 -0700
- Subject: Re: Base register restrictions
- References: <24259346.post@talk.nabble.com>
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