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

Handle simd intrinsics #28

Closed
jrmuizel opened this issue Sep 24, 2018 · 3 comments
Closed

Handle simd intrinsics #28

jrmuizel opened this issue Sep 24, 2018 · 3 comments
Assignees

Comments

@jrmuizel
Copy link

For example it would be nice to be able to handle the following code:

#include <xmmintrin.h>
#include <emmintrin.h>

void
unpack_128_2x128 (__m128i data, __m128i* data_lo, __m128i* data_hi)
{
    *data_lo = _mm_unpacklo_epi8 (data, _mm_setzero_si128 ());
    *data_hi = _mm_unpackhi_epi8 (data, _mm_setzero_si128 ());
}
@rinon
Copy link
Contributor

rinon commented Sep 25, 2018

Indeed. We decided a while back to put simd support off until someone needed it. Considering simd support is in stable now, we'll take another look at translating simd types and builtins. Assuming everything matches up well enough, we should be able to add this soon.

@ahomescu
Copy link
Contributor

Translating the types and builtins directly to their Rust core::arch equivalents looks like the most straightforward approach.

@TheDan64
Copy link
Contributor

SIMD support has been merged as of 78372fd. The translator should now translate all of the __m* types and most of the __mm* functions (rust is missing some small subset of instructions so we can't translate those)

If you find any other SIMD functions that go untranslated, and have rust equivalents (even if not stable), please feel free to reopen this issue!

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

4 participants