I have the following logic, given an input in binary 0111_1001 and mask 0001_0001, I want to select all consecutive 1 in the input that are higher than or equal to 1 in the mask.
input: 0111 1001
mask: 0001 0001
out: 0111 0001
My questions are as following:
Is there a name for this kind of function that would make it easier to search and ask further questions?
Is there a SIMD-like function and algorithm to speed this function?
Broadly? “Bitwise operation”, “bitwise function”, “bit twiddling”… Bit manipulation - Wikipedia may have some useful names and further links.
Bitwise or bit twiddling as others have pointed out. A absolute classic resource on the subject is Bit Twiddling Hacks (aimed at C, but the principles carry over obviously).
To be honest, can't seem to reproduce it right now, but there was a timeout in tests while using the string searcher with function provided by uv2.
I have two functions that I switch between uv2 and my own branchless version. After replacing my own implementation with uv2, a unknown timeout appeared. I wanted to dig deeper, but upon rerunning the tests a few days later it disappeared.