Why does inverting the parameters to a CMPGT comparison function work as a CMPLT?
I'm working with AVX2 in the process of optimizing a small mathematics library for a project, however, I've stumbled into minor inconsistencies.
AVX2 lacks the support for a CMPLT function for packed 32b i's, which is unfortunate. An alternative measure to create such an operation resides in the _mm256_cmpgt_epi32 function using a practice called "property transposition," apparently.
Reference:
_mm256_cmpgt_epi32(a,b)
Expectedly, the computation of a > b would be the desired input, however, to achieve our nonexistent _mm256_cmplt_epi32() function, we'd need to write out the inverse of our original input like so: _mm256_cmpgt_epi32(b,a).
My question being: Why does inerverting the input change the functions' operation to one which should have already been provided ( that being _mm256_cmplt_epi32 )?
from Recent Questions - Stack Overflow https://ift.tt/3eWxxs9
https://ift.tt/eA8V8J
Comments
Post a Comment