On Thu, Oct 03, 2019 at 10:52:38AM +0100, Richard Sandiford wrote:
>       /* Certain fixed registers might be of the class NO_REGS.  This means
>        that not only can they not be allocated by the compiler, but
>        they cannot be used in substitutions or canonicalizations
>        either.  */
> 
> (from cse.c).  This isn't actually documented AFAICT.  But it is
> useful for registers that are only allowed to appear in special
> instructions that the port generates itself.  (Or at least it was useful.
> operand_reg_set was supposed to be a more flexible way of doing this.)

You can also put such regs in ALL_REGS but in no other register class.
And it works fine if you do not handle non-allocatable registers at all
in REGNO_REG_CLASS, btw., but it should really be ALL_REGS then.

> There's also the problem that if you don't actually need a register
> to be in a class for its own sake, but only because the documentation
> says so, then it's less clear how individual registers should be
> grouped into classes.  E.g. is having separate SFP_REG and AFP_REG
> classes right (as above), or should they really be members of a
> single class?  In practice it doesn't matter because nothing ever
> uses these classes [ ... ]

Yeah exactly.  Register classes only matter for allocatable registers.

Thanks for the exposition,


Segher

Reply via email to