I am using the SIMD api in Java:
// both `buffer` and `markVector` are ByteVector
var result = buffer.and(markVector);
My requirement is to check whether all bits in result
are 0 efficiently.
A workaround way is to convert it to byte[]
, and then covert every individual byte to int
, and finally check whether it is 0 one by one. But this method does not leverage the SIMD feature.
Any idea about how to check whether all bits of ByteVector are 0 in SIMD?