What are the gcc's intrinsic for loading 4 ints
into __m128
and 8 ints into __m256
(aligned/unaligned)? What about unsigned ints
?
Asked
Active
Viewed 3,428 times
5

Cartesius00
- 23,584
- 43
- 124
- 195
-
Clarification: You're looking GCC's intrinsics, and not Intel's intrinsics correct? – Mysticial Feb 24 '12 at 20:31
-
Don't know precisely, but intrinsic usable from gcc 4.6+ "out-of-box". – Cartesius00 Feb 24 '12 at 20:32
-
Use https://software.intel.com/sites/landingpage/IntrinsicsGuide/ to find all you need to know. – user276648 May 28 '18 at 09:32
1 Answers
9
Using Intel's SSE intrnisics, the ones you're looking for are:
_mm_load_si128()
_mm_loadu_si128()
_mm256_load_si256()
_mm256_loadu_si256()
Documentation:
- https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_load_si128
- https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_load_si256
There's no distinction between signed or unsigned. You'll need to cast the pointer to __m128i*
or __m256i*
.
Note that these are Intel's SSE intrinsics and will work in GCC, Clang, MSVC, and ICC.
The GCC intrinsics work only in, well, GCC AFAIK of.

user276648
- 6,018
- 6
- 60
- 86

Mysticial
- 464,885
- 45
- 335
- 332
-
Nice, thank you, very much. I have on other follow-up question: http://stackoverflow.com/questions/9437860/sse-ints-vs-floats-practice – Cartesius00 Feb 24 '12 at 20:55