开发者

Array of sse type: Segmentation Fault

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();

R开发者_如何学JAVAegards + Boom


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜