Intel® ISA Extensions
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
1058 Discussions

how best to implement AVX2 _mm256_cmplt_epi32?

Jeff_D_2
Beginner
352 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
352 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