This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Specifics of `BASE_REG_CLASS` macro?
- From: Maxim Blinov <maxim dot a dot blinov at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Fri, 31 Mar 2017 16:09:46 +0100
- Subject: Specifics of `BASE_REG_CLASS` macro?
- Authentication-results: sourceware.org; auth=none
Hi,
I am configuring a GCC backend for my CPU architecture. However, I am
uncertain as to what I should define the `BASE_REG_CLASS` macro to.
> 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.
So, I understand that this macro should return a class of registers
which may appear in instructions of the following form:
`move *(%reg + $offset), %reg`
My architecture only permits register dereferencing with no offset,
apart from the stack register. My questions are:
Should I consequently define the BASE_REG_CLASS macro to return the
stack pointer register class, and second...
What is the consequence of having no general registers be capable of
being dereferenced with an immediate offset, in terms of the
implementation-specific code that I would need to add, alongside the
standard assortment of machine description files?