Re:Six times faster than C
by gpderetta on Friday July 07, 2023 @05:11AM
(#36629165)
In this benchmark the only loop carried dependency is over the res variable (edit: and of course the index). The jump doesn't break these dependencies, so for this specific problem, the additional latency of the cmov doesn't matter as it is always perfectly pipelined and cmov will always come up on top. But if the input of cmov depended on a previous value, then potentially a branch could be better given an high enough prediciton rate.
[ Parent
| on HN ]
There are no comments on this comment yet.