Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can we combine with Intel® SSE2 (Streaming SIMD Extensions 2)? #156

Open
ardianumam opened this issue Apr 25, 2021 · 4 comments
Open

Comments

@ardianumam
Copy link

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.

@jehoshuapratama
Copy link

Facing the same issue, any recommendation on this @p12tic @mtklein? Thanks

@mtklein
Copy link
Contributor

mtklein commented Apr 26, 2021

I find that there's very little like this that memcpy() and static_assert(sizeof(A) == sizeof(B), "") cannot fix.

@ardianumam
Copy link
Author

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.

@mtklein
Copy link
Contributor

mtklein commented Apr 26, 2021

Yep, the native_type for uint16<8> on x86 is __m128i. That's all the type stores, just native_type d_;.

using native_type = __m128i;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants