3 ms·
Skylake has 180 registers. "mov rax, [blah]" performs "rax = malloc()" from this pool of 180-registers / "the register file". Eventually, the retirement unit "g
by dragontamer 6y ago
Skylake has 180 registers. "mov rax, [blah]" performs "rax = malloc()" from this pool of 180-registers / "the register file". Eventually, the retirement unit "garbage collects" the registers that aren't used anymore for recycling.
Yeah, out-of-order processors are weird. (https://en.wikipedia.org/wiki/Tomasulo_algorithm https://en.wikipedia.org/wiki/Tomasulo_algorithm)
If you have one thread that doesn't need a lot of registers for some reason (ie: most of its dependency chains are short, and it has very few memory operations), then you can have a 2nd thread eat up the ~180 registers that it wasn't using. "Sharing" the malloc pool of registers.