Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Jeff_D_2
Beginner
167 Views

how best to implement AVX2 _mm256_cmplt_epi32?

AVX2 appears to only offer _mm256_cmpeq_epi32 and _mm256_cmpgt_epi32.  What's the most efficient way to implement _mm256_cmplt_epi32 given the available AVX2 functions?

0 Kudos
1 Reply
bronxzv
New Contributor II
167 Views

Jeff D. wrote:
AVX2 appears to only offer _mm256_cmpeq_epi32 and _mm256_cmpgt_epi32.  What's the most efficient way to implement _mm256_cmplt_epi32 given the available AVX2 functions?

simply use cmpgt with swapped operands, you can also introduce your own cmplt with code such as :

 __m256i _mm256_cmplt_epi32 (__m256i a, __m256i b) {return _mm256_cmpgt_epi32(b,a);}

 

Reply