Trait simdeez::SimdBaseOps

source ·
pub trait SimdBaseOps: SimdConsts + SimdBaseIo + IndexMut<usize> + Index<usize, Output = <Self as SimdConsts>::Scalar> + Add<Self, Output = Self> + Add<<Self as SimdConsts>::Scalar, Output = Self> + AddAssign<Self> + AddAssign<<Self as SimdConsts>::Scalar> + Neg<Output = Self> + Sub<Self, Output = Self> + Sub<<Self as SimdConsts>::Scalar, Output = Self> + SubAssign<Self> + SubAssign<<Self as SimdConsts>::Scalar> + Mul<Self, Output = Self> + Mul<<Self as SimdConsts>::Scalar, Output = Self> + MulAssign<Self> + MulAssign<<Self as SimdConsts>::Scalar> + BitAnd<Self, Output = Self> + BitAnd<<Self as SimdConsts>::Scalar, Output = Self> + BitAndAssign<Self> + BitAndAssign<<Self as SimdConsts>::Scalar> + BitOr<Self, Output = Self> + BitOr<<Self as SimdConsts>::Scalar, Output = Self> + BitOrAssign<Self> + BitOrAssign<<Self as SimdConsts>::Scalar> + BitXor<Self, Output = Self> + BitXor<<Self as SimdConsts>::Scalar, Output = Self> + BitXorAssign<Self> + BitXorAssign<<Self as SimdConsts>::Scalar> + Not<Output = Self> {
Show 20 methods // Required methods fn add(self, rhs: Self) -> Self; fn sub(self, rhs: Self) -> Self; fn mul(self, rhs: Self) -> Self; fn bit_and(self, rhs: Self) -> Self; fn bit_or(self, rhs: Self) -> Self; fn bit_xor(self, rhs: Self) -> Self; fn bit_not(self) -> Self; fn abs(self) -> Self; fn and_not(self, rhs: Self) -> Self; fn blendv(self, a: Self, b: Self) -> Self; fn cmp_eq(self, rhs: Self) -> Self; fn cmp_neq(self, rhs: Self) -> Self; fn cmp_lt(self, rhs: Self) -> Self; fn cmp_lte(self, rhs: Self) -> Self; fn cmp_gt(self, rhs: Self) -> Self; fn cmp_gte(self, rhs: Self) -> Self; fn max(self, rhs: Self) -> Self; fn min(self, rhs: Self) -> Self; fn horizontal_add(self) -> Self::HorizontalAddScalar; // Provided method fn neg(self) -> Self { ... }
}
Expand description

Operations shared by all SIMD types

Required Methods§

source

fn add(self, rhs: Self) -> Self

Element-wise add between two vectors

source

fn sub(self, rhs: Self) -> Self

Element-wise subtract between two vectors

source

fn mul(self, rhs: Self) -> Self

Element-wise multiply between two vectors

source

fn bit_and(self, rhs: Self) -> Self

Binary and between two vectors

source

fn bit_or(self, rhs: Self) -> Self

Binary or between two vectors

source

fn bit_xor(self, rhs: Self) -> Self

Binary xor between two vectors

source

fn bit_not(self) -> Self

Binary not operation for a vector

source

fn abs(self) -> Self

Element-wise absolute value

source

fn and_not(self, rhs: Self) -> Self

Binary and not between two vectors self & (!rhs)

source

fn blendv(self, a: Self, b: Self) -> Self

Element-wise “blend” between two vectors. A is selected if the mask value is zero, and B is selected if the mask value is all 1’s. undefined behavior if it’s anything in between. See note below.

Note: SSE2 will select B only when all bits are 1, while SSE41 and AVX2 only check the high bit. To maintain portability ensure all bits are 1 when using blend. Results of comparison operations adhere to this.

source

fn cmp_eq(self, rhs: Self) -> Self

Element-wise equality between two vectors. If two elements are equal, it returns all 1’s in the corresponding element of the result, otherwise it returns all 0’s.

source

fn cmp_neq(self, rhs: Self) -> Self

Element-wise inequality between two vectors. If two elements are not equal, it returns all 1’s in the corresponding element of the result, otherwise it returns all 0’s.

source

fn cmp_lt(self, rhs: Self) -> Self

Element-wise less than between two vectors. If the first element is less than the second element, it returns all 1’s in the corresponding element of the result, otherwise it returns all 0’s.

source

fn cmp_lte(self, rhs: Self) -> Self

Element-wise less than or equal to between two vectors. If the first element is less than or equal to the second element, it returns all 1’s in the corresponding element of the result, otherwise it returns all 0’s.

source

fn cmp_gt(self, rhs: Self) -> Self

Element-wise greater than between two vectors. If the first element is greater than the second element, it returns all 1’s in the corresponding element of the result, otherwise it returns all 0’s.

source

fn cmp_gte(self, rhs: Self) -> Self

Element-wise greater than or equal to between two vectors. If the first element is greater than or equal to the second element, it returns all 1’s in the corresponding element of the result, otherwise it returns all 0’s.

source

fn max(self, rhs: Self) -> Self

Element-wise maximum between two vectors.

source

fn min(self, rhs: Self) -> Self

Element-wise minimum between two vectors.

source

fn horizontal_add(self) -> Self::HorizontalAddScalar

Add every number in the vector together

Provided Methods§

source

fn neg(self) -> Self

Element-wise negative of all elements

Implementors§