Trait simdeez::SimdInt16

source ·
pub trait SimdInt16: SimdInt<Scalar = i16, HorizontalAddScalar = i64> + SimdTransmuteI16 {
    // Required methods
    fn extend_to_i32(
        self
    ) -> (<Self::Engine as Simd>::Vi32, <Self::Engine as Simd>::Vi32);
    fn unsigned_extend_to_i32(
        self
    ) -> (<Self::Engine as Simd>::Vi32, <Self::Engine as Simd>::Vi32);

    // Provided methods
    fn partial_horizontal_add(self) -> <Self::Engine as Simd>::Vi32 { ... }
    fn partial_horizontal_unsigned_add(self) -> <Self::Engine as Simd>::Vi32 { ... }
}
Expand description

Operations shared by 16 bit int types

Required Methods§

source

fn extend_to_i32( self ) -> (<Self::Engine as Simd>::Vi32, <Self::Engine as Simd>::Vi32)

Splits the vector into two halves, then extends them both to be i32. This is useful for horizontal adding.

source

fn unsigned_extend_to_i32( self ) -> (<Self::Engine as Simd>::Vi32, <Self::Engine as Simd>::Vi32)

Splits the vector into two halves, then extends them both to be i32. This is useful for horizontal adding. The numbers are treated as unsigned, so the sign bit isn’t moved. This is more efficient on some instruction sets.

Provided Methods§

source

fn partial_horizontal_add(self) -> <Self::Engine as Simd>::Vi32

Adds (arbitrary) pairs of values in the vector, returning a i32 version of the vector. The way the pairs are chosen is implementation-defined.

source

fn partial_horizontal_unsigned_add(self) -> <Self::Engine as Simd>::Vi32

Adds (arbitrary) pairs of values in the vector, returning a i32 version of the vector. When extending the numbers, they’re treated as unsigned wich performs more efficiently on some instruction sets. The way the pairs are chosen is implementation-defined.

Implementors§