Simd in std::simd - Rust (original) (raw)
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Expand description
A SIMD vector of LANES
elements of type T
.
impl<T, const LANES: usize> Simd<T, LANES> where
T: SimdElement + BitAnd<T, Output = T>,
Simd<T, LANES>: BitAnd<Simd<T, LANES>>,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as BitAnd<Simd<T, LANES>>>::Output == Simd<T, LANES>,
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal bitwise “and”. Returns the cumulative bitwise “and” across the lanes of the vector.
impl<T, const LANES: usize> Simd<T, LANES> where
T: SimdElement + BitOr<T, Output = T>,
Simd<T, LANES>: BitOr<Simd<T, LANES>>,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as BitOr<Simd<T, LANES>>>::Output == Simd<T, LANES>,
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal bitwise “or”. Returns the cumulative bitwise “or” across the lanes of the vector.
impl<T, const LANES: usize> Simd<T, LANES> where
T: SimdElement + BitXor<T, Output = T>,
Simd<T, LANES>: BitXor<Simd<T, LANES>>,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as BitXor<Simd<T, LANES>>>::Output == Simd<T, LANES>,
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal bitwise “xor”. Returns the cumulative bitwise “xor” across the lanes of the vector.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Reverse the order of the lanes in the vector.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Rotates the vector such that the first OFFSET
elements of the slice move to the end while the last LANES - OFFSET
elements move to the front. After calling rotate_lanes_left
, the element previously in lane OFFSET
will become the first element in the slice.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Rotates the vector such that the first LANES - OFFSET
elements of the vector move to the end while the last OFFSET
elements move to the front. After calling rotate_lanes_right
, the element previously at index LANES - OFFSET
will become the first element in the slice.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Interleave two vectors.
Produces two vectors with lanes taken alternately from self
and other
.
The first result contains the first LANES / 2
lanes from self
and other
, alternating, starting with the first lane of self
.
The second result contains the last LANES / 2
lanes from self
and other
, alternating, starting with the lane LANES / 2
from the start of self
.
#![feature(portable_simd)]
let a = Simd::from_array([0, 1, 2, 3]);
let b = Simd::from_array([4, 5, 6, 7]);
let (x, y) = a.interleave(b);
assert_eq!(x.to_array(), [0, 4, 1, 5]);
assert_eq!(y.to_array(), [2, 6, 3, 7]);
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Deinterleave two vectors.
The first result takes every other lane of self
and then other
, starting with the first lane.
The second result takes every other lane of self
and then other
, starting with the second lane.
#![feature(portable_simd)]
let a = Simd::from_array([0, 4, 1, 5]);
let b = Simd::from_array([2, 6, 3, 7]);
let (x, y) = a.deinterleave(b);
assert_eq!(x.to_array(), [0, 1, 2, 3]);
assert_eq!(y.to_array(), [4, 5, 6, 7]);
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Test if each lane is equal to the corresponding lane in other
.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Test if each lane is not equal to the corresponding lane in other
.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Test if each lane is less than the corresponding lane in other
.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Test if each lane is greater than the corresponding lane in other
.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Test if each lane is less than or equal to the corresponding lane in other
.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Test if each lane is greater than or equal to the corresponding lane in other
.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Number of lanes in this vector.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Get the number of lanes in this vector.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Construct a SIMD vector by setting all lanes to the given value.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns an array reference containing the entire SIMD vector.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns a mutable array reference containing the entire SIMD vector.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Converts an array to a SIMD vector.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Converts a SIMD vector to an array.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Converts a slice to a SIMD vector containing slice[..LANES]
from_slice
will panic if the slice’s len
is less than the vector’s Simd::LANES
.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Reads from potentially discontiguous indices in slice
to construct a SIMD vector. If an index is out-of-bounds, the lane is instead selected from the or
vector.
let vec: Vec<i32> = vec![10, 11, 12, 13, 14, 15, 16, 17, 18];
let idxs = Simd::from_array([9, 3, 0, 5]);
let alt = Simd::from_array([-5, -4, -3, -2]);
let result = Simd::gather_or(&vec, idxs, alt); // Note the lane that is out-of-bounds.
assert_eq!(result, Simd::from_array([-5, 13, 10, 15]));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Reads from potentially discontiguous indices in slice
to construct a SIMD vector. If an index is out-of-bounds, the lane is set to the default value for the type.
let vec: Vec<i32> = vec![10, 11, 12, 13, 14, 15, 16, 17, 18];
let idxs = Simd::from_array([9, 3, 0, 5]);
let result = Simd::gather_or_default(&vec, idxs); // Note the lane that is out-of-bounds.
assert_eq!(result, Simd::from_array([0, 13, 10, 15]));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Reads from potentially discontiguous indices in slice
to construct a SIMD vector. The mask enable
s all true
lanes and disables all false
lanes. If an index is disabled or is out-of-bounds, the lane is selected from the or
vector.
let vec: Vec<i32> = vec![10, 11, 12, 13, 14, 15, 16, 17, 18];
let idxs = Simd::from_array([9, 3, 0, 5]);
let alt = Simd::from_array([-5, -4, -3, -2]);
let enable = Mask::from_array([true, true, true, false]); // Note the mask of the last lane.
let result = Simd::gather_select(&vec, enable, idxs, alt); // Note the lane that is out-of-bounds.
assert_eq!(result, Simd::from_array([-5, 13, 10, -2]));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Reads from potentially discontiguous indices in slice
to construct a SIMD vector. The mask enable
s all true
lanes and disables all false
lanes. If an index is disabled, the lane is selected from the or
vector.
Calling this function with an enable
d out-of-bounds index is _undefined behavior_even if the resulting value is not used.
let vec: Vec<i32> = vec![10, 11, 12, 13, 14, 15, 16, 17, 18];
let idxs = Simd::from_array([9, 3, 0, 5]);
let alt = Simd::from_array([-5, -4, -3, -2]);
let enable = Mask::from_array([true, true, true, false]); // Note the final mask lane.
// If this mask was used to gather, it would be unsound. Let's fix that.
let enable = enable & idxs.lanes_lt(Simd::splat(vec.len()));
// We have masked the OOB lane, so it's safe to gather now.
let result = unsafe { Simd::gather_select_unchecked(&vec, enable, idxs, alt) };
assert_eq!(result, Simd::from_array([-5, 13, 10, -2]));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Writes the values in a SIMD vector to potentially discontiguous indices in slice
. If two lanes in the scattered vector would write to the same index only the last lane is guaranteed to actually be written.
let mut vec: Vec<i32> = vec![10, 11, 12, 13, 14, 15, 16, 17, 18];
let idxs = Simd::from_array([9, 3, 0, 0]);
let vals = Simd::from_array([-27, 82, -41, 124]);
vals.scatter(&mut vec, idxs); // index 0 receives two writes.
assert_eq!(vec, vec![124, 11, 12, 82, 14, 15, 16, 17, 18]);
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Writes the values in a SIMD vector to multiple potentially discontiguous indices in slice
. The mask enable
s all true
lanes and disables all false
lanes. If an enabled index is out-of-bounds, the lane is not written. If two enabled lanes in the scattered vector would write to the same index, only the last lane is guaranteed to actually be written.
let mut vec: Vec<i32> = vec![10, 11, 12, 13, 14, 15, 16, 17, 18];
let idxs = Simd::from_array([9, 3, 0, 0]);
let vals = Simd::from_array([-27, 82, -41, 124]);
let enable = Mask::from_array([true, true, true, false]); // Note the mask of the last lane.
vals.scatter_select(&mut vec, enable, idxs); // index 0's second write is masked, thus omitted.
assert_eq!(vec, vec![-41, 11, 12, 82, 14, 15, 16, 17, 18]);
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Writes the values in a SIMD vector to multiple potentially discontiguous indices in slice
. The mask enable
s all true
lanes and disables all false
lanes. If two enabled lanes in the scattered vector would write to the same index, only the last lane is guaranteed to actually be written.
Calling this function with an enabled out-of-bounds index is undefined behavior, and may lead to memory corruption.
let mut vec: Vec<i32> = vec![10, 11, 12, 13, 14, 15, 16, 17, 18];
let idxs = Simd::from_array([9, 3, 0, 0]);
let vals = Simd::from_array([-27, 82, -41, 124]);
let enable = Mask::from_array([true, true, true, false]); // Note the mask of the last lane.
// If this mask was used to scatter, it would be unsound. Let's fix that.
let enable = enable & idxs.lanes_lt(Simd::splat(vec.len()));
// We have masked the OOB lane, so it's safe to scatter now.
unsafe { vals.scatter_select_unchecked(&mut vec, enable, idxs); }
// index 0's second write is masked, thus was omitted.
assert_eq!(vec, vec![-41, 11, 12, 82, 14, 15, 16, 17, 18]);
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal wrapping add. Returns the sum of the lanes of the vector, with wrapping addition.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal wrapping multiply. Returns the product of the lanes of the vector, with wrapping multiplication.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal maximum. Returns the maximum lane in the vector.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal minimum. Returns the minimum lane in the vector.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal wrapping add. Returns the sum of the lanes of the vector, with wrapping addition.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal wrapping multiply. Returns the product of the lanes of the vector, with wrapping multiplication.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal maximum. Returns the maximum lane in the vector.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal minimum. Returns the minimum lane in the vector.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal wrapping add. Returns the sum of the lanes of the vector, with wrapping addition.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal wrapping multiply. Returns the product of the lanes of the vector, with wrapping multiplication.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal maximum. Returns the maximum lane in the vector.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal minimum. Returns the minimum lane in the vector.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal wrapping add. Returns the sum of the lanes of the vector, with wrapping addition.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal wrapping multiply. Returns the product of the lanes of the vector, with wrapping multiplication.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal maximum. Returns the maximum lane in the vector.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal minimum. Returns the minimum lane in the vector.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal wrapping add. Returns the sum of the lanes of the vector, with wrapping addition.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal wrapping multiply. Returns the product of the lanes of the vector, with wrapping multiplication.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal maximum. Returns the maximum lane in the vector.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal minimum. Returns the minimum lane in the vector.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal wrapping add. Returns the sum of the lanes of the vector, with wrapping addition.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal wrapping multiply. Returns the product of the lanes of the vector, with wrapping multiplication.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal maximum. Returns the maximum lane in the vector.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal minimum. Returns the minimum lane in the vector.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal wrapping add. Returns the sum of the lanes of the vector, with wrapping addition.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal wrapping multiply. Returns the product of the lanes of the vector, with wrapping multiplication.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal maximum. Returns the maximum lane in the vector.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal minimum. Returns the minimum lane in the vector.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal wrapping add. Returns the sum of the lanes of the vector, with wrapping addition.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal wrapping multiply. Returns the product of the lanes of the vector, with wrapping multiplication.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal maximum. Returns the maximum lane in the vector.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal minimum. Returns the minimum lane in the vector.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal wrapping add. Returns the sum of the lanes of the vector, with wrapping addition.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal wrapping multiply. Returns the product of the lanes of the vector, with wrapping multiplication.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal maximum. Returns the maximum lane in the vector.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal minimum. Returns the minimum lane in the vector.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal wrapping add. Returns the sum of the lanes of the vector, with wrapping addition.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal wrapping multiply. Returns the product of the lanes of the vector, with wrapping multiplication.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal maximum. Returns the maximum lane in the vector.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal minimum. Returns the minimum lane in the vector.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal add. Returns the sum of the lanes of the vector.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal multiply. Returns the product of the lanes of the vector.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal maximum. Returns the maximum lane in the vector.
Returns values based on equality, so a vector containing both 0.
and -0.
may return either. This function will not return NaN
unless all lanes are NaN
.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal minimum. Returns the minimum lane in the vector.
Returns values based on equality, so a vector containing both 0.
and -0.
may return either. This function will not return NaN
unless all lanes are NaN
.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal add. Returns the sum of the lanes of the vector.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal multiply. Returns the product of the lanes of the vector.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal maximum. Returns the maximum lane in the vector.
Returns values based on equality, so a vector containing both 0.
and -0.
may return either. This function will not return NaN
unless all lanes are NaN
.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Horizontal minimum. Returns the minimum lane in the vector.
Returns values based on equality, so a vector containing both 0.
and -0.
may return either. This function will not return NaN
unless all lanes are NaN
.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise saturating add.
let x = Simd::from_array([2, 1, 0, MAX]);
let max = Simd::splat(MAX);
let unsat = x + max;
let sat = x.saturating_add(max);
assert_eq!(unsat, Simd::from_array([1, 0, MAX, MAX - 1]));
assert_eq!(sat, max);
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise saturating subtract.
let x = Simd::from_array([2, 1, 0, MAX]);
let max = Simd::splat(MAX);
let unsat = x - max;
let sat = x.saturating_sub(max);
assert_eq!(unsat, Simd::from_array([3, 2, 1, 0]));
assert_eq!(sat, Simd::splat(0));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise saturating add.
let x = Simd::from_array([2, 1, 0, MAX]);
let max = Simd::splat(MAX);
let unsat = x + max;
let sat = x.saturating_add(max);
assert_eq!(unsat, Simd::from_array([1, 0, MAX, MAX - 1]));
assert_eq!(sat, max);
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise saturating subtract.
let x = Simd::from_array([2, 1, 0, MAX]);
let max = Simd::splat(MAX);
let unsat = x - max;
let sat = x.saturating_sub(max);
assert_eq!(unsat, Simd::from_array([3, 2, 1, 0]));
assert_eq!(sat, Simd::splat(0));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise saturating add.
let x = Simd::from_array([2, 1, 0, MAX]);
let max = Simd::splat(MAX);
let unsat = x + max;
let sat = x.saturating_add(max);
assert_eq!(unsat, Simd::from_array([1, 0, MAX, MAX - 1]));
assert_eq!(sat, max);
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise saturating subtract.
let x = Simd::from_array([2, 1, 0, MAX]);
let max = Simd::splat(MAX);
let unsat = x - max;
let sat = x.saturating_sub(max);
assert_eq!(unsat, Simd::from_array([3, 2, 1, 0]));
assert_eq!(sat, Simd::splat(0));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise saturating add.
let x = Simd::from_array([2, 1, 0, MAX]);
let max = Simd::splat(MAX);
let unsat = x + max;
let sat = x.saturating_add(max);
assert_eq!(unsat, Simd::from_array([1, 0, MAX, MAX - 1]));
assert_eq!(sat, max);
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise saturating subtract.
let x = Simd::from_array([2, 1, 0, MAX]);
let max = Simd::splat(MAX);
let unsat = x - max;
let sat = x.saturating_sub(max);
assert_eq!(unsat, Simd::from_array([3, 2, 1, 0]));
assert_eq!(sat, Simd::splat(0));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise saturating add.
let x = Simd::from_array([2, 1, 0, MAX]);
let max = Simd::splat(MAX);
let unsat = x + max;
let sat = x.saturating_add(max);
assert_eq!(unsat, Simd::from_array([1, 0, MAX, MAX - 1]));
assert_eq!(sat, max);
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise saturating subtract.
let x = Simd::from_array([2, 1, 0, MAX]);
let max = Simd::splat(MAX);
let unsat = x - max;
let sat = x.saturating_sub(max);
assert_eq!(unsat, Simd::from_array([3, 2, 1, 0]));
assert_eq!(sat, Simd::splat(0));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise saturating add.
let x = Simd::from_array([MIN, 0, 1, MAX]);
let max = Simd::splat(MAX);
let unsat = x + max;
let sat = x.saturating_add(max);
assert_eq!(unsat, Simd::from_array([-1, MAX, MIN, -2]));
assert_eq!(sat, Simd::from_array([-1, MAX, MAX, MAX]));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise saturating subtract.
let x = Simd::from_array([MIN, -2, -1, MAX]);
let max = Simd::splat(MAX);
let unsat = x - max;
let sat = x.saturating_sub(max);
assert_eq!(unsat, Simd::from_array([1, MAX, MIN, 0]));
assert_eq!(sat, Simd::from_array([MIN, MIN, MIN, 0]));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise absolute value, implemented in Rust. Every lane becomes its absolute value.
let xs = Simd::from_array([MIN, MIN +1, -5, 0]);
assert_eq!(xs.abs(), Simd::from_array([MIN, MAX, 5, 0]));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise saturating absolute value, implemented in Rust. As abs(), except the MIN value becomes MAX instead of itself.
let xs = Simd::from_array([MIN, -2, 0, 3]);
let unsat = xs.abs();
let sat = xs.saturating_abs();
assert_eq!(unsat, Simd::from_array([MIN, 2, 0, 3]));
assert_eq!(sat, Simd::from_array([MAX, 2, 0, 3]));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise saturating negation, implemented in Rust. As neg(), except the MIN value becomes MAX instead of itself.
let x = Simd::from_array([MIN, -2, 3, MAX]);
let unsat = -x;
let sat = x.saturating_neg();
assert_eq!(unsat, Simd::from_array([MIN, 2, -3, MIN + 1]));
assert_eq!(sat, Simd::from_array([MAX, 2, -3, MIN + 1]));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise saturating add.
let x = Simd::from_array([MIN, 0, 1, MAX]);
let max = Simd::splat(MAX);
let unsat = x + max;
let sat = x.saturating_add(max);
assert_eq!(unsat, Simd::from_array([-1, MAX, MIN, -2]));
assert_eq!(sat, Simd::from_array([-1, MAX, MAX, MAX]));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise saturating subtract.
let x = Simd::from_array([MIN, -2, -1, MAX]);
let max = Simd::splat(MAX);
let unsat = x - max;
let sat = x.saturating_sub(max);
assert_eq!(unsat, Simd::from_array([1, MAX, MIN, 0]));
assert_eq!(sat, Simd::from_array([MIN, MIN, MIN, 0]));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise absolute value, implemented in Rust. Every lane becomes its absolute value.
let xs = Simd::from_array([MIN, MIN +1, -5, 0]);
assert_eq!(xs.abs(), Simd::from_array([MIN, MAX, 5, 0]));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise saturating absolute value, implemented in Rust. As abs(), except the MIN value becomes MAX instead of itself.
let xs = Simd::from_array([MIN, -2, 0, 3]);
let unsat = xs.abs();
let sat = xs.saturating_abs();
assert_eq!(unsat, Simd::from_array([MIN, 2, 0, 3]));
assert_eq!(sat, Simd::from_array([MAX, 2, 0, 3]));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise saturating negation, implemented in Rust. As neg(), except the MIN value becomes MAX instead of itself.
let x = Simd::from_array([MIN, -2, 3, MAX]);
let unsat = -x;
let sat = x.saturating_neg();
assert_eq!(unsat, Simd::from_array([MIN, 2, -3, MIN + 1]));
assert_eq!(sat, Simd::from_array([MAX, 2, -3, MIN + 1]));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise saturating add.
let x = Simd::from_array([MIN, 0, 1, MAX]);
let max = Simd::splat(MAX);
let unsat = x + max;
let sat = x.saturating_add(max);
assert_eq!(unsat, Simd::from_array([-1, MAX, MIN, -2]));
assert_eq!(sat, Simd::from_array([-1, MAX, MAX, MAX]));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise saturating subtract.
let x = Simd::from_array([MIN, -2, -1, MAX]);
let max = Simd::splat(MAX);
let unsat = x - max;
let sat = x.saturating_sub(max);
assert_eq!(unsat, Simd::from_array([1, MAX, MIN, 0]));
assert_eq!(sat, Simd::from_array([MIN, MIN, MIN, 0]));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise absolute value, implemented in Rust. Every lane becomes its absolute value.
let xs = Simd::from_array([MIN, MIN +1, -5, 0]);
assert_eq!(xs.abs(), Simd::from_array([MIN, MAX, 5, 0]));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise saturating absolute value, implemented in Rust. As abs(), except the MIN value becomes MAX instead of itself.
let xs = Simd::from_array([MIN, -2, 0, 3]);
let unsat = xs.abs();
let sat = xs.saturating_abs();
assert_eq!(unsat, Simd::from_array([MIN, 2, 0, 3]));
assert_eq!(sat, Simd::from_array([MAX, 2, 0, 3]));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise saturating negation, implemented in Rust. As neg(), except the MIN value becomes MAX instead of itself.
let x = Simd::from_array([MIN, -2, 3, MAX]);
let unsat = -x;
let sat = x.saturating_neg();
assert_eq!(unsat, Simd::from_array([MIN, 2, -3, MIN + 1]));
assert_eq!(sat, Simd::from_array([MAX, 2, -3, MIN + 1]));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise saturating add.
let x = Simd::from_array([MIN, 0, 1, MAX]);
let max = Simd::splat(MAX);
let unsat = x + max;
let sat = x.saturating_add(max);
assert_eq!(unsat, Simd::from_array([-1, MAX, MIN, -2]));
assert_eq!(sat, Simd::from_array([-1, MAX, MAX, MAX]));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise saturating subtract.
let x = Simd::from_array([MIN, -2, -1, MAX]);
let max = Simd::splat(MAX);
let unsat = x - max;
let sat = x.saturating_sub(max);
assert_eq!(unsat, Simd::from_array([1, MAX, MIN, 0]));
assert_eq!(sat, Simd::from_array([MIN, MIN, MIN, 0]));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise absolute value, implemented in Rust. Every lane becomes its absolute value.
let xs = Simd::from_array([MIN, MIN +1, -5, 0]);
assert_eq!(xs.abs(), Simd::from_array([MIN, MAX, 5, 0]));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise saturating absolute value, implemented in Rust. As abs(), except the MIN value becomes MAX instead of itself.
let xs = Simd::from_array([MIN, -2, 0, 3]);
let unsat = xs.abs();
let sat = xs.saturating_abs();
assert_eq!(unsat, Simd::from_array([MIN, 2, 0, 3]));
assert_eq!(sat, Simd::from_array([MAX, 2, 0, 3]));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise saturating negation, implemented in Rust. As neg(), except the MIN value becomes MAX instead of itself.
let x = Simd::from_array([MIN, -2, 3, MAX]);
let unsat = -x;
let sat = x.saturating_neg();
assert_eq!(unsat, Simd::from_array([MIN, 2, -3, MIN + 1]));
assert_eq!(sat, Simd::from_array([MAX, 2, -3, MIN + 1]));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise saturating add.
let x = Simd::from_array([MIN, 0, 1, MAX]);
let max = Simd::splat(MAX);
let unsat = x + max;
let sat = x.saturating_add(max);
assert_eq!(unsat, Simd::from_array([-1, MAX, MIN, -2]));
assert_eq!(sat, Simd::from_array([-1, MAX, MAX, MAX]));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise saturating subtract.
let x = Simd::from_array([MIN, -2, -1, MAX]);
let max = Simd::splat(MAX);
let unsat = x - max;
let sat = x.saturating_sub(max);
assert_eq!(unsat, Simd::from_array([1, MAX, MIN, 0]));
assert_eq!(sat, Simd::from_array([MIN, MIN, MIN, 0]));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise absolute value, implemented in Rust. Every lane becomes its absolute value.
let xs = Simd::from_array([MIN, MIN +1, -5, 0]);
assert_eq!(xs.abs(), Simd::from_array([MIN, MAX, 5, 0]));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise saturating absolute value, implemented in Rust. As abs(), except the MIN value becomes MAX instead of itself.
let xs = Simd::from_array([MIN, -2, 0, 3]);
let unsat = xs.abs();
let sat = xs.saturating_abs();
assert_eq!(unsat, Simd::from_array([MIN, 2, 0, 3]));
assert_eq!(sat, Simd::from_array([MAX, 2, 0, 3]));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Lanewise saturating negation, implemented in Rust. As neg(), except the MIN value becomes MAX instead of itself.
let x = Simd::from_array([MIN, -2, 3, MAX]);
let unsat = -x;
let sat = x.saturating_neg();
assert_eq!(unsat, Simd::from_array([MIN, 2, -3, MIN + 1]));
assert_eq!(sat, Simd::from_array([MAX, 2, -3, MIN + 1]));
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Rounds toward zero and converts to the same-width integer type, assuming that the value is finite and fits in that type.
The value must:
- Not be NaN
- Not be infinite
- Be representable in the return type, after truncating off its fractional part
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Creates a floating-point vector from an integer vector. Rounds values that are not exactly representable.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Rounds toward zero and converts to the same-width integer type, assuming that the value is finite and fits in that type.
The value must:
- Not be NaN
- Not be infinite
- Be representable in the return type, after truncating off its fractional part
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Creates a floating-point vector from an integer vector. Rounds values that are not exactly representable.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Raw transmutation to an unsigned integer vector type with the same size and number of lanes.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Raw transmutation from an unsigned integer vector type with the same size and number of lanes.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Produces a vector where every lane has the absolute value of the equivalently-indexed lane in self
.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Takes the reciprocal (inverse) of each lane, 1/x
.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Converts each lane from radians to degrees.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Converts each lane from degrees to radians.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns true for each lane if it has a positive sign, including+0.0
, NaN
s with positive sign bit and positive infinity.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns true for each lane if it has a negative sign, including-0.0
, NaN
s with negative sign bit and negative infinity.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns true for each lane if its value is NaN
.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns true for each lane if its value is positive infinity or negative infinity.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns true for each lane if its value is neither infinite nor NaN
.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns true for each lane if its value is subnormal.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns true for each lane if its value is neither neither zero, infinite, subnormal, or NaN
.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Replaces each lane with a number that represents its sign.
1.0
if the number is positive,+0.0
, orINFINITY
-1.0
if the number is negative,-0.0
, orNEG_INFINITY
NAN
if the number isNAN
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns each lane with the magnitude of self
and the sign of sign
.
If any lane is a NAN
, then a NAN
with the sign of sign
is returned.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns the minimum of each lane.
If one of the values is NAN
, then the other value is returned.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns the maximum of each lane.
If one of the values is NAN
, then the other value is returned.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Restrict each lane to a certain interval unless it is NaN.
For each lane in self
, returns the corresponding lane in max
if the lane is greater than max
, and the corresponding lane in min
if the lane is less than min
. Otherwise returns the lane in self
.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Raw transmutation to an unsigned integer vector type with the same size and number of lanes.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Raw transmutation from an unsigned integer vector type with the same size and number of lanes.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Produces a vector where every lane has the absolute value of the equivalently-indexed lane in self
.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Takes the reciprocal (inverse) of each lane, 1/x
.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Converts each lane from radians to degrees.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Converts each lane from degrees to radians.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns true for each lane if it has a positive sign, including+0.0
, NaN
s with positive sign bit and positive infinity.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns true for each lane if it has a negative sign, including-0.0
, NaN
s with negative sign bit and negative infinity.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns true for each lane if its value is NaN
.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns true for each lane if its value is positive infinity or negative infinity.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns true for each lane if its value is neither infinite nor NaN
.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns true for each lane if its value is subnormal.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns true for each lane if its value is neither neither zero, infinite, subnormal, or NaN
.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Replaces each lane with a number that represents its sign.
1.0
if the number is positive,+0.0
, orINFINITY
-1.0
if the number is negative,-0.0
, orNEG_INFINITY
NAN
if the number isNAN
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns each lane with the magnitude of self
and the sign of sign
.
If any lane is a NAN
, then a NAN
with the sign of sign
is returned.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns the minimum of each lane.
If one of the values is NAN
, then the other value is returned.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns the maximum of each lane.
If one of the values is NAN
, then the other value is returned.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Restrict each lane to a certain interval unless it is NaN.
For each lane in self
, returns the corresponding lane in max
if the lane is greater than max
, and the corresponding lane in min
if the lane is less than min
. Otherwise returns the lane in self
.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns true for each positive lane and false if it is zero or negative.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns true for each negative lane and false if it is zero or positive.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns numbers representing the sign of each lane.
0
if the number is zero1
if the number is positive-1
if the number is negative
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns true for each positive lane and false if it is zero or negative.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns true for each negative lane and false if it is zero or positive.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns numbers representing the sign of each lane.
0
if the number is zero1
if the number is positive-1
if the number is negative
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns true for each positive lane and false if it is zero or negative.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns true for each negative lane and false if it is zero or positive.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns numbers representing the sign of each lane.
0
if the number is zero1
if the number is positive-1
if the number is negative
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns true for each positive lane and false if it is zero or negative.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns true for each negative lane and false if it is zero or positive.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns numbers representing the sign of each lane.
0
if the number is zero1
if the number is positive-1
if the number is negative
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns true for each positive lane and false if it is zero or negative.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns true for each negative lane and false if it is zero or positive.
🔬 This is a nightly-only experimental API. (portable_simd
#86656)
Returns numbers representing the sign of each lane.
0
if the number is zero1
if the number is positive-1
if the number is negative
impl<'_, T, const LANES: usize> Add<&'_ Simd<T, LANES>> for Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: Add<Simd<T, LANES>>,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as Add<Simd<T, LANES>>>::Output == Simd<T, LANES>,
The resulting type after applying the +
operator.
impl<'lhs, 'rhs, T, const LANES: usize> Add<&'rhs Simd<T, LANES>> for &'lhs Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: Add<Simd<T, LANES>>,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as Add<Simd<T, LANES>>>::Output == Simd<T, LANES>,
The resulting type after applying the +
operator.
impl<'_, T, const LANES: usize> Add<Simd<T, LANES>> for &'_ Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: Add<Simd<T, LANES>>,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as Add<Simd<T, LANES>>>::Output == Simd<T, LANES>,
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
impl<T, U, const LANES: usize> AddAssign for Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: Add,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as Add>::Output == Simd<T, LANES>,
Formats the value using the given formatter.
impl<'_, T, const LANES: usize> BitAnd<&'_ Simd<T, LANES>> for Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: BitAnd<Simd<T, LANES>>,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as BitAnd<Simd<T, LANES>>>::Output == Simd<T, LANES>,
The resulting type after applying the &
operator.
impl<'lhs, 'rhs, T, const LANES: usize> BitAnd<&'rhs Simd<T, LANES>> for &'lhs Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: BitAnd<Simd<T, LANES>>,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as BitAnd<Simd<T, LANES>>>::Output == Simd<T, LANES>,
The resulting type after applying the &
operator.
impl<'_, T, const LANES: usize> BitAnd<Simd<T, LANES>> for &'_ Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: BitAnd<Simd<T, LANES>>,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as BitAnd<Simd<T, LANES>>>::Output == Simd<T, LANES>,
The resulting type after applying the &
operator.
The resulting type after applying the &
operator.
The resulting type after applying the &
operator.
The resulting type after applying the &
operator.
The resulting type after applying the &
operator.
The resulting type after applying the &
operator.
The resulting type after applying the &
operator.
The resulting type after applying the &
operator.
The resulting type after applying the &
operator.
The resulting type after applying the &
operator.
The resulting type after applying the &
operator.
impl<T, U, const LANES: usize> BitAndAssign for Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: BitAnd,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as BitAnd>::Output == Simd<T, LANES>,
impl<'_, T, const LANES: usize> BitOr<&'_ Simd<T, LANES>> for Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: BitOr<Simd<T, LANES>>,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as BitOr<Simd<T, LANES>>>::Output == Simd<T, LANES>,
The resulting type after applying the |
operator.
impl<'lhs, 'rhs, T, const LANES: usize> BitOr<&'rhs Simd<T, LANES>> for &'lhs Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: BitOr<Simd<T, LANES>>,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as BitOr<Simd<T, LANES>>>::Output == Simd<T, LANES>,
The resulting type after applying the |
operator.
impl<'_, T, const LANES: usize> BitOr<Simd<T, LANES>> for &'_ Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: BitOr<Simd<T, LANES>>,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as BitOr<Simd<T, LANES>>>::Output == Simd<T, LANES>,
The resulting type after applying the |
operator.
The resulting type after applying the |
operator.
The resulting type after applying the |
operator.
The resulting type after applying the |
operator.
The resulting type after applying the |
operator.
The resulting type after applying the |
operator.
The resulting type after applying the |
operator.
The resulting type after applying the |
operator.
The resulting type after applying the |
operator.
The resulting type after applying the |
operator.
The resulting type after applying the |
operator.
impl<T, U, const LANES: usize> BitOrAssign for Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: BitOr,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as BitOr>::Output == Simd<T, LANES>,
impl<'_, T, const LANES: usize> BitXor<&'_ Simd<T, LANES>> for Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: BitXor<Simd<T, LANES>>,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as BitXor<Simd<T, LANES>>>::Output == Simd<T, LANES>,
The resulting type after applying the ^
operator.
impl<'lhs, 'rhs, T, const LANES: usize> BitXor<&'rhs Simd<T, LANES>> for &'lhs Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: BitXor<Simd<T, LANES>>,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as BitXor<Simd<T, LANES>>>::Output == Simd<T, LANES>,
The resulting type after applying the ^
operator.
impl<'_, T, const LANES: usize> BitXor<Simd<T, LANES>> for &'_ Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: BitXor<Simd<T, LANES>>,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as BitXor<Simd<T, LANES>>>::Output == Simd<T, LANES>,
The resulting type after applying the ^
operator.
The resulting type after applying the ^
operator.
The resulting type after applying the ^
operator.
The resulting type after applying the ^
operator.
The resulting type after applying the ^
operator.
The resulting type after applying the ^
operator.
The resulting type after applying the ^
operator.
The resulting type after applying the ^
operator.
The resulting type after applying the ^
operator.
The resulting type after applying the ^
operator.
The resulting type after applying the ^
operator.
impl<T, U, const LANES: usize> BitXorAssign for Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: BitXor,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as BitXor>::Output == Simd<T, LANES>,
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
impl<'_, T, const LANES: usize> Div<&'_ Simd<T, LANES>> for Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: Div<Simd<T, LANES>>,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as Div<Simd<T, LANES>>>::Output == Simd<T, LANES>,
The resulting type after applying the /
operator.
impl<'lhs, 'rhs, T, const LANES: usize> Div<&'rhs Simd<T, LANES>> for &'lhs Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: Div<Simd<T, LANES>>,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as Div<Simd<T, LANES>>>::Output == Simd<T, LANES>,
The resulting type after applying the /
operator.
impl<'_, T, const LANES: usize> Div<Simd<T, LANES>> for &'_ Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: Div<Simd<T, LANES>>,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as Div<Simd<T, LANES>>>::Output == Simd<T, LANES>,
The resulting type after applying the /
operator.
The resulting type after applying the /
operator.
The resulting type after applying the /
operator.
The resulting type after applying the /
operator.
The resulting type after applying the /
operator.
The resulting type after applying the /
operator.
The resulting type after applying the /
operator.
The resulting type after applying the /
operator.
The resulting type after applying the /
operator.
The resulting type after applying the /
operator.
The resulting type after applying the /
operator.
The resulting type after applying the /
operator.
The resulting type after applying the /
operator.
impl<T, U, const LANES: usize> DivAssign for Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: Div,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as Div>::Output == Simd<T, LANES>,
The returned type after indexing.
Performs the indexing (container[index]
) operation. Read more
Performs the mutable indexing (container[index]
) operation. Read more
Formats the value using the given formatter.
Formats the value using the given formatter.
impl<'_, T, const LANES: usize> Mul<&'_ Simd<T, LANES>> for Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: Mul<Simd<T, LANES>>,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as Mul<Simd<T, LANES>>>::Output == Simd<T, LANES>,
The resulting type after applying the *
operator.
impl<'lhs, 'rhs, T, const LANES: usize> Mul<&'rhs Simd<T, LANES>> for &'lhs Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: Mul<Simd<T, LANES>>,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as Mul<Simd<T, LANES>>>::Output == Simd<T, LANES>,
The resulting type after applying the *
operator.
impl<'_, T, const LANES: usize> Mul<Simd<T, LANES>> for &'_ Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: Mul<Simd<T, LANES>>,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as Mul<Simd<T, LANES>>>::Output == Simd<T, LANES>,
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
impl<T, U, const LANES: usize> MulAssign for Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: Mul,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as Mul>::Output == Simd<T, LANES>,
The resulting type after applying the -
operator.
Performs the unary -
operation. Read more
The resulting type after applying the -
operator.
Performs the unary -
operation. Read more
The resulting type after applying the -
operator.
Performs the unary -
operation. Read more
The resulting type after applying the -
operator.
Performs the unary -
operation. Read more
The resulting type after applying the -
operator.
Performs the unary -
operation. Read more
The resulting type after applying the -
operator.
Performs the unary -
operation. Read more
The resulting type after applying the -
operator.
Performs the unary -
operation. Read more
The resulting type after applying the !
operator.
Performs the unary !
operation. Read more
The resulting type after applying the !
operator.
Performs the unary !
operation. Read more
The resulting type after applying the !
operator.
Performs the unary !
operation. Read more
The resulting type after applying the !
operator.
Performs the unary !
operation. Read more
The resulting type after applying the !
operator.
Performs the unary !
operation. Read more
The resulting type after applying the !
operator.
Performs the unary !
operation. Read more
The resulting type after applying the !
operator.
Performs the unary !
operation. Read more
The resulting type after applying the !
operator.
Performs the unary !
operation. Read more
The resulting type after applying the !
operator.
Performs the unary !
operation. Read more
The resulting type after applying the !
operator.
Performs the unary !
operation. Read more
Formats the value using the given formatter.
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
Restrict a value to a certain interval. Read more
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
Method which takes an iterator and generates Self
from the elements by multiplying the items. Read more
Method which takes an iterator and generates Self
from the elements by multiplying the items. Read more
Method which takes an iterator and generates Self
from the elements by multiplying the items. Read more
Method which takes an iterator and generates Self
from the elements by multiplying the items. Read more
Method which takes an iterator and generates Self
from the elements by multiplying the items. Read more
Method which takes an iterator and generates Self
from the elements by multiplying the items. Read more
Method which takes an iterator and generates Self
from the elements by multiplying the items. Read more
Method which takes an iterator and generates Self
from the elements by multiplying the items. Read more
Method which takes an iterator and generates Self
from the elements by multiplying the items. Read more
Method which takes an iterator and generates Self
from the elements by multiplying the items. Read more
Method which takes an iterator and generates Self
from the elements by multiplying the items. Read more
Method which takes an iterator and generates Self
from the elements by multiplying the items. Read more
Method which takes an iterator and generates Self
from the elements by multiplying the items. Read more
Method which takes an iterator and generates Self
from the elements by multiplying the items. Read more
Method which takes an iterator and generates Self
from the elements by multiplying the items. Read more
Method which takes an iterator and generates Self
from the elements by multiplying the items. Read more
Method which takes an iterator and generates Self
from the elements by multiplying the items. Read more
Method which takes an iterator and generates Self
from the elements by multiplying the items. Read more
Method which takes an iterator and generates Self
from the elements by multiplying the items. Read more
Method which takes an iterator and generates Self
from the elements by multiplying the items. Read more
Method which takes an iterator and generates Self
from the elements by multiplying the items. Read more
Method which takes an iterator and generates Self
from the elements by multiplying the items. Read more
Method which takes an iterator and generates Self
from the elements by multiplying the items. Read more
Method which takes an iterator and generates Self
from the elements by multiplying the items. Read more
impl<'_, T, const LANES: usize> Rem<&'_ Simd<T, LANES>> for Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: Rem<Simd<T, LANES>>,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as Rem<Simd<T, LANES>>>::Output == Simd<T, LANES>,
The resulting type after applying the %
operator.
impl<'lhs, 'rhs, T, const LANES: usize> Rem<&'rhs Simd<T, LANES>> for &'lhs Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: Rem<Simd<T, LANES>>,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as Rem<Simd<T, LANES>>>::Output == Simd<T, LANES>,
The resulting type after applying the %
operator.
impl<'_, T, const LANES: usize> Rem<Simd<T, LANES>> for &'_ Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: Rem<Simd<T, LANES>>,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as Rem<Simd<T, LANES>>>::Output == Simd<T, LANES>,
The resulting type after applying the %
operator.
The resulting type after applying the %
operator.
The resulting type after applying the %
operator.
The resulting type after applying the %
operator.
The resulting type after applying the %
operator.
The resulting type after applying the %
operator.
The resulting type after applying the %
operator.
The resulting type after applying the %
operator.
The resulting type after applying the %
operator.
The resulting type after applying the %
operator.
The resulting type after applying the %
operator.
The resulting type after applying the %
operator.
The resulting type after applying the %
operator.
impl<T, U, const LANES: usize> RemAssign for Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: Rem,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as Rem>::Output == Simd<T, LANES>,
impl<'_, T, const LANES: usize> Shl<&'_ Simd<T, LANES>> for Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: Shl<Simd<T, LANES>>,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as Shl<Simd<T, LANES>>>::Output == Simd<T, LANES>,
The resulting type after applying the <<
operator.
impl<'lhs, 'rhs, T, const LANES: usize> Shl<&'rhs Simd<T, LANES>> for &'lhs Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: Shl<Simd<T, LANES>>,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as Shl<Simd<T, LANES>>>::Output == Simd<T, LANES>,
The resulting type after applying the <<
operator.
impl<'_, T, const LANES: usize> Shl<Simd<T, LANES>> for &'_ Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: Shl<Simd<T, LANES>>,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as Shl<Simd<T, LANES>>>::Output == Simd<T, LANES>,
The resulting type after applying the <<
operator.
The resulting type after applying the <<
operator.
The resulting type after applying the <<
operator.
The resulting type after applying the <<
operator.
The resulting type after applying the <<
operator.
The resulting type after applying the <<
operator.
The resulting type after applying the <<
operator.
The resulting type after applying the <<
operator.
The resulting type after applying the <<
operator.
The resulting type after applying the <<
operator.
The resulting type after applying the <<
operator.
impl<T, U, const LANES: usize> ShlAssign for Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: Shl,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as Shl>::Output == Simd<T, LANES>,
impl<'_, T, const LANES: usize> Shr<&'_ Simd<T, LANES>> for Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: Shr<Simd<T, LANES>>,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as Shr<Simd<T, LANES>>>::Output == Simd<T, LANES>,
The resulting type after applying the >>
operator.
impl<'lhs, 'rhs, T, const LANES: usize> Shr<&'rhs Simd<T, LANES>> for &'lhs Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: Shr<Simd<T, LANES>>,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as Shr<Simd<T, LANES>>>::Output == Simd<T, LANES>,
The resulting type after applying the >>
operator.
impl<'_, T, const LANES: usize> Shr<Simd<T, LANES>> for &'_ Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: Shr<Simd<T, LANES>>,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as Shr<Simd<T, LANES>>>::Output == Simd<T, LANES>,
The resulting type after applying the >>
operator.
The resulting type after applying the >>
operator.
The resulting type after applying the >>
operator.
The resulting type after applying the >>
operator.
The resulting type after applying the >>
operator.
The resulting type after applying the >>
operator.
The resulting type after applying the >>
operator.
The resulting type after applying the >>
operator.
The resulting type after applying the >>
operator.
The resulting type after applying the >>
operator.
The resulting type after applying the >>
operator.
impl<T, U, const LANES: usize> ShrAssign for Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: Shr,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as Shr>::Output == Simd<T, LANES>,
impl<'_, T, const LANES: usize> Sub<&'_ Simd<T, LANES>> for Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: Sub<Simd<T, LANES>>,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as Sub<Simd<T, LANES>>>::Output == Simd<T, LANES>,
The resulting type after applying the -
operator.
impl<'lhs, 'rhs, T, const LANES: usize> Sub<&'rhs Simd<T, LANES>> for &'lhs Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: Sub<Simd<T, LANES>>,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as Sub<Simd<T, LANES>>>::Output == Simd<T, LANES>,
The resulting type after applying the -
operator.
impl<'_, T, const LANES: usize> Sub<Simd<T, LANES>> for &'_ Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: Sub<Simd<T, LANES>>,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as Sub<Simd<T, LANES>>>::Output == Simd<T, LANES>,
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
impl<T, U, const LANES: usize> SubAssign for Simd<T, LANES> where
T: SimdElement,
Simd<T, LANES>: Sub,
LaneCount: SupportedLaneCount,
<Simd<T, LANES> as Sub>::Output == Simd<T, LANES>,
Method which takes an iterator and generates Self
from the elements by “summing up” the items. Read more
Method which takes an iterator and generates Self
from the elements by “summing up” the items. Read more
Method which takes an iterator and generates Self
from the elements by “summing up” the items. Read more
Method which takes an iterator and generates Self
from the elements by “summing up” the items. Read more
Method which takes an iterator and generates Self
from the elements by “summing up” the items. Read more
Method which takes an iterator and generates Self
from the elements by “summing up” the items. Read more
Method which takes an iterator and generates Self
from the elements by “summing up” the items. Read more
Method which takes an iterator and generates Self
from the elements by “summing up” the items. Read more
Method which takes an iterator and generates Self
from the elements by “summing up” the items. Read more
Method which takes an iterator and generates Self
from the elements by “summing up” the items. Read more
Method which takes an iterator and generates Self
from the elements by “summing up” the items. Read more
Method which takes an iterator and generates Self
from the elements by “summing up” the items. Read more
Method which takes an iterator and generates Self
from the elements by “summing up” the items. Read more
Method which takes an iterator and generates Self
from the elements by “summing up” the items. Read more
Method which takes an iterator and generates Self
from the elements by “summing up” the items. Read more
Method which takes an iterator and generates Self
from the elements by “summing up” the items. Read more
Method which takes an iterator and generates Self
from the elements by “summing up” the items. Read more
Method which takes an iterator and generates Self
from the elements by “summing up” the items. Read more
Method which takes an iterator and generates Self
from the elements by “summing up” the items. Read more
Method which takes an iterator and generates Self
from the elements by “summing up” the items. Read more
Method which takes an iterator and generates Self
from the elements by “summing up” the items. Read more
Method which takes an iterator and generates Self
from the elements by “summing up” the items. Read more
Method which takes an iterator and generates Self
from the elements by “summing up” the items. Read more
Method which takes an iterator and generates Self
from the elements by “summing up” the items. Read more
Formats the value using the given formatter.
Formats the value using the given formatter.
impl Any for T where
T: 'static + ?Sized,
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
impl From for T
impl<T, U> Into for T where
U: From,
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
#41263)
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.