Beginner questions for backend development

I’m playing with Backend a bit and is trying to build a backend for my toy ISA.


Each register in my ISA has three alias:
X0 refers to the full native 64bit register:
Y0 refers to the lower 32bit
Z0 refers to the lower 16bit
Q0 refers to the lower 8bit

What I did was:

  • start from Q0
  • for Z0, set SubRegIndices to SubRegIndex<8, 56> and SubRegs to !cast<REGISTERCLASSNAME>(Q0)
  • for Y0, set SubRegIndices to SubRegIndex<16, 48> and SubRegs to !cast<REGISTERCLASSNAME>(Z0)
  • for X0, set SubRegIndices to SubRegIndex<32, 32> and SubRegs to !cast<REGISTERCLASSNAME>(Y0)

I wonder if this is correct as I’m still very confused and the official documentation doesn’t seem to mention this type of register structure