This is the mail archive of the
mailing list for the GCC project.
Re: Implementing a restrictive addressing mode for a gcc port
- From: Jim Wilson <wilson at tuliptree dot org>
- To: Mohamed Shafi <shafitvm at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 31 Mar 2008 13:40:30 -0700
- Subject: Re: Implementing a restrictive addressing mode for a gcc port
- References: <firstname.lastname@example.org>
Mohamed Shafi wrote:
For the source or the destination register Rd/Ra, the restriction is
that it should be one more than the base register . So the following
instructions are valid:
GCC doesn't provide any easy way for the source address to depend on the
destination address, or vice versa.
One thing you could try is generating a double-word pseudo-reg at RTL
expand time, and then using subreg 0 for the source and subreg 1 for the
dest (or vice versa depending on endianness/word order). This will get
you a register pair you can use from the register allocator. This
doesn't help at reload time though.
You probably have to define a constraint for every register, and then
write an alternative for every register pair matching the correct even
register with the correct odd register. That gets you past reload.
Another alternative might be to have a pattern (e.g. reload_insi) that
generates secondary reloads that request the register pair you need.
This is unlikely to get good code, but would not be hard to do.