Trait SimdWiden
pub trait SimdWiden<S: Simd>: SimdBase<S, Mask: MaskWiden<S, Widened = <Self::Widened as SimdBase<S>>::Mask>> + Seal
Widening conversion of a numeric SIMD vector.
Integer lanes are sign-extended or zero-extended according to their type. Finite floating-point
lanes are converted losslessly from f32 to f64; infinities and NaNs remain infinities and
NaNs. The result is returned as two vectors with the same bit width as the input: the first
contains the widened lower lanes and the second contains the widened upper lanes.
use fearless_simd::{f32x4, f64x2, prelude::*, u8x16, u16x8};
fn fixed<S: Simd>(value: u8x16<S>) -> (u16x8<S>, u16x8<S>) {
value.widen()
}
fn native<S: Simd>(value: S::u8s) -> (S::u16s, S::u16s) {
value.widen()
}
fn fixed_float<S: Simd>(value: f32x4<S>) -> (f64x2<S>, f64x2<S>) {
value.widen()
}
fn native_float<S: Simd>(value: S::f32s) -> (S::f64s, S::f64s) {
value.widen()
}
Associated Types
type Widened: SimdNarrow<S, Narrowed = Self>;The same-width vector type with lanes twice as wide.
Required Methods
fn widen(self) -> (Self::Widened, Self::Widened)Widen every lane, returning the lower and upper halves in that order.
Implementors
impl<S: Simd> SimdWiden<S> for f32x16<S>impl<S: Simd> SimdWiden<S> for f32x4<S>impl<S: Simd> SimdWiden<S> for f32x8<S>impl<S: Simd> SimdWiden<S> for i16x16<S>impl<S: Simd> SimdWiden<S> for i16x32<S>impl<S: Simd> SimdWiden<S> for i16x8<S>impl<S: Simd> SimdWiden<S> for i32x16<S>impl<S: Simd> SimdWiden<S> for i32x4<S>impl<S: Simd> SimdWiden<S> for i32x8<S>impl<S: Simd> SimdWiden<S> for i8x16<S>impl<S: Simd> SimdWiden<S> for i8x32<S>impl<S: Simd> SimdWiden<S> for i8x64<S>impl<S: Simd> SimdWiden<S> for u16x16<S>impl<S: Simd> SimdWiden<S> for u16x32<S>impl<S: Simd> SimdWiden<S> for u16x8<S>impl<S: Simd> SimdWiden<S> for u32x16<S>impl<S: Simd> SimdWiden<S> for u32x4<S>impl<S: Simd> SimdWiden<S> for u32x8<S>impl<S: Simd> SimdWiden<S> for u8x16<S>impl<S: Simd> SimdWiden<S> for u8x32<S>impl<S: Simd> SimdWiden<S> for u8x64<S>