Problem with ColdFire restricted addressing modes (mode5.6 combination)

James E Wilson wilson@specifixinc.com
Tue Aug 17 23:44:00 GMT 2004


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



More information about the Gcc mailing list