For the fun of it I've implemented a greedy bottom-up local register allocator for the intel 8086 CPU, which is known for its non-uniform
use of registers in ALU instructions and memory operands (https://github.com/alexfru/regal86).
For the fun of it I've implemented a greedy bottom-up local register allocator for the intel 8086 CPU, which is known for its non-uniform
use of registers in ALU instructions and memory operands (https://github.com/alexfru/regal86).
It was also designed to have a virtual stack, which would spill to memory
on overflow, and back on underflow. That sounds nice, but it seems that no-one tried to write the interrupt routine before the hardware was built, and that it actually isn't possible. It seems that it isn't possible to get some
of the state bits set, such that it all works like a seamless virtual stack.
[Normal stack machines have the top few entries in registers and do the spilling to memory in hardware. The x87 stack has 8 registers, which is
a lot for a stack machine, but the spilling was broken. You can address
into the stack but you can't really use it as a register machine. -John]
A stack machine is convenient for calculations. Before the stack
overflows the compiler can save intermediate results, as with any other architecture of limited register count.
DoDi
[Normal stack machines have the top few entries in registers and do the spilling to memory in hardware. The x87 stack has 8 registers, which is
a lot for a stack machine, but the spilling was broken. You can address into the stack but you can't really use it as a register machine. -John]
There are description of some compilers that give up on compiling any
code that needs more than eight registers.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 40:12:33 |
Calls: | 6,648 |
Files: | 12,193 |
Messages: | 5,329,412 |