←back to thread

138 points shipp02 | 4 comments | | HN request time: 0.426s | source
1. 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 #
2. xoranth ◴[] No.40651145[source]
I believe the author is referring to how many logical threads/hyperthreads can a core run (for AMD and Intel, two. I believe POWER can do 8, Sparc 4).

The extra physical registers are there for superscalar execution, not for SMT/hyperthreading.

3. 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 #
4. atq2119 ◴[] No.40657246[source]
Depends on whether that hardware is shared between threads or not. Physical registers are usually shared.