This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Problem with ColdFire restricted addressing modes (mode5.6 combination)
- From: James E Wilson <wilson at specifixinc dot com>
- To: Peter Barada <peter at the-baradas dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 17 Aug 2004 16:25:55 -0700
- Subject: Re: Problem with ColdFire restricted addressing modes (mode5.6 combination)
- References: <20040817011234.E4EF498C8A@baradas.org>
Peter Barada wrote:
For moves, ColdFire is limited to(Smode = source, Dmode - destination):
A coldfire instruction is limited to at most 6 bytes, i.e. 2 extension
words. So a test like
num_ext_words (operand[0]) + num_ext_words (operand[1]) <= 2
should work to eliminate the cases that are too long. This should solve
the 5/6 problem.
The other cases are likely already handled by the constraints and
predicates, e.g. you can't have a PC-relative address mode in the dest,
even if it meets the 2-extension word rule. Thus you shouldn't have to
do anything special for them.
You can't have multiple mov* patterns. reload will fail if you do that.
You might have to define some secondary_reload support, if reload
accidentally generates something that is invalid.
Having a test for extension words in the condition may be inconvenient.
An alternative would be to use EXTRA_CONSTRAINTS to define contraints
that match all 0 extension word addresses, all 1 extension word
addresses, and all 2 extension word addresses. Then you can make define
movsi with 3 alternatives, one for the 0-ext-word dest 2-ext-word source
case, one for the 2-ext-word dest 0-ext-word source case, and one for
the 0 or 1 ext word dest with 0 or 1 ext word source case.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com