2

today I tried to initialize an array of the sse type __m128d. Unfortunately it didn't work - why? Is it generally impossible to create arrays of sse types (since they are register types?). The following code segfaults at the assignment in the loop.

__m128d* _buffers = new __m128d[32];
for(int i=0;i<32;i++)
    _buffers[i] = _mm_setzero_pd();

Regards + Boom

Boom
  • 83
  • 4

1 Answers1

4

You must use _mm_malloc() or _aligned_malloc(), depending on what's the preferred function name on your compiler. __m128[di] in combination with new is almost always bad mojo.

Damon
  • 67,688
  • 20
  • 135
  • 185