coreblocks
coreblocks copied to clipboard
Refactor the RS data layout
Some time ago, we made the decision to not use the physical register 0, so that the 0 can be used for two things:
- mark that an operand is not present,
- mark in RS that the value is computed or doesn't need to be computed.
If the value was not computed, the RS didn't even receive the register number.
Later, it turned out that, because of CSRRS and CSRRC, the CSR unit needs a special case for the logical register x0=0, which looks pretty ugly.
I think that the solution is simple: just use valid bits instead. This will also probably make the code cleaner, and reclaim the physical register 0.