090909090909 :
How do a processor rename its registers ?
Hi,
register renaming is performed early on in the execution pipeline. Microprocessors expose a fixed number of addressable registers. When operating in protected mode, x86 exposes 8 32-bit general purpose registers, 8 80-bit floating point registers (with x87 extensions), and 8 128 bit vector registers (with SSE extensions). When operating in long mode, x86 exposes 16 64-bit general purpose registers, 8 80-bit floating point registers (depreciated), and 16 128 bit vector registers. If the microprocessor supports AVX, the vector registers are 256 bits wide each.
Even though the number of addressable general purpose registers remains at 8 or 16 depending on the operating mode, the number of internal registers is much higher. Each Haswell microprocessor has a whopping 168 integer registers and 168 AVX registers per core. These registers are allocated dynamically between two front ends (hyperthreading); x87 instructions utilize the AVX registers.
A microprocessor that supports register renaming examines decoded instructions for data dependencies. When an instruction is found that uses the same register as a previous instruction, but does not share a data dependency with that instruction, the microprocessor will rewrite the instruction to use a separate register; it will then ensure that any instructions that are dependent on the rewritten instruction are rewritten to utilize the new register.