Pergunta

inline assembly:

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

What is the equivalent intrinsics code?

__m128i foo = _mm_?????(some_pointer);
Foi útil?

Solução

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.

Outras dicas

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top