This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Help with constraint for single register
On Sun, Dec 26, 2004 at 07:26:21PM -0500, Robert Baruch wrote:
> Well, I'm afraid I'm very confused about the whole reload thing. I defined:
>
> #define PREFERRED_RELOAD_CLASS(X,CLASS) \
> ((REG_P(X) && REGNO(X)==W_REGNO) ? (CLASS) : W_REG)
> #define SECONDARY_RELOAD_CLASS(CLASS, MODE, X) W_REG
>
> So if I understand the documentation correctly, this says that:
>
> 1) W may be moved into any register
> 2) Any register except W must be moved into W
> 3) All moves must involve the W register as an intermediate register
Take a look at Ulrich's suggestion again, and some other port that uses
SECONDARY_RELOAD_CLASS. You can't ignore the arguments that way;
sometimes it has to return NO_REGS.
> So in that case, it looks like I may have to do both:
>
> 1) Generate only moves through W in the expander for movqi.
You want to do this, because you'll get better code that way.
> 2) Define the reload classes appropriately so that reloads always go through W.
Probably, yes.
--
Daniel Jacobowitz