Type Definition packed_simd_2::f64x4
source · [−]Expand description
A 256-bit vector with 4 f64 lanes.
Implementations
sourceimpl f64x4
impl f64x4
sourcepub const fn new(x0: f64, x1: f64, x2: f64, x3: f64) -> Self
pub const fn new(x0: f64, x1: f64, x2: f64, x3: f64) -> Self
Creates a new instance with each vector elements initialized with the provided values.
sourcepub const fn splat(value: f64) -> Self
pub const fn splat(value: f64) -> Self
Constructs a new instance with each element initialized to
value.
sourcepub unsafe fn extract_unchecked(self, index: usize) -> f64
pub unsafe fn extract_unchecked(self, index: usize) -> f64
sourcepub fn replace(self, index: usize, new_value: f64) -> Self
pub fn replace(self, index: usize, new_value: f64) -> 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: f64) -> Self
pub unsafe fn replace_unchecked(self, index: usize, new_value: f64) -> 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 f64x4
impl f64x4
sourcepub fn sum(self) -> f64
pub fn sum(self) -> f64
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 NaNs in the vector.
sourcepub fn product(self) -> f64
pub fn product(self) -> f64
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 NaNs in the vector.
sourceimpl f64x4
impl f64x4
sourcepub fn max_element(self) -> f64
pub fn max_element(self) -> f64
Largest vector element value.
sourcepub fn min_element(self) -> f64
pub fn min_element(self) -> f64
Smallest vector element value.
sourceimpl f64x4
impl f64x4
sourcepub fn from_slice_aligned(slice: &[f64]) -> Self
pub fn from_slice_aligned(slice: &[f64]) -> 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: &[f64]) -> Self
pub fn from_slice_unaligned(slice: &[f64]) -> Self
sourceimpl f64x4
impl f64x4
sourcepub fn write_to_slice_aligned(self, slice: &mut [f64])
pub fn write_to_slice_aligned(self, slice: &mut [f64])
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 [f64])
pub fn write_to_slice_unaligned(self, slice: &mut [f64])
sourceimpl f64x4
impl f64x4
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 f64x4
impl f64x4
sourcepub const MIN_POSITIVE: f64x4 = f64x4::splat(core::f64::MIN_POSITIVE)
pub const MIN_POSITIVE: f64x4 = f64x4::splat(core::f64::MIN_POSITIVE)
Smallest positive normal value.
sourcepub const NEG_INFINITY: f64x4 = f64x4::splat(core::f64::NEG_INFINITY)
pub const NEG_INFINITY: f64x4 = f64x4::splat(core::f64::NEG_INFINITY)
Negative infinity (-∞).
sourcepub const FRAC_2_SQRT_PI: f64x4 = f64x4::splat(core::f64::consts::FRAC_2_SQRT_PI)
pub const FRAC_2_SQRT_PI: f64x4 = f64x4::splat(core::f64::consts::FRAC_2_SQRT_PI)
2/sqrt(π)
sourcepub const FRAC_1_SQRT_2: f64x4 = f64x4::splat(core::f64::consts::FRAC_1_SQRT_2)
pub const FRAC_1_SQRT_2: f64x4 = f64x4::splat(core::f64::consts::FRAC_1_SQRT_2)
1/sqrt(2)
sourceimpl f64x4
impl f64x4
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<[f64; 4]>> for f64x4
impl AddAssign<Simd<[f64; 4]>> for f64x4
sourcefn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the += operation. Read more
sourceimpl AddAssign<f64> for f64x4
impl AddAssign<f64> for f64x4
sourcefn add_assign(&mut self, other: f64)
fn add_assign(&mut self, other: f64)
Performs the += operation. Read more
sourceimpl DivAssign<Simd<[f64; 4]>> for f64x4
impl DivAssign<Simd<[f64; 4]>> for f64x4
sourcefn div_assign(&mut self, other: Self)
fn div_assign(&mut self, other: Self)
Performs the /= operation. Read more
sourceimpl DivAssign<f64> for f64x4
impl DivAssign<f64> for f64x4
sourcefn div_assign(&mut self, other: f64)
fn div_assign(&mut self, other: f64)
Performs the /= operation. Read more
sourceimpl MulAssign<Simd<[f64; 4]>> for f64x4
impl MulAssign<Simd<[f64; 4]>> for f64x4
sourcefn mul_assign(&mut self, other: Self)
fn mul_assign(&mut self, other: Self)
Performs the *= operation. Read more
sourceimpl MulAssign<f64> for f64x4
impl MulAssign<f64> for f64x4
sourcefn mul_assign(&mut self, other: f64)
fn mul_assign(&mut self, other: f64)
Performs the *= operation. Read more
sourceimpl RemAssign<Simd<[f64; 4]>> for f64x4
impl RemAssign<Simd<[f64; 4]>> for f64x4
sourcefn rem_assign(&mut self, other: Self)
fn rem_assign(&mut self, other: Self)
Performs the %= operation. Read more
sourceimpl RemAssign<f64> for f64x4
impl RemAssign<f64> for f64x4
sourcefn rem_assign(&mut self, other: f64)
fn rem_assign(&mut self, other: f64)
Performs the %= operation. Read more
sourceimpl SubAssign<Simd<[f64; 4]>> for f64x4
impl SubAssign<Simd<[f64; 4]>> for f64x4
sourcefn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the -= operation. Read more
sourceimpl SubAssign<f64> for f64x4
impl SubAssign<f64> for f64x4
sourcefn sub_assign(&mut self, other: f64)
fn sub_assign(&mut self, other: f64)
Performs the -= operation. Read more