--
You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+unsubscribe@groups.riscv.org.
To post to this group, send email to isa...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/isa-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/1572085.WpFBABXZlR%40arkadios.
To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+u...@groups.riscv.org.
To post to this group, send email to isa...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/isa-dev/.
Traditionally, RISC CPUs stuck to 32 registers based on the theory that this was sufficient for most code, but later, out of order CPUs found it was most definitely not enough. Unable to increase the number of architectural registers, they enabled a larger number of physical registers by implementing register renaming, presumably at considerable cost.
That’s not entirely true. At some point throwing more registers at the problem doesn’t help; diminishing returns …
Register renaming helps in avoiding hazards in out-of-order machines.
For example …
ld a0, …
addi a0, 12
sd a0,…
add a0,a6,a5
Note the constant use of a0. In an in-order machine there are a few read-after-write hazards. The ‘ld’ must complete before the ‘addi’ and the ‘addi’ must complete before the ‘sd’. The ‘add’ has no hazard, because it’s result is independent on the above instructions.
If this was an out-of-order machine, then there are more hazards. For example the ‘add’ may be executed before the ‘sd’, leading to a write-after-write hazard. This would stall the execution of the ‘add’. By renaming the ‘a0’ register in the ‘add’ instruction (e.g. to physical, but not logical, register x32), the ‘add’ can start as soon as ‘a6’ and ‘a5’ are known, which may be before any of the ‘ld’, ‘addi’, and ‘sd’ instructions.
Now as there are suddenly many more instructions in flight, and there are a number of virtual register (i.e. same logical register, different physical register) used, the need for more physical registers is apparent. It is not uncommon to have over a hundred physical registers, but only have 32 logical registers.
Richard
Given that high-performance implementations will have a larger number of physical registers anyway, why not make them architectural, go for 64 or 128 architectural registers? This would decrease the number of values that need to be spilled to memory in the admittedly minority of programs that need the extra for that purpose, but it would also seem in at least some cases to avoid the need for expensive register renaming hardware.
What am I missing?
--
You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
isa...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/isa-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/615e0090-eb28-4c69-ac67-818fdb24938a%40groups.riscv.org.