George
George

Reputation: 21

How to load unsigned ints into SIMD

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?

Upvotes: 1

Views: 1310

Answers (1)

Paul R
Paul R

Reputation: 212929

For any integer SSE type, regardless of element width or signedness, you typically use _mm_load_si128/_mm_loadu_si128:

uint32_t a[N];

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

Upvotes: 1

Related Questions