| ▲ | menaerus 11 hours ago |
| 8 registers? Ever heard of register renaming? |
|
| ▲ | Polizeiposaune 10 hours ago | parent | next [-] |
| Ever heard of a loop that needed to keep more than 7 variables live? Register renaming helps with pipelining and out-of-order execution, but instructions in the program can only reference the architectural registers - go beyond that and you end up needing to spill some values to (architectural) memory. There's a reason why AMD added r8-r15 to the architecture, and why intel is adding r16-r31.. |
| |
| ▲ | menaerus 10 hours ago | parent [-] | | I have but that was not the point? My first point was exactly that there are more ISA registers and not only 8, and therefore the question mark. My second point was about register renaming which, contrary what you say, does mitigate the artifacts of running out of registers by spilling the variables to the stack memory. It does it by eliminating the false dependencies between variables/registers and xor eax, eax is a great candidate for that. | | |
| ▲ | saagarjha 8 hours ago | parent [-] | | Register renaming does not let you avoid spills. | | |
| ▲ | menaerus 6 hours ago | parent [-] | | Ok, it obviously doesn't increase the number of ISA registers. What I am suggesting is something else - imagine a situation in which the compiler understands that the spill over will take place, and therefore rearranges the code such that it reduces the pressure on the registers. It can do that if it can break the data dependencies between the variables for instance. Or it can do that by unrolling the loops or by moving the initialization closer to where the variable is being used, no? I am pretty certain that compilers are already doing these kind of transformations, and in a sense this is taking advantage of register renaming but indirectly. |
|
|
|
|
| ▲ | account42 10 hours ago | parent | prev | next [-] |
| That's irrelevant, the zero register would be taking a slot in the limited register addressing bits in instructions, not replace a physical register on the chip. |
|
| ▲ | kevin_thibedeau 8 hours ago | parent | prev [-] |
| 8086 doesn't have that. |