← 返回事件
持续讨论科技

Vectorized CLZ and CTZ

图:Lobsters

发生了什么

clz and ctz are instructions that compute the number of leading (trailing) zero bits in a fixed-size integer. They are natively supported by modern CPUs, though they are not always fast, e.g. tzcnt has a latency of 3 on Arrow Lake. I used ctz in an FPU emulator I’m working on, but figured out how to avoid it with floating-point trickery, and I just realized that this generalizes to a vectorizable ctz polyfill in a r…

摘要按规则整理自下方来源原文

为什么在扩散

来源

社区讨论