This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: Plan for cleaning up the "Addressing Modes" macros
- From: Richard Sandiford <rsandifo at redhat dot com>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 28 Feb 2005 15:05:52 +0000
- Subject: Re: RFC: Plan for cleaning up the "Addressing Modes" macros
- References: <878y59qtmk.fsf@codesourcery.com>
Zack Weinberg <zack@codesourcery.com> writes:
> I have worked out a tentative plan for replacing most of these macros
> with ordinary target hooks, and eliminating REG_OK_STRICT. I propose
> to change GO_IF_LEGITIMATE_ADDRESS, GO_IF_MODE_DEPENDENT_ADDRESS,
> LEGITIMIZE_ADDRESS, LEGITIMIZE_RELOAD_ADDRESS, REG_OK_FOR_BASE_P,
> REG_MODE_OK_FOR_BASE_P, REG_MODE_OK_FOR_REG_BASE_P,
> REG_OK_FOR_INDEX_P, CONSTANT_ADDRESS_P, FIND_BASE_TERM, and
> LEGITIMATE_CONSTANT_P. The other macros in this section are all
> numeric constants and in at least one case are used to size static
> arrays, so conversion to hooks doesn't make sense (yet).
Maybe this is going off at too much of a tangent, but I've often thought
it would be nice to combine some of these macros. For example, rather
than replace both GO_IF_LEGITIMATE_ADDRESS and GO_IF_MODE_DEPENDENT_
ADDRESS with new target hooks, why not have a single target hook in
which a mode argument of VOIDmode means "valid for all modes"? A change
like that should help to reduce code duplication in backends and ought
to fit in with the step-by-step transition.
Richard