Suppose I have a 128-bit integer vector:
__m128i x;
Then how to know if all the bits in x are zeros?
Checking every packed integer is a simple approach.
But I'm looking for a faster way.
Is there any instruction in SSE can do this job?
If it is SSE 4.1, you can use _mm_testz_si128
, e.g.
_mm_testz_si128(idata, _mm_set1_epi32(0x0000))
Probably look also into Check XMM register for all zeroes for a SSE2 compatible solution.