1 use crate::simd::intrinsics;
2 use crate::simd::{LaneCount, Mask, Simd, SimdElement, SupportedLaneCount};
4 impl<T, const LANES: usize> Simd<T, LANES>
6 T: SimdElement + PartialEq,
7 LaneCount<LANES>: SupportedLaneCount,
9 /// Test if each lane is equal to the corresponding lane in `other`.
11 pub fn lanes_eq(self, other: Self) -> Mask<T::Mask, LANES> {
12 unsafe { Mask::from_int_unchecked(intrinsics::simd_eq(self, other)) }
15 /// Test if each lane is not equal to the corresponding lane in `other`.
17 pub fn lanes_ne(self, other: Self) -> Mask<T::Mask, LANES> {
18 unsafe { Mask::from_int_unchecked(intrinsics::simd_ne(self, other)) }
22 impl<T, const LANES: usize> Simd<T, LANES>
24 T: SimdElement + PartialOrd,
25 LaneCount<LANES>: SupportedLaneCount,
27 /// Test if each lane is less than the corresponding lane in `other`.
29 pub fn lanes_lt(self, other: Self) -> Mask<T::Mask, LANES> {
30 unsafe { Mask::from_int_unchecked(intrinsics::simd_lt(self, other)) }
33 /// Test if each lane is greater than the corresponding lane in `other`.
35 pub fn lanes_gt(self, other: Self) -> Mask<T::Mask, LANES> {
36 unsafe { Mask::from_int_unchecked(intrinsics::simd_gt(self, other)) }
39 /// Test if each lane is less than or equal to the corresponding lane in `other`.
41 pub fn lanes_le(self, other: Self) -> Mask<T::Mask, LANES> {
42 unsafe { Mask::from_int_unchecked(intrinsics::simd_le(self, other)) }
45 /// Test if each lane is greater than or equal to the corresponding lane in `other`.
47 pub fn lanes_ge(self, other: Self) -> Mask<T::Mask, LANES> {
48 unsafe { Mask::from_int_unchecked(intrinsics::simd_ge(self, other)) }