diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2021-12-15 08:36:20 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-15 08:36:20 +0100 |
| commit | efc49c142a7a9c80841f51cbae92fed6f40adfcc (patch) | |
| tree | 2261ea082257388f69f962608f0101cac03c02eb /compiler/rustc_codegen_llvm/src | |
| parent | d258e92900739e7798ed4fccfbbb8cb0fe519acd (diff) | |
| parent | e4c44c5df707bb0b3de00d24e8b7735ab945362b (diff) | |
| download | rust-efc49c142a7a9c80841f51cbae92fed6f40adfcc.tar.gz rust-efc49c142a7a9c80841f51cbae92fed6f40adfcc.zip | |
Rollup merge of #91479 - scottmcm:slice-as-simd, r=workingjubilee
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]);
}
```
They're `cfg`'d out for miri because the `simd` module as a whole is unavailable there.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions
