문제

inline assembly:

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

What is the equivalent intrinsics code?

__m128i foo = _mm_?????(some_pointer);
도움이 되었습니까?

해결책

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.

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top