Possible duplicate:
SSE, internals and alignment
I am new to SIMD programming, so please excuse me if I ask an obvious question.
I experimented a bit and got to the point where I want to save the SIMD value in a dynamically distributed structure.
Here is the code:
struct SimdTest { __m128 m_simdVal; void setZero() { __m128 tmp = _mm_setzero_ps(); m_simdVal = tmp;
When the method marked by the CRASH comment is executed, the code crashes with the following exception:
Unhandled exception at 0x775315de in test-core.exe: 0xC0000005: Access violation reading location 0x00000000
Can someone explain why the assignment operation happens and how the objects containing SIMD should be placed dynamically so that they work normally?
I need to add that if I statically create an instance of the SimdTest object and call the setZero method, everything will be fine.
Thanks Paksas
source share