Store __m256i to integer

北战南征 提交于 2019-12-02 01:03:05

What you've done is OK, but you don't need to create a temporary pointer - you can just apply the cast directly, e.g.:

_mm256_store_si256( (__m256i *)X, T );

or:

_mm256_store_si256( (__m256i *)&X[i], T );


Update based on the latest edit of your question:

It looks like you are indexing X in a way that does not meet AVX alignment requirements, i.e. X[i] is not guaranteed to be 32 byte aligned, so you should use an unaligned store:

_mm256_storeu_si256( (__m256i *)&X[i], T );
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!