Sign in

efroach76.bsky.social

@efroach76.bsky.social
11 followers 42 following 3 posts
PostsRepliesMedia
efroach76.bsky.social @efroach76.bsky.social · 12/01/2025
Finding an isolated 1-bit can be done in 4 ops even without andnot: shr1 = x >> 1 t = x ^ shr1 # bit is different from left neighbor. Remains to check it is 1 and right neighbor is 0. e = t & (t - shr1)
010
efroach76.bsky.social @efroach76.bsky.social · 31/12/2024
Sorry, wouldn't know anything, I'd be interested too...
010
efroach76.bsky.social @efroach76.bsky.social · 30/12/2024
As Harold mentions, Prefix-Or is just v | -v. Segment-scan-or can also be simplified, for example uint64_t s = (v | m) >> 1; return s ^ (s - v) (4 instructions instead of 7).
121