Question

inline assembly:

__asm__("movd (%0), %%xmm1" : : "r"(some_pointer) :);

What is the equivalent intrinsics code?

__m128i foo = _mm_?????(some_pointer);
Was it helpful?

Solution

int32_t *foo_pointer;

__m128i foo = _mm_cvtsi32_si128(*foo_pointer); // MOVD

For future reference get the handy Intel Intrinsics Guide from this page: http://software.intel.com/en-us/avx/ (bottom left hand side - different versions for different platforms: Mac/Linux/Windows). Don't be put off by the fact that this is an AVX page, the Intrinsics Guide covers all instructions from MMX through all flavours of SSE up to AVX and AVX2 and is a quick and easy way to look up SIMD opcodes and intrinsics.

OTHER TIPS

Given you want it into an integer SSE register, you're probably looking for _mm_cvtsi32_si128.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top