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

Conversion from arch types #296

Closed
HadrienG2 opened this issue Jul 25, 2022 · 6 comments
Closed

Conversion from arch types #296

HadrienG2 opened this issue Jul 25, 2022 · 6 comments

Comments

@HadrienG2
Copy link

Currently, it is possible to convert from portable_simd vectors to core::arch vectors, but not the reverse. Given that the vector element types that I have seen so far have no invalid bit patterns, I would expect that operation to always be safe. Am I misunderstood ?

@TheIronBorn
Copy link

at least for x86 there exists impl From<u8x16> for __m128i

@HadrienG2
Copy link
Author

Yes, this direction already exists, it is the reverse direction that does not exist yet.

@calebzulawski
Copy link
Member

Pretty sure this existed in the past and got lost at some point. Vaguely related to #187.

@TheIronBorn
Copy link

Sorry, I meant impl From<__m128i> for u8x16 which also exists

@HadrienG2
Copy link
Author

Ah, yes, you're right, sorry, I wonder how I managed to miss them.

@HadrienG2
Copy link
Author

Looking further, I see how. The From impl appears on the doc page of the arch types, but not on that of the Simd type.

What is strange is that you see both From impls on the doc page of the arch type. I wonder if rustdoc could be somehow massaged into displaying both From impls on the doc of the Simd type too...

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