Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Henk-Jan_L_
Beginner
170 Views

How to zero extend packed unsigned 8-bit integers with an AVX intrinsic

I need to zero extend packed unsigned 8-bit integers with an AVX intrinsic. Question: How do you generate a "vpmovzxbd xmm, xmm" instruction with intrinsics. There seems to exist something close: __m256i _mm256_cvtepu8_epi32 (__m128i a) which generates "vpmovzxbd ymm, xmm", but this is AVX2. Regards HJ!

0 Kudos
2 Replies
andysem
New Contributor III
170 Views

AVX does not provide support for 256-bit integer instructions. 128-bit vpmovzxbd can be generated with _mm_cvtepu8_epi32, but it will only extend the lower 4 bytes. If you aim to process all bytes in the vector your best approach is to use unpack intrinsics.

 

Henk-Jan_L_
Beginner
170 Views

Thanks, I didn't realize that _mm_cvtepu8_epi32 would generate different instructions: pmovzxbd and vpmovzxbd depending on the "Enabled Enhanced Instruction Set" compiler parameter.
Reply