Trait SimdInt
pub trait SimdInt<S: Simd>: SimdBase<S, Element: SimdIntElement> + Seal + BitAnd<Output = Self> + BitAndAssign + BitAnd<Self::Element, Output = Self> + BitAndAssign<Self::Element> + BitOr<Output = Self> + BitOrAssign + BitOr<Self::Element, Output = Self> + BitOrAssign<Self::Element> + BitXor<Output = Self> + BitXorAssign + BitXor<Self::Element, Output = Self> + BitXorAssign<Self::Element> + Not<Output = Self> + Shl<u32, Output = Self> + ShlAssign<u32> + Shl<Output = Self> + ShlAssign + Shr<u32, Output = Self> + ShrAssign<u32> + Shr<Output = Self> + ShrAssign
Functionality implemented by (signed and unsigned) integer SIMD vectors.
Required Methods
fn count_ones(self) -> SelfReturn the number of ones in the binary representation of each element.
fn count_zeros(self) -> SelfReturn the number of zeros in the binary representation of each element.
fn saturating_add(self, rhs: impl SimdInto<Self, S>) -> SelfAdd two vectors element-wise, saturating on overflow.
"Saturating" means that if the result is not representable, the closest representable value (either
Element::MAXorElement::MIN) is returned.On x86 it is implemented in hardware only for 8-bit and 16-bit elements. For 32-bit and 64-bit vectors this operation is slower than wrapping addition on x86.
fn saturating_sub(self, rhs: impl SimdInto<Self, S>) -> SelfSubtract two vectors element-wise, saturating on overflow.
"Saturating" means that if the result is not representable, the closest representable value (either
Element::MAXorElement::MIN) is returned.On x86 it is implemented in hardware only for 8-bit and 16-bit elements. For 32-bit and 64-bit vectors this operation is slower than wrapping subtraction on x86.
Provided Methods
fn to_float<T: SimdCvtFloat<Self>>(self) -> TConvert this integer type to a floating-point type. This is a convenience method that delegates to
SimdCvtFloat::float_from, and can only be called if there actually exists a target type of the same bit width (f32orf64).
Implementors
impl<S: Simd> SimdInt<S> for i16x16<S>impl<S: Simd> SimdInt<S> for i16x32<S>impl<S: Simd> SimdInt<S> for i16x8<S>impl<S: Simd> SimdInt<S> for i32x16<S>impl<S: Simd> SimdInt<S> for i32x4<S>impl<S: Simd> SimdInt<S> for i32x8<S>impl<S: Simd> SimdInt<S> for i64x2<S>impl<S: Simd> SimdInt<S> for i64x4<S>impl<S: Simd> SimdInt<S> for i64x8<S>impl<S: Simd> SimdInt<S> for i8x16<S>impl<S: Simd> SimdInt<S> for i8x32<S>impl<S: Simd> SimdInt<S> for i8x64<S>impl<S: Simd> SimdInt<S> for u16x16<S>impl<S: Simd> SimdInt<S> for u16x32<S>impl<S: Simd> SimdInt<S> for u16x8<S>impl<S: Simd> SimdInt<S> for u32x16<S>impl<S: Simd> SimdInt<S> for u32x4<S>impl<S: Simd> SimdInt<S> for u32x8<S>impl<S: Simd> SimdInt<S> for u64x2<S>impl<S: Simd> SimdInt<S> for u64x4<S>impl<S: Simd> SimdInt<S> for u64x8<S>impl<S: Simd> SimdInt<S> for u8x16<S>impl<S: Simd> SimdInt<S> for u8x32<S>impl<S: Simd> SimdInt<S> for u8x64<S>