2 ms·
Use of instructions that compilers have great difficulty (usefully) generating, for various reasons, is a common theme lately. In this case, prefetch, which to
by ncmncm 6y ago
Use of instructions that compilers have great difficulty (usefully) generating, for various reasons, is a common theme lately.
In this case, prefetch, which to be useful often requires a context switch.
Another, lately, is popcount.
One that only appears in very recent Intel (and AMD?) is an instruction to sleep until a particular cache line gets invalidated, as a way to both save on power and latency, as waking up can be faster than escaping the poorly-branch-predicted spin loop.
There are various appalling tricks to keep your branch predictor from killing your loop escape latency.