pub trait WideUtilsExt: Sized {
type Widened;
// Required methods
fn widen_to_u64x8(self) -> Self::Widened;
fn shuffle(self, indices: Self) -> Self;
// Provided method
fn double(self) -> Self
where Self: Add<Output = Self> + Copy { ... }
}Expand description
Trait extension for wide SIMD types providing additional utility operations
Required Associated Types§
Required Methods§
Sourcefn widen_to_u64x8(self) -> Self::Widened
fn widen_to_u64x8(self) -> Self::Widened
Widen the vector elements to a larger type
Provided Methods§
Sourcefn double(self) -> Self
fn double(self) -> Self
Double each element (self + self). Wraps on overflow.
This is the most efficient way to multiply by 2 since addition is
well-supported on all SIMD architectures (NEON vaddq, SSE paddq).
For multiply by powers of 2, chain calls:
x.double()= x * 2x.double().double()= x * 4x.double().double().double()= x * 8
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.