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

Add [T]::as_simd(_mut) #91479

Merged
merged 2 commits into from
Dec 15, 2021
Merged

Add [T]::as_simd(_mut) #91479

merged 2 commits into from
Dec 15, 2021

Commits on Dec 3, 2021

  1. Add [T]::as_simd(_mut)

    SIMD-style optimizations are the most common use for `[T]::align_to(_mut)`, but that's `unsafe`.  So these are *safe* wrappers around it, now that we have the `Simd` type available, to make it easier to use.
    
    ```rust
    impl [T] {
        pub fn as_simd<const LANES: usize>(&self) -> (&[T], &[Simd<T, LANES>], &[T]);
        pub fn as_simd_mut<const LANES: usize>(&mut self) -> (&mut [T], &mut [Simd<T, LANES>], &mut [T]);
    }
    ```
    scottmcm committed Dec 3, 2021
    Configuration menu
    Copy the full SHA
    92c8317 View commit details
    Browse the repository at this point in the history

Commits on Dec 14, 2021

  1. Configuration menu
    Copy the full SHA
    e4c44c5 View commit details
    Browse the repository at this point in the history