How to load unsigned ints into SIMD

╄→尐↘猪︶ㄣ 提交于 2019-12-02 17:09:20

问题


I have a C program where I have a few arrays of unsigned ints. I'm using this declaration uint32_t.

I want to use SIMD to perform some operations on the data stored in each of the arrays. This is where I'm stuck because it looks like most of the SSE and SSE2 functions only support float and double.

What's the best way for me to load data of type uint32_t?


回答1:


For any integer SSE type you typically use _mm_load_si128/_mm_loadu_si128:

uint32_t a[N];

__m128i v = _mm_loadu_si128((__m128i *)a);


来源:https://stackoverflow.com/questions/30286685/how-to-load-unsigned-ints-into-simd

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!