Intel® ISA Extensions
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.
1095 Discussions

how best to implement AVX2 _mm256_cmplt_epi32?

Jeff_D_2
Beginner
914 Views

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
914 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);}

 

0 Kudos
Reply