libsimdpp
libsimdpp copied to clipboard
How can we combine with Intel® SSE2 (Streaming SIMD Extensions 2)?
Hi,
I have existing code in Intel SIMD SSE2, how can I use API of libsimdpp if the variable I have is in SSE2, for example _mm_set_epi32? Is there any way so that, for example, I can use script such as: int32<4> = add(A, B);
where A
and B
are SSE data type of _mm_set_epi32
? Many thanks.
Facing the same issue, any recommendation on this @p12tic @mtklein? Thanks
I find that there's very little like this that memcpy() and static_assert(sizeof(A) == sizeof(B), "") cannot fix.
Thanks for the reply @mtklein . In the documentation here, it's stated that:
uint16<N>( const native_type& n );
where n
is native SIMD type to construct from. What does it mean by that? Can we use SIMD of SSE2 as n
? Many thanks.
Yep, the native_type for uint16<8> on x86 is __m128i. That's all the type stores, just native_type d_;
.
https://github.com/p12tic/libsimdpp/blob/9dac213d6965bf57c7accf9dda6d16c3bed0e3ac/simdpp/types/int16x8.h#L111