I want to convert the bits stored in __m256i
to int[]
I've tried_mm256_storeu_si256 ((__m256i*)rd,rs)
but it seems to fail.
So what's the reason behind it? And what is the correct way to convert __m256i to 8 integers?
Here is the context:
//a, b are two arrays(larger than 8)
__m256i rs1 = _mm256_loadu_si256 ((const __m256i*) (a + (i+k)*sizeof(int)));// load 256bits rs1
__m256i rs2 = _mm256_loadu_si256 ((const __m256i*) (b + i*sizeof(int)));// load 256bits to rs2
__m256i rd = _mm256_maddubs_epi16 (rs1, rs2);// computation (each entry in a/b is positive and smaller than 8 so I think it is valid)
_mm256_storeu_si256 ((__m256i*)result,rd);// store the result to the result[] (it crash)
it reports segmentation fault
Ive looked up Store __m256i to integer, but I guess we have different problem (what I am doing is same with it)
next, I try _mm256_extract_epi32
--store integers one by one(it is stupid but I have no way), and it works?????GG