Trait fearless_simd::SimdF32
source · pub trait SimdF32: Sized + Copy + Clone + Add<Self, Output = Self> + Add<f32, Output = Self> + Sub<Self, Output = Self> + Sub<f32, Output = Self> + Mul<Self, Output = Self> + Mul<f32, Output = Self> + Div<Self, Output = Self> + Mul<f32, Output = Self> + Neg<Output = Self> {
type Raw: From<Self>;
type Mask: SimdMask32<F32 = Self>;
Show 28 methods
fn width(self) -> usize;
fn floor(self) -> Self;
fn ceil(self) -> Self;
fn round(self) -> Self;
fn abs(self) -> Self;
fn min(self, other: Self) -> Self;
fn max(self, other: Self) -> Self;
fn recip(self) -> Self;
fn rsqrt(self) -> Self;
fn splat(self, x: f32) -> Self;
fn steps(self) -> Self;
unsafe fn from_raw(raw: Self::Raw) -> Self;
unsafe fn load(p: *const f32) -> Self;
unsafe fn store(self, p: *mut f32);
unsafe fn create() -> Self;
fn eq(self, other: Self) -> Self::Mask;
fn recip8(self) -> Self { ... }
fn recip11(self) -> Self { ... }
fn recip14(self) -> Self { ... }
fn recip16(self) -> Self { ... }
fn recip22(self) -> Self { ... }
fn rsqrt8(self) -> Self { ... }
fn rsqrt11(self) -> Self { ... }
fn rsqrt14(self) -> Self { ... }
fn rsqrt16(self) -> Self { ... }
fn rsqrt22(self) -> Self { ... }
fn from_slice(self, slice: &[f32]) -> Self { ... }
fn write_to_slice(self, slice: &mut [f32]) { ... }
}
Required Associated Types
Required Methods
fn width(self) -> usize
sourcefn round(self) -> Self
fn round(self) -> Self
Round a float to the nearest integer.
The behavior on a tie is unspecified, and will be whatever is
fastest on a given implementation. The ideal behavior is to round
to the nearest even integer on tie; note that this is different
than f32::round
.
See https://github.com/rust-lang/rust/issues/55107 for discussion.
sourcefn splat(self, x: f32) -> Self
fn splat(self, x: f32) -> Self
Repeat a scalar in all lanes.
Note: self is unused but is needed for safety.
sourcefn steps(self) -> Self
fn steps(self) -> Self
Create SIMD that contains the lane number.
For example, for 4 lanes, it is [0.0, 1.0, 2.0, 3.0].
Note: self is unused but is needed for safety.
sourceunsafe fn from_raw(raw: Self::Raw) -> Self
unsafe fn from_raw(raw: Self::Raw) -> Self
Create from a raw value. Marked as unsafe because it requires that the corresponding target_feature is enabled.
unsafe fn load(p: *const f32) -> Self
unsafe fn store(self, p: *mut f32)
sourceunsafe fn create() -> Self
unsafe fn create() -> Self
Create an instance (zero but value is usually ignored). Marked as unsafe because it requires that the corresponding target_feature is enabled.
fn eq(self, other: Self) -> Self::Mask
Provided Methods
sourcefn from_slice(self, slice: &[f32]) -> Self
fn from_slice(self, slice: &[f32]) -> Self
Load from a slice.
Panics
If slice.len() < Self::width()
.
Note: self is unused but is needed for safety.
sourcefn write_to_slice(self, slice: &mut [f32])
fn write_to_slice(self, slice: &mut [f32])
Write into a slice.
Panics
If slice.len() < Self::width()
.
Note: self is unused but is needed for safety.