2 ms·
A stack is register renaming. Instead of "Register #n" you refer to it as "SP - n". The difference is that it's rebased with every op, and in ops the registers
by mgsouth 4y ago
A stack is register renaming. Instead of "Register #n" you refer to it as "SP - n". The difference is that it's rebased with every op, and in ops the registers are almost always implied: "ADD" always loads reg #0 and #1, always puts results back in #1, then renames #1 .. n to #0 .. n-1. OoO should handle the continuous renaming OK, I think. ADD + PUSH would add (orig #0, orig #1), place result in orig #1, put new data in new #0, alias new #0 as "SP-0". Only the aliasing would need to be ordered. Maybe it could be part of the decode. As I noted elsewhere, some HP 3000 models had multiple ALUs so some form of OoO.
- kragen 4y agoRenaming is one way to implement a stack, but you can also physically shift the bits around every cycle.
- int_19h 4y agoAn example of this is Intel x87 floating point, although the stack discipline isn't strict there: https://en.wikibooks.org/wiki/X86_Assembly/Floating_Point#FPU_Register_Stack https://en.wikibooks.org/wiki/X86_Assembly/Floating_Point#FP...