Comment by wrs
6 hours ago
Yes. "`@reduce(.And, ...)` combines every boolean using `and` and returns a single boolean."
If it's true (the common case here) then you proceed to look at the next 8 bytes.
If it's false, you apply a @bitcast (turn the booleans into bits) and @ctz (find the first 0) to get the index of where it was false.
Maybe I'm wrong, but should it be @clz instead?
No, the diagram looks like a binary literal but it's actually backwards from that. Lane 0 becomes the LSB, but that's on the left of the diagram.
Aha, you are right. Smaller indexes are for least-significant bits.