Trait std::simd::SimdOrd

source ·
pub trait SimdOrd: SimdPartialOrd {
    // Required methods
    fn simd_max(self, other: Self) -> Self;
    fn simd_min(self, other: Self) -> Self;
    fn simd_clamp(self, min: Self, max: Self) -> Self;
}
🔬This is a nightly-only experimental API. (portable_simd #86656)
Expand description

Parallel Ord.

Required Methods§

source

fn simd_max(self, other: Self) -> Self

🔬This is a nightly-only experimental API. (portable_simd #86656)

使用 other 返回 lane 方向的最大值。

source

fn simd_min(self, other: Self) -> Self

🔬This is a nightly-only experimental API. (portable_simd #86656)

使用 other 返回 lane 方向的最小值。

source

fn simd_clamp(self, min: Self, max: Self) -> Self

🔬This is a nightly-only experimental API. (portable_simd #86656)

将每个 lane 限制在一定的间隔内。

对于每个 lane,如果 self 大于 max,则返回 max,如果 self 小于 min,则返回 min。 否则返回 self

Panics

如果在任何 lane 上出现 min > max,就会出现 panic。

Implementors§

source§

impl<T, const LANES: usize> SimdOrd for Simd<*const T, LANES>where LaneCount<LANES>: SupportedLaneCount,

source§

impl<T, const LANES: usize> SimdOrd for Simd<*mut T, LANES>where LaneCount<LANES>: SupportedLaneCount,

source§

impl<const LANES: usize> SimdOrd for Mask<i8, LANES>where LaneCount<LANES>: SupportedLaneCount,

source§

impl<const LANES: usize> SimdOrd for Mask<i16, LANES>where LaneCount<LANES>: SupportedLaneCount,

source§

impl<const LANES: usize> SimdOrd for Mask<i32, LANES>where LaneCount<LANES>: SupportedLaneCount,

source§

impl<const LANES: usize> SimdOrd for Mask<i64, LANES>where LaneCount<LANES>: SupportedLaneCount,

source§

impl<const LANES: usize> SimdOrd for Mask<isize, LANES>where LaneCount<LANES>: SupportedLaneCount,

source§

impl<const LANES: usize> SimdOrd for Simd<i8, LANES>where LaneCount<LANES>: SupportedLaneCount,

source§

impl<const LANES: usize> SimdOrd for Simd<i16, LANES>where LaneCount<LANES>: SupportedLaneCount,

source§

impl<const LANES: usize> SimdOrd for Simd<i32, LANES>where LaneCount<LANES>: SupportedLaneCount,

source§

impl<const LANES: usize> SimdOrd for Simd<i64, LANES>where LaneCount<LANES>: SupportedLaneCount,

source§

impl<const LANES: usize> SimdOrd for Simd<isize, LANES>where LaneCount<LANES>: SupportedLaneCount,

source§

impl<const LANES: usize> SimdOrd for Simd<u8, LANES>where LaneCount<LANES>: SupportedLaneCount,

source§

impl<const LANES: usize> SimdOrd for Simd<u16, LANES>where LaneCount<LANES>: SupportedLaneCount,

source§

impl<const LANES: usize> SimdOrd for Simd<u32, LANES>where LaneCount<LANES>: SupportedLaneCount,

source§

impl<const LANES: usize> SimdOrd for Simd<u64, LANES>where LaneCount<LANES>: SupportedLaneCount,

source§

impl<const LANES: usize> SimdOrd for Simd<usize, LANES>where LaneCount<LANES>: SupportedLaneCount,