Type Definition packed_simd_2::f32x16
source · [−]Expand description
A 512-bit vector with 16 f32
lanes.
Implementations
sourceimpl f32x16
impl f32x16
sourcepub const fn new(
x0: f32,
x1: f32,
x2: f32,
x3: f32,
x4: f32,
x5: f32,
x6: f32,
x7: f32,
x8: f32,
x9: f32,
x10: f32,
x11: f32,
x12: f32,
x13: f32,
x14: f32,
x15: f32
) -> Self
pub const fn new(
x0: f32,
x1: f32,
x2: f32,
x3: f32,
x4: f32,
x5: f32,
x6: f32,
x7: f32,
x8: f32,
x9: f32,
x10: f32,
x11: f32,
x12: f32,
x13: f32,
x14: f32,
x15: f32
) -> Self
Creates a new instance with each vector elements initialized with the provided values.
sourcepub const fn splat(value: f32) -> Self
pub const fn splat(value: f32) -> Self
Constructs a new instance with each element initialized to
value
.
sourcepub unsafe fn extract_unchecked(self, index: usize) -> f32
pub unsafe fn extract_unchecked(self, index: usize) -> f32
sourcepub fn replace(self, index: usize, new_value: f32) -> Self
pub fn replace(self, index: usize, new_value: f32) -> Self
Returns a new vector where the value at index
is replaced by new_value
.
Panics
If index >= Self::lanes()
.
sourcepub unsafe fn replace_unchecked(self, index: usize, new_value: f32) -> Self
pub unsafe fn replace_unchecked(self, index: usize, new_value: f32) -> Self
Returns a new vector where the value at index
is replaced by new_value
.
Safety
If index >= Self::lanes()
the behavior is undefined.
sourceimpl f32x16
impl f32x16
sourcepub fn sum(self) -> f32
pub fn sum(self) -> f32
Horizontal sum of the vector elements.
The intrinsic performs a tree-reduction of the vector elements. That is, for an 8 element vector:
((x0 + x1) + (x2 + x3)) + ((x4 + x5) + (x6 + x7))
If one of the vector element is NaN
the reduction returns
NaN
. The resulting NaN
is not required to be equal to any
of the NaN
s in the vector.
sourcepub fn product(self) -> f32
pub fn product(self) -> f32
Horizontal product of the vector elements.
The intrinsic performs a tree-reduction of the vector elements. That is, for an 8 element vector:
((x0 * x1) * (x2 * x3)) * ((x4 * x5) * (x6 * x7))
If one of the vector element is NaN
the reduction returns
NaN
. The resulting NaN
is not required to be equal to any
of the NaN
s in the vector.
sourceimpl f32x16
impl f32x16
sourcepub fn max_element(self) -> f32
pub fn max_element(self) -> f32
Largest vector element value.
sourcepub fn min_element(self) -> f32
pub fn min_element(self) -> f32
Smallest vector element value.
sourceimpl f32x16
impl f32x16
sourcepub fn from_slice_aligned(slice: &[f32]) -> Self
pub fn from_slice_aligned(slice: &[f32]) -> Self
Instantiates a new vector with the values of the slice
.
Panics
If slice.len() < Self::lanes()
or &slice[0]
is not aligned
to an align_of::<Self>()
boundary.
sourcepub fn from_slice_unaligned(slice: &[f32]) -> Self
pub fn from_slice_unaligned(slice: &[f32]) -> Self
sourceimpl f32x16
impl f32x16
sourcepub fn write_to_slice_aligned(self, slice: &mut [f32])
pub fn write_to_slice_aligned(self, slice: &mut [f32])
Writes the values of the vector to the slice
.
Panics
If slice.len() < Self::lanes()
or &slice[0]
is not
aligned to an align_of::<Self>()
boundary.
sourcepub fn write_to_slice_unaligned(self, slice: &mut [f32])
pub fn write_to_slice_unaligned(self, slice: &mut [f32])
sourceimpl f32x16
impl f32x16
sourcepub fn shuffle1_dyn<I>(self, indices: I) -> Self where
Self: Shuffle1Dyn<Indices = I>,
pub fn shuffle1_dyn<I>(self, indices: I) -> Self where
Self: Shuffle1Dyn<Indices = I>,
Shuffle vector elements according to indices
.
sourceimpl f32x16
impl f32x16
sourcepub const MIN_POSITIVE: f32x16 = f32x16::splat(core::f32::MIN_POSITIVE)
pub const MIN_POSITIVE: f32x16 = f32x16::splat(core::f32::MIN_POSITIVE)
Smallest positive normal value.
sourcepub const NEG_INFINITY: f32x16 = f32x16::splat(core::f32::NEG_INFINITY)
pub const NEG_INFINITY: f32x16 = f32x16::splat(core::f32::NEG_INFINITY)
Negative infinity (-∞).
sourcepub const FRAC_2_SQRT_PI: f32x16 = f32x16::splat(core::f32::consts::FRAC_2_SQRT_PI)
pub const FRAC_2_SQRT_PI: f32x16 = f32x16::splat(core::f32::consts::FRAC_2_SQRT_PI)
2/sqrt(π)
sourcepub const FRAC_1_SQRT_2: f32x16 = f32x16::splat(core::f32::consts::FRAC_1_SQRT_2)
pub const FRAC_1_SQRT_2: f32x16 = f32x16::splat(core::f32::consts::FRAC_1_SQRT_2)
1/sqrt(2)
sourceimpl f32x16
impl f32x16
sourcepub fn mul_adde(self, y: Self, z: Self) -> Self
pub fn mul_adde(self, y: Self, z: Self) -> Self
Fused multiply add estimate: ~= self * y + z
While fused multiply-add (fma
) has infinite precision,
mul_adde
has at worst the same precision of a multiply followed by an add.
This might be more efficient on architectures that do not have an fma
instruction.
Trait Implementations
sourceimpl AddAssign<Simd<[f32; 16]>> for f32x16
impl AddAssign<Simd<[f32; 16]>> for f32x16
sourcefn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the +=
operation. Read more
sourceimpl AddAssign<f32> for f32x16
impl AddAssign<f32> for f32x16
sourcefn add_assign(&mut self, other: f32)
fn add_assign(&mut self, other: f32)
Performs the +=
operation. Read more
sourceimpl DivAssign<Simd<[f32; 16]>> for f32x16
impl DivAssign<Simd<[f32; 16]>> for f32x16
sourcefn div_assign(&mut self, other: Self)
fn div_assign(&mut self, other: Self)
Performs the /=
operation. Read more
sourceimpl DivAssign<f32> for f32x16
impl DivAssign<f32> for f32x16
sourcefn div_assign(&mut self, other: f32)
fn div_assign(&mut self, other: f32)
Performs the /=
operation. Read more
sourceimpl MulAssign<Simd<[f32; 16]>> for f32x16
impl MulAssign<Simd<[f32; 16]>> for f32x16
sourcefn mul_assign(&mut self, other: Self)
fn mul_assign(&mut self, other: Self)
Performs the *=
operation. Read more
sourceimpl MulAssign<f32> for f32x16
impl MulAssign<f32> for f32x16
sourcefn mul_assign(&mut self, other: f32)
fn mul_assign(&mut self, other: f32)
Performs the *=
operation. Read more
sourceimpl RemAssign<Simd<[f32; 16]>> for f32x16
impl RemAssign<Simd<[f32; 16]>> for f32x16
sourcefn rem_assign(&mut self, other: Self)
fn rem_assign(&mut self, other: Self)
Performs the %=
operation. Read more
sourceimpl RemAssign<f32> for f32x16
impl RemAssign<f32> for f32x16
sourcefn rem_assign(&mut self, other: f32)
fn rem_assign(&mut self, other: f32)
Performs the %=
operation. Read more
sourceimpl SubAssign<Simd<[f32; 16]>> for f32x16
impl SubAssign<Simd<[f32; 16]>> for f32x16
sourcefn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the -=
operation. Read more
sourceimpl SubAssign<f32> for f32x16
impl SubAssign<f32> for f32x16
sourcefn sub_assign(&mut self, other: f32)
fn sub_assign(&mut self, other: f32)
Performs the -=
operation. Read more