←back to thread

138 points shipp02 | 2 comments | | HN request time: 0.5s | source
Show context
Const-me ◴[] No.40650737[source]
> How many register sets does a typical SMT processor have? Er, 2, sometimes 4

Way more of them. Pipelines are deep, and different in-flight instructions need different versions of the same registers.

For example, my laptop has AMD Zen3 processor. Each core has 192 scalar physical registers, while only ~16 general-purpose scalar registers defined in the ISA. This gives 12 register sets; they are shared by both threads running on the core.

Similar with SIMD vector registers. Apparently each core has 160 32-byte vector registers. Because AVX2 ISA defines 16 vector register, this gives 10 register sets per core, again shared by 2 threads.

replies(2): >>40651145 #>>40651167 #
1. yosefk ◴[] No.40651167[source]
I meant register sets visible to software. The fact that there's even more hardware not visible to software that you need for a thread to run fast just means that the cost of adding another thread is even higher
replies(1): >>40657246 #
2. atq2119 ◴[] No.40657246[source]
Depends on whether that hardware is shared between threads or not. Physical registers are usually shared.