c++ - Check for zeros horizontally across __m128i vector? -
I have several I understand how I can do "Total" multiple How do I do the last horizontal check for zero in the last vector? Edit I am using Intel Intrins, not inline assembly Do not do this. Avoid horizontal operations whenever possible; There is death for the display of vector codes. Instead, compare the vector to a vector of zero, then use the PMOVMSKB to get a mask in the GPR. If the mask is zero, at least the strings of your vector were zero: If you want to receive SSE4.1 You can also use PTEST. Take the question at face value, if you really need to do a horizontal and for some reason, it will be movhlps + andps + shufps + andps But do not do this. __ m128i vectors with 32-bit signed integers and I would like to check that Is any of the 4 integers zero?
__M 128i but in the end I still have a
__ M 128i will end with vector, which I need to check again horizontally.
__ m128i yourVector; __m128i zero-void = _mm_set1_epi32 (0); If (_mm_movemask_epi8 (_mm_cmpeq_epi32 (yourVector, zero vector)) // Your vector has at least one lane zero.}
Comments
Post a Comment