This is the mail archive of the 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: How to handle subreg(mem(X)) after reload?

Robert Baruch wrote:
without a hard register. For strict base pointers, does that mean that
there must exist, at a minimum, an addressing mode where base + offset
is valid?

No. IA-64 for instance has no base+offset addressing modes. I believe there is at least one other existing target with the same limitation.

GO_IF_LEGITIMATE_ADDRESS defines the addressing modes. The base registers are used by reload. If we have an address that needs reloading, we will generate a reload into a base register. So base registers is just the set of registers that can be used to hold addresses for load/store instructions.

The only potential problem here is that gcc assumes that addressing is orthogonal, i.e. add address registers support all addressing modes. If your target doesn't work this way, then a gcc port will be tricky, and will probably require defining lots of extra constraints and special patterns.

1. Does that mean FSR should be the only allowable base register?

I don't know enough about your target. Any register which can be used to hold an address for load/store, and which supports all addressing modes accepted by GO_IF_LEGITIMATE_ADDRESS, can be a base register.

2. Or is FSR disqualified as a base register because there is no
addressing mode for FSR + offset?

No. If GO_IF_LEGITIMATE_ADDRESS does not include base+offset, then gcc won't generate it.

3. Will I run into trouble if I have only one allowable strict base register?

That will make reload's job hard. If you have 3-operand instructions, you may run into trouble if both input operands need reloads from memory. If you have only 2-operand instructions, then it will probably work out OK, as input operand reloads come before the instruction and output operand reloads can be put after the instruction, so you may not need two base registers at the same time.

You will just have to try it and see.

4. Or should I allow a few other registers and fix up the code to only
use FSR later?

Don't know enough at this time. -- Jim Wilson, GNU Tools Support,

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