polylane 0.9.0

Portable and versatile SIMD.
Documentation
// Copyright 2025 Gabriel Bjørnager Jensen.
//
// This Source Code Form is subject to the terms of
// the Mozilla Public License, v. 2.0. If a copy of
// the MPL was not distributed with this file, you
// can obtain one at:
// <https://mozilla.org/MPL/2.0/>.

use crate::cmp::SimdPartialOrd;

/// SIMD equivalent of [`Ord`].
pub trait SimdOrd: SimdPartialOrd {
	/// Tests for the minimum values between SIMD elements.
	#[must_use]
	fn simd_min(self, other: Self) -> Self::Mask;

	/// Tests for the maximum values between SIMD elements.
	#[must_use]
	fn simd_max(self, other: Self) -> Self::Mask;

	/// Clamps the elements of `self` to the equivalent element values in `min` and `max`.
	///
	/// # Panics
	///
	/// Implementations of this method should panic if any value of `min` is greater than the equivalent value in `max`.
	#[must_use]
	fn simd_clamp(self, min: Self, max: Self) -> Self;
}