I hope someone is able to help with this issue, which has been bothering me for over an hour now.
I have this code (it is in C):
#include <immintrin.h>
void test_vectors(__m256i state[5][2]);
void test() {
__m256i state[5][2];
for (int i = 0; i < 5; i++) {
state[i][0] = _mm256_setzero_si256();
state[i][1] = _mm256_setzero_si256();
}
test_vectors(state);
}
void test_vectors(__m256i state[5][2]) {
__m256i some_new_vector = _mm256_xor_si256(state[0][0], state[0][1]);
}
I cannot build this, as I get the error:
"Error 'state': formal parameter with requested alignment of 32 won't be aligned"
I'm unable to see, what the issue is here. I have specified the dimensions of the array, so the compiler should be able to figure that out. Furthermore I cannot see why the Intel Intrinsics library, should return a __m256i struct that is not aligned, as alignment is required for most of its library-functions.
I am able to avoid the error, by changing the signature of the function to be:
void schwabe_bitsliced_primate(__m256i *state[5]);
However with this, as soon as I access the array, (which I do in the only line in my test_vector method), I get an exception that "struct at NULL". It works fine if the state array parameter is one-dimensional (i.e. only state[5]).