REGNO_OK_FOR_BASE_P: Difference to BASE_REG_CLASS?

Maxim Blinov maxim.a.blinov@gmail.com
Mon Jun 19 19:31:00 GMT 2017


>From the gcc-internals "Register Classes" manual:
> Macro: REGNO_OK_FOR_BASE_P (num)
>
> A C expression which is nonzero if register number num is suitable for
> use as a base register in operand addresses.

I cannot clearly discern as to what the last part of the definition is
referring to, and how it is different to that of the BASE_REG_CLASS
definition.

If I reword "operand addresses" as "address of an operand", then the
definition seems to me to define the class of registers that can be used
as follows:

move *( %r0 + offset ), ...

Where `%r0 + offset` contains the "operand address".

Assuming my above understanding is correct, it now occurs to me that
`BASE_REG_CLASS` also defines the same class of registers.

Obviously, two macros wouldn't define the same thing, so what is the
subtle difference between what type of base registers they define?

For note:
> Macro: BASE_REG_CLASS

> A macro whose definition is the name of the class to which a valid
> base register must belong. A base register is one used in an address
> which is the register value plus a displacement.



More information about the Gcc-help mailing list