Type Definition packed_simd::f64x4
source · pub type f64x4 = Simd<[f64; 4]>;
Expand description
A 256-bit vector with 4 f64
lanes.
Implementations§
source§impl 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.
source§impl 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 NaN
s 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 NaN
s in the vector.
source§impl 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.
source§impl 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
sourcepub unsafe fn from_slice_aligned_unchecked(slice: &[f64]) -> Self
pub unsafe fn from_slice_aligned_unchecked(slice: &[f64]) -> Self
Instantiates a new vector with the values of the slice
.
Safety
If slice.len() < Self::lanes()
or &slice[0]
is not aligned
to an align_of::<Self>()
boundary, the behavior is undefined.
sourcepub unsafe fn from_slice_unaligned_unchecked(slice: &[f64]) -> Self
pub unsafe fn from_slice_unaligned_unchecked(slice: &[f64]) -> Self
Instantiates a new vector with the values of the slice
.
Safety
If slice.len() < Self::lanes()
the behavior is undefined.
source§impl 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])
sourcepub unsafe fn write_to_slice_aligned_unchecked(self, slice: &mut [f64])
pub unsafe fn write_to_slice_aligned_unchecked(self, slice: &mut [f64])
Writes the values of the vector to the slice
.
Safety
If slice.len() < Self::lanes()
or &slice[0]
is not
aligned to an align_of::<Self>()
boundary, the behavior is
undefined.
sourcepub unsafe fn write_to_slice_unaligned_unchecked(self, slice: &mut [f64])
pub unsafe fn write_to_slice_unaligned_unchecked(self, slice: &mut [f64])
Writes the values of the vector to the slice
.
Safety
If slice.len() < Self::lanes()
the behavior is undefined.
source§impl f64x4
impl f64x4
sourcepub fn shuffle1_dyn<I>(self, indices: I) -> Selfwhere
Self: Shuffle1Dyn<Indices = I>,
pub fn shuffle1_dyn<I>(self, indices: I) -> Selfwhere Self: Shuffle1Dyn<Indices = I>,
Shuffle vector elements according to indices
.
source§impl f64x4
impl f64x4
sourcepub const MIN_POSITIVE: f64x4 = _
pub const MIN_POSITIVE: f64x4 = _
Smallest positive normal value.
sourcepub const NEG_INFINITY: f64x4 = _
pub const NEG_INFINITY: f64x4 = _
Negative infinity (-∞).
sourcepub const FRAC_2_SQRT_PI: f64x4 = _
pub const FRAC_2_SQRT_PI: f64x4 = _
2/sqrt(π)
sourcepub const FRAC_1_SQRT_2: f64x4 = _
pub const FRAC_1_SQRT_2: f64x4 = _
1/sqrt(2)
source§impl 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.
source§impl f64x4
impl f64x4
sourcepub fn sin_cos_pi(self) -> (Self, Self)
pub fn sin_cos_pi(self) -> (Self, Self)
Sine and cosine of self * PI
.
Trait Implementations§
source§impl AddAssign<Simd<[f64; 4]>> for f64x4
impl AddAssign<Simd<[f64; 4]>> for f64x4
source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
+=
operation. Read moresource§impl AddAssign<f64> for f64x4
impl AddAssign<f64> for f64x4
source§fn add_assign(&mut self, other: f64)
fn add_assign(&mut self, other: f64)
+=
operation. Read moresource§impl DivAssign<Simd<[f64; 4]>> for f64x4
impl DivAssign<Simd<[f64; 4]>> for f64x4
source§fn div_assign(&mut self, other: Self)
fn div_assign(&mut self, other: Self)
/=
operation. Read moresource§impl DivAssign<f64> for f64x4
impl DivAssign<f64> for f64x4
source§fn div_assign(&mut self, other: f64)
fn div_assign(&mut self, other: f64)
/=
operation. Read moresource§impl MulAssign<Simd<[f64; 4]>> for f64x4
impl MulAssign<Simd<[f64; 4]>> for f64x4
source§fn mul_assign(&mut self, other: Self)
fn mul_assign(&mut self, other: Self)
*=
operation. Read moresource§impl MulAssign<f64> for f64x4
impl MulAssign<f64> for f64x4
source§fn mul_assign(&mut self, other: f64)
fn mul_assign(&mut self, other: f64)
*=
operation. Read moresource§impl RemAssign<Simd<[f64; 4]>> for f64x4
impl RemAssign<Simd<[f64; 4]>> for f64x4
source§fn rem_assign(&mut self, other: Self)
fn rem_assign(&mut self, other: Self)
%=
operation. Read moresource§impl RemAssign<f64> for f64x4
impl RemAssign<f64> for f64x4
source§fn rem_assign(&mut self, other: f64)
fn rem_assign(&mut self, other: f64)
%=
operation. Read moresource§impl SubAssign<Simd<[f64; 4]>> for f64x4
impl SubAssign<Simd<[f64; 4]>> for f64x4
source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
-=
operation. Read moresource§impl SubAssign<f64> for f64x4
impl SubAssign<f64> for f64x4
source§fn sub_assign(&mut self, other: f64)
fn sub_assign(&mut self, other: f64)
-=
operation. Read more