On 03/10/2019 10:48, Segher Boessenkool wrote:
On Thu, Oct 03, 2019 at 10:35:15AM +0100, Richard Earnshaw (lists) wrote:
On 03/10/2019 00:01, Segher Boessenkool wrote:
The documentation says
@findex ALL_REGS
@findex NO_REGS
In general, each register will belong to several classes. In fact, one
class must be named @code{ALL_REGS} and contain all the registers. Another
class must be named @code{NO_REGS} and contain no registers. Often the
union of two classes will be another class; however, this is not required.
so is the arm port wrong, or is the documentation wrong? I think the arm
port simply forgets to include CC_REG, VFPCC_REG, SFP_REG, AFP_REG:
#define REG_CLASS_CONTENTS \
...
{ 0x00000000, 0x00000000, 0x00000000, 0x00000010 }, /* CC_REG */ \
{ 0x00000000, 0x00000000, 0x00000000, 0x00000020 }, /* VFPCC_REG */ \
{ 0x00000000, 0x00000000, 0x00000000, 0x00000040 }, /* SFP_REG */ \
{ 0x00000000, 0x00000000, 0x00000000, 0x00000080 }, /* AFP_REG */ \
{ 0xFFFF7FFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0000000F } /* ALL_REGS */ \
and that last number should be 0x000000ff instead?
Well CC_REG is completely fixed and can't be used for anything other
than condition flags. The register allocator should never be
considering it for allocation. So at that level, it really shouldn't
matter and adding it would just make more useless work for the register
allocator.
The omission of SFP_REG and AFP_REG is probably also deliberate. These
are essentially special pseudo regs that MUST be eliminated during frame
layout. They should certainly never be considered for general allocation.
But ALL_REGS should contain *all* registers. The union of any two register
classes has to be contained in some register class, so every register class
has to be contained in ALL_REGS.
Segher
Why would anyone want a to form a union of one class with a class that
can't be used for allocation. That's just silly.
R.