pub trait SimdInt8: SimdInt<Scalar = i8, HorizontalAddScalar = i64> + SimdTransmuteI8 {
// Required methods
fn extend_to_i16(
self
) -> (<Self::Engine as Simd>::Vi16, <Self::Engine as Simd>::Vi16);
fn unsigned_extend_to_i16(
self
) -> (<Self::Engine as Simd>::Vi16, <Self::Engine as Simd>::Vi16);
fn get_mask(self) -> u32;
// Provided methods
fn partial_horizontal_add(self) -> <Self::Engine as Simd>::Vi16 { ... }
fn partial_horizontal_unsigned_add(self) -> <Self::Engine as Simd>::Vi16 { ... }
fn is_any_truthy(self) -> bool { ... }
fn index_of_last_truthy(self) -> Option<usize> { ... }
fn index_of_last_falsy(self) -> Option<usize> { ... }
fn index_of_first_truthy(self) -> Option<usize> { ... }
fn index_of_first_falsy(self) -> Option<usize> { ... }
fn index_of_first_eq(self, value: i8) -> Option<usize> { ... }
}
Expand description
Operations shared by 8 bit int types
Required Methods§
sourcefn extend_to_i16(
self
) -> (<Self::Engine as Simd>::Vi16, <Self::Engine as Simd>::Vi16)
fn extend_to_i16( self ) -> (<Self::Engine as Simd>::Vi16, <Self::Engine as Simd>::Vi16)
Splits the vector into two halves, then extends them both to be i16. This is useful for horizontal adding.
sourcefn unsigned_extend_to_i16(
self
) -> (<Self::Engine as Simd>::Vi16, <Self::Engine as Simd>::Vi16)
fn unsigned_extend_to_i16( self ) -> (<Self::Engine as Simd>::Vi16, <Self::Engine as Simd>::Vi16)
Splits the vector into two halves, then extends them both to be i16. 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.
sourcefn get_mask(self) -> u32
fn get_mask(self) -> u32
Gets the “mask” of a vector, where each bit in the u32 represents whether the value at that location is truthy. A value is truthy either if the highest bit is one, or if any bit is one, depending on the instruction set being used. Please always make sure at least the highest bit is set to 1.
Provided Methods§
sourcefn partial_horizontal_add(self) -> <Self::Engine as Simd>::Vi16
fn partial_horizontal_add(self) -> <Self::Engine as Simd>::Vi16
Adds (arbitrary) pairs of values in the vector, returning a i16 version of the vector. The way the pairs are chosen is implementation-defined.
sourcefn partial_horizontal_unsigned_add(self) -> <Self::Engine as Simd>::Vi16
fn partial_horizontal_unsigned_add(self) -> <Self::Engine as Simd>::Vi16
Adds (arbitrary) pairs of values in the vector, returning a i16 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.
sourcefn is_any_truthy(self) -> bool
fn is_any_truthy(self) -> bool
Checks if any element in the vector is truthy. A value is truthy either if the highest bit is one, or if any bit is one, depending on the instruction set being used. Please always make sure at least the highest bit is set to 1.
sourcefn index_of_last_truthy(self) -> Option<usize>
fn index_of_last_truthy(self) -> Option<usize>
Grabs the index of the last value that matches the given value. If no value matches, returns None. Index will always be smaller than Self::WIDTH.
sourcefn index_of_last_falsy(self) -> Option<usize>
fn index_of_last_falsy(self) -> Option<usize>
Grabs the index of the last value that matches the given value. If no value matches, returns None. Index will always be smaller than Self::WIDTH.
sourcefn index_of_first_truthy(self) -> Option<usize>
fn index_of_first_truthy(self) -> Option<usize>
Grabs the index of the first value that matches the given value. If no value matches, returns None. Index will always be smaller than Self::WIDTH.
sourcefn index_of_first_falsy(self) -> Option<usize>
fn index_of_first_falsy(self) -> Option<usize>
Grabs the index of the first value that matches the given value. If no value matches, returns None. Index will always be smaller than Self::WIDTH.
sourcefn index_of_first_eq(self, value: i8) -> Option<usize>
fn index_of_first_eq(self, value: i8) -> Option<usize>
Grabs the index of the first value that matches the given value. If no value matches, returns None. Index will always be smaller than Self::WIDTH.