This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RTL, ColdFire 24/63] Add support for a MODE_INDEX_REG_CLASS macro


Richard Sandiford wrote:

In the code guarded by double_reg_address_ok, reload is trying to create
a valid offsetable base+index address.  Given the above, I think the
*_REG_CLASS group of macros -- the "how do I make this address valid?"
macros -- ought to be directly telling reload what class of index
register is allowed in such an address.  And the backend should answer
NO_REGS if it doesn't allow any register to be used like that,
much as EXTRA_CONSTRAINT would return NO_REGS for register classes
that aren't available with the current command-line options.
An obvious way do to this would be add an "offsetable_p" argument to
MODE_INDEX_REG_CLASS and mode_reg_class (i.e. the addresses.h function
in my patch that wraps the target macros).

This approach seems far cleaner to me.  The current code, and the
code after your patch, is jumping through hoops trying to guess what
constitutes an offsetable base+index address, and in which contexts
such an address is valid.  But this is information that the backend knows
a priori.  I think adding an "offsetable_p" argument to MODE_INDEX_REG_CLASS
would be:

I have to say I agree with Richard. Jeff's patch is certainly good as far as it goes, but to make the target's addressing mode description entirely consistent we'd still need MODE_INDEX_REG_CLASS (although it may well be that it makes no real difference at this point). Once we do that, it seems that double_reg_address_ok could be eliminated in favour of directly using that target macro.



Bernd -- This footer brought to you by insane German lawmakers. Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen Registergericht Muenchen HRB 40368 Geschaeftsfuehrer Thomas Wessel, Vincent Roche, Joseph E. McDonough


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]