diff options
| author | Caleb Zulawski <caleb.zulawski@gmail.com> | 2021-10-07 17:43:53 -0400 |
|---|---|---|
| committer | Jubilee <46493976+workingjubilee@users.noreply.github.com> | 2021-10-11 13:18:59 -0700 |
| commit | 5b4282edcd01089df26e2e2c268c4dc1c361dd91 (patch) | |
| tree | fb1bc969e73da2f046e8d77ab696e1b1ede6bd83 | |
| parent | 765bee6362371185159cc68fbb708c64a621ae3c (diff) | |
| download | rust-5b4282edcd01089df26e2e2c268c4dc1c361dd91.tar.gz rust-5b4282edcd01089df26e2e2c268c4dc1c361dd91.zip | |
Improve docs
| -rw-r--r-- | crates/core_simd/src/swizzle.rs | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/crates/core_simd/src/swizzle.rs b/crates/core_simd/src/swizzle.rs index 9ce46cfe816..d4d171d570e 100644 --- a/crates/core_simd/src/swizzle.rs +++ b/crates/core_simd/src/swizzle.rs @@ -47,11 +47,11 @@ macro_rules! simd_swizzle { } => { { use $crate::simd::Swizzle; - struct SwizzleImpl; - impl<const LANES: usize> Swizzle<LANES, {$index.len()}> for SwizzleImpl { + struct Impl; + impl<const LANES: usize> Swizzle<LANES, {$index.len()}> for Impl { const INDEX: [usize; {$index.len()}] = $index; } - SwizzleImpl::swizzle($vector) + Impl::swizzle($vector) } }; { @@ -59,11 +59,11 @@ macro_rules! simd_swizzle { } => { { use $crate::simd::{Which, Swizzle2}; - struct SwizzleImpl; - impl<const LANES: usize> Swizzle2<LANES, {$index.len()}> for SwizzleImpl { + struct Impl; + impl<const LANES: usize> Swizzle2<LANES, {$index.len()}> for Impl { const INDEX: [Which; {$index.len()}] = $index; } - SwizzleImpl::swizzle2($first, $second) + Impl::swizzle2($first, $second) } } } @@ -118,6 +118,7 @@ pub trait Swizzle2<const INPUT_LANES: usize, const OUTPUT_LANES: usize> { } /// The `simd_shuffle` intrinsic expects `u32`, so do error checking and conversion here. +/// This trait hides `INDEX_IMPL` from the public API. trait SwizzleImpl<const INPUT_LANES: usize, const OUTPUT_LANES: usize> { const INDEX_IMPL: [u32; OUTPUT_LANES]; } @@ -142,6 +143,7 @@ where } /// The `simd_shuffle` intrinsic expects `u32`, so do error checking and conversion here. +/// This trait hides `INDEX_IMPL` from the public API. trait Swizzle2Impl<const INPUT_LANES: usize, const OUTPUT_LANES: usize> { const INDEX_IMPL: [u32; OUTPUT_LANES]; } @@ -258,8 +260,6 @@ where /// The second result contains the last `LANES / 2` lanes from `self` and `other`, /// alternating, starting with the lane `LANES / 2` from the start of `self`. /// - /// This particular permutation is efficient on many architectures. - /// /// ``` /// #![feature(portable_simd)] /// # use core_simd::Simd; @@ -322,8 +322,6 @@ where /// The second result takes every other lane of `self` and then `other`, starting with /// the second lane. /// - /// This particular permutation is efficient on many architectures. - /// /// ``` /// #![feature(portable_simd)] /// # use core_simd::Simd; |
