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 #[must_use = "method returns a new mask and does not mutate the original value"]
12 pub fn lanes_eq(self, other: Self) -> Mask<T::Mask, LANES> {
13 unsafe { Mask::from_int_unchecked(intrinsics::simd_eq(self, other)) }
16 /// Test if each lane is not equal to the corresponding lane in `other`.
18 #[must_use = "method returns a new mask and does not mutate the original value"]
19 pub fn lanes_ne(self, other: Self) -> Mask<T::Mask, LANES> {
20 unsafe { Mask::from_int_unchecked(intrinsics::simd_ne(self, other)) }
24 impl<T, const LANES: usize> Simd<T, LANES>
26 T: SimdElement + PartialOrd,
27 LaneCount<LANES>: SupportedLaneCount,
29 /// Test if each lane is less than the corresponding lane in `other`.
31 #[must_use = "method returns a new mask and does not mutate the original value"]
32 pub fn lanes_lt(self, other: Self) -> Mask<T::Mask, LANES> {
33 unsafe { Mask::from_int_unchecked(intrinsics::simd_lt(self, other)) }
36 /// Test if each lane is greater than the corresponding lane in `other`.
38 #[must_use = "method returns a new mask and does not mutate the original value"]
39 pub fn lanes_gt(self, other: Self) -> Mask<T::Mask, LANES> {
40 unsafe { Mask::from_int_unchecked(intrinsics::simd_gt(self, other)) }
43 /// Test if each lane is less than or equal to the corresponding lane in `other`.
45 #[must_use = "method returns a new mask and does not mutate the original value"]
46 pub fn lanes_le(self, other: Self) -> Mask<T::Mask, LANES> {
47 unsafe { Mask::from_int_unchecked(intrinsics::simd_le(self, other)) }
50 /// Test if each lane is greater than or equal to the corresponding lane in `other`.
52 #[must_use = "method returns a new mask and does not mutate the original value"]
53 pub fn lanes_ge(self, other: Self) -> Mask<T::Mask, LANES> {
54 unsafe { Mask::from_int_unchecked(intrinsics::simd_ge(self, other)) }