From 5b4282edcd01089df26e2e2c268c4dc1c361dd91 Mon Sep 17 00:00:00 2001 From: Caleb Zulawski Date: Thu, 7 Oct 2021 17:43:53 -0400 Subject: [PATCH] Improve docs --- crates/core_simd/src/swizzle.rs | 18 ++++++++---------- 1 file 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 Swizzle for SwizzleImpl { + struct Impl; + impl Swizzle 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 Swizzle2 for SwizzleImpl { + struct Impl; + impl Swizzle2 for Impl { const INDEX: [Which; {$index.len()}] = $index; } - SwizzleImpl::swizzle2($first, $second) + Impl::swizzle2($first, $second) } } } @@ -118,6 +118,7 @@ pub trait Swizzle2 { } /// 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 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 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;