Skip to content

Commit

Permalink
docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lokathor committed Jun 30, 2024
1 parent aefef6f commit 714194c
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/i8x16_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -696,10 +696,11 @@ impl i8x16 {
}
}

/// Returns a new vector with lanes selected from the lanes of the first input vector
/// a specified in the second input vector `rhs`.
/// The indices i in range [0, 15] select the i-th element of `self`. For indices
/// outside of the range the resulting lane is 0.
/// Returns a new vector where each element is based on the index values in
/// `rhs`.
///
/// * Index values in the range [0, 15] select the i-th element of `self`.
/// * Index values that are out of range will cause that output lane to be 0.
#[inline]
pub fn swizzle(self, rhs: i8x16) -> i8x16 {
pick! {
Expand All @@ -726,10 +727,13 @@ impl i8x16 {
}
}

/// Indices in the range [0,15] will select the i-th element of `self`. If the high bit
/// of any element of `rhs` is set (negative) then the corresponding output
/// lane is guaranteed to be zero. Otherwise if the element of `rhs` is within the range [16,127]
/// then the output lane is either 0 or self[rhs[i] % 16] depending on the implementation.
/// Works like [swizzle](Self::swizzle) with the following additional details
///
/// * Indices in the range [0,15] will select the i-th element of `self`.
/// * If the high bit of any index is set (meaning that the index is
/// negative), then the corresponding output lane is guaranteed to be zero.
/// * Otherwise the output lane is either `0` or `self[rhs[i] % 16]`,
/// depending on the implementation.
#[inline]
pub fn swizzle_relaxed(self, rhs: i8x16) -> i8x16 {
pick! {
Expand Down

0 comments on commit 714194c

Please sign in to comment.