(no title)
tyfighter | 1 year ago
int mask = something; ... for (int index; _bit_scan_forward(&index, mask); mask ^= 1<<index) { ... }
Since it sets the ZF on a zero input, they thought that must be all you need. But there are many other uses for (trailing|leading) zero count operations, and it would have been much better for them to just write the register anyway.
No comments yet.