How do I test if a __m128i variable has any nonzero value on SSE-2-and-earlier processors?
How do I test if a __m128i variable has any nonzero value on SSE-2-and-earlier
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In SSE2 you can do:
this will test four int’s vs zero then return a mask for each byte, so your bit-offsets of each corresponding
intwould be at 0, 4, 8 & 12, but the above test will catch if any bit is set, then if you preserve the mask you can work with the finer grained parts directly if need be.