I am trying to use unsigned short array for __m128i:
const unsigned short x[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
const unsigned short y[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
__m128i n = *(__m128i*) &y[0];
__m128i m = *(__m128i*) &x[0];
The first casting works fine, and the second does not. I have:
Unhandled exception at 0x013839ee in sse2_test.exe: 0xC0000005: Access violation reading location 0xffffffff.
What happened? Can someone help me?