2021年3月3日星期三

Store lower 16 bits of each AVX 32-bit element to memory

I have 8 integer values in an AVX value __m256i which are all capped at 0xffff, so the upper 16 bits are all zero.

Now I want to store these 8 values as 8 consecutive uint16_t values.

How can I write them to memory in this way? Can I somehow convert an __m256i value of 8 packed integers into a __m128i value that holds 8 packed shorts?

I am targeting AVX2 intrinsics, but if it can be done in AVX intrinsics, even better.

https://stackoverflow.com/questions/66466112/store-lower-16-bits-of-each-avx-32-bit-element-to-memory March 04, 2021 at 06:48AM

没有评论:

发表评论