use wide::f32x8;
#[inline(always)]
#[must_use]
#[allow(
clippy::disallowed_methods,
reason = "the one place the platform max is allowed; callers are listed in scripts/raw_minmax_manifest.toml"
)]
pub const fn raw_max_f32(a: f32, b: f32) -> f32 {
a.max(b)
}
#[inline(always)]
#[must_use]
#[allow(
clippy::disallowed_methods,
reason = "the one place the platform min is allowed; callers are listed in scripts/raw_minmax_manifest.toml"
)]
pub const fn raw_min_f32(a: f32, b: f32) -> f32 {
a.min(b)
}
#[inline(always)]
#[must_use]
#[allow(
clippy::disallowed_methods,
reason = "the one place the platform SIMD max is allowed; callers are listed in scripts/raw_minmax_manifest.toml"
)]
pub fn raw_max_f32x8(a: f32x8, b: f32x8) -> f32x8 {
a.max(b)
}
#[inline(always)]
#[must_use]
#[allow(
clippy::disallowed_methods,
reason = "the one place the platform SIMD min is allowed; callers are listed in scripts/raw_minmax_manifest.toml"
)]
pub fn raw_min_f32x8(a: f32x8, b: f32x8) -> f32x8 {
a.min(b)
}
pub trait RawMinMax: Sized {
#[must_use]
fn raw_max(self, other: Self) -> Self;
#[must_use]
fn raw_min(self, other: Self) -> Self;
}
impl RawMinMax for f32 {
#[inline(always)]
fn raw_max(self, other: Self) -> Self {
raw_max_f32(self, other)
}
#[inline(always)]
fn raw_min(self, other: Self) -> Self {
raw_min_f32(self, other)
}
}
impl RawMinMax for f32x8 {
#[inline(always)]
fn raw_max(self, other: Self) -> Self {
raw_max_f32x8(self, other)
}
#[inline(always)]
fn raw_min(self, other: Self) -> Self {
raw_min_f32x8(self, other)
}
}