[Libre-soc-dev] Question about smaller reg access

Jacob Lifshay programmerjake at gmail.com
Sun Dec 27 02:04:22 GMT 2020


On Fri, Dec 25, 2020, 23:10 Lauri Kasanen <cand at gmx.com> wrote:

> Hi,
>
> Just something that popped up, apologies if some doc already covers
> this.
>
> How are sub-64-bit regs accessed if they happen to start in the middle
> of a 64-bit reg? The examples I've seen all start at 64b reg borders.
>

The basic answer is that the compiler doesn't allocate just part of a
64-bit reg, it always allocates full 64-bit registers and leaves the extra
space unused, so allocated vectors always start at a 64-bit boundary.

If needed, code to access the middle of a 64-bit register can be generated,
just like a compiler can generate code to access a C-style bit-field.

Jacob


More information about the Libre-soc-dev mailing list