__m128 a;
__m128 b;
How to code a != b ?
what to use: _mm_cmpneq_ps or _mm_cmpneq_ss ?
How to process the result ?
Can’t find adequate docs.
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.
You should probably use
_mm_cmpneq_ps. However the interpretation of comparisons is a little different with SIMD code than with scalar code. Do you want to test for any corresponding element not being equal ? Or all corresponding elements not being equal ?To test the results of the 4 comparisons from
_mm_cmpneq_psyou can use_mm_movemask_epi8.Note that comparing floating point values for equality or inequality is usually a bad idea, except in very specific cases.
For documentation you want these two volumes from Intel:
Intel® 64 and IA-32 Architectures Software Developer’s Manual
Volume 2A: Instruction Set Reference, A-M
Intel® 64 and IA-32 Architectures Software Developer’s Manual
Volume 2B: Instruction Set Reference, N-Z