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)
>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.
That should work, I'll have to futz with it to see, something like:
(define_insn "movhi_cf"
[(set (match_operand:HI 0 "nonimmediate_operand" "=r<Q>,g")
(match_operand:HI 1 "general_operand" "g,r<Q>"))]
"TARGET_COLDFIRE && !TARGET_CFV4 && (num_ext_words (operand[0]) +
num_ext_words (operand[1]) <= 2)"
"* return output_move_himode (operands);")
>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.
I wasn't thinking of multiple define_expand patterns, but multiple
define_insns (unnamed) to cover each of the combinations with
constraints that work for those predicates...
>You might have to define some secondary_reload support, if reload
>accidentally generates something that is invalid.
Reload runs anything it creates through recog() to make sure its
valid RTL where the condition to count the extension words will fail,
right?
--
Peter Barada
peter@the-baradas.com