All processor architectures I came across have symmetrical registers, that is, the value you are reading is the value you wrote.
Is there a case for 16-bit register-limited instructions to have asymmetric registers?
eg.
- Registers 0-6 are "local" to the function call. The value recorded in this function call is the value to be read. Each function call level has its own registration hardware, so local registers are implicitly stored.
- Registers 7-9 are "global", possibly "streaming local" on the SMP processor.
- The values recorded in the "call" registers 10-13 do not affect what is read from them in the context of the function call.
- The values read from the "call" registers 10-13 are the values recorded in the calling function, that is, the arguments of the function register are immutable.
- The values written to the return registers 14-15 do not affect the fact that whet is read from them in this context of the function call.
- The values read from the "return" registers 14-15 are the values recorded in the function that has recently returned to the current function.
Each function level register has its own equipment, which only stacks when the call depth exceeds hardware.
(local) (global) ( call ) (ret) global regset 07 .. 09 . . . . | | ^ ^ . vv | | regsetN-1 00 .. 06 10 .. 13 14 15 |^ |^ | | ^ ^ v| v| vv | | fnN-1 RW RW RW RW RW RW | | ^ ^ vv | | regsetN 00 .. 06 10 .. 13 14 15 |^ |^ | | ^ ^ v| v| vv | | fnN RW RW RW RW RW RW | | ^ ^ vv | | regsetN+1 00 .. 06 10 .. 13 14 15 |^ |^ | | ^ ^ v| v| vv | |
Will such a scheme reduce the pressure of the register in each function call with two or more registers?
I do not expect this to be a new idea, but I am interested in whether this was done, and if not, why not? If this is not a crazy idea or already done, I can implement this on an FPGA processor.
Is it too complicated to cost case-saving?
Are llvm difficulties the main reason that this is not done?
PS I know that superscalar processors are already much more complicated than schemes with renaming registers, etc. I'm just thinking about microcontroller class architectures.
Update: It looks like the SPARC architecture did this. Why was this not useful for later ISA designers?
When the procedure is called, the register window is shifted by sixteen registers, hiding the old input registers and old local registers and making the old output registers new input registers.
source share