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

Make Simd::to_array impls a simple transmute #563

Merged
merged 1 commit into from
Jan 30, 2025
Merged

Conversation

robertknight
Copy link
Owner

As noted in various parts of the Rust docs (eg. docs for __m256i) the SIMD types have the same layout as [T; N] but may have greater alignment. Hence converting from SIMD to array requires just a transmute (but the converse is not true).

As noted in various parts of the Rust docs (eg. docs for `__m256i`) the SIMD
types have the same layout as `[T; N]` but may have greater alignment. Hence
converting from SIMD to array is just a transmute.
@robertknight robertknight merged commit f4b954a into main Jan 30, 2025
2 checks passed
@robertknight robertknight deleted the simd-to-array branch January 30, 2025 07:56
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

Successfully merging this pull request may close these issues.

1 participant