pub trait SimdWiden<S: Simd>: SimdBase<S> + Seal {
type Widened: SimdNarrow<S, Narrowed = Self>;
// Required method
fn widen(self) -> (Self::Widened, Self::Widened);
}Expand description
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()
}Required Associated Types§
Sourcetype Widened: SimdNarrow<S, Narrowed = Self>
type Widened: SimdNarrow<S, Narrowed = Self>
The same-width vector type with lanes twice as wide.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".