Skip to content

Commit 911c637

Browse files
committed
simd intrinsics: add simd_shuffle_generic
1 parent ef1b78e commit 911c637

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

library/core/src/intrinsics/simd.rs

+14-3
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,25 @@ extern "platform-intrinsic" {
190190
///
191191
/// `T` must be a vector.
192192
///
193-
/// `U` must be a const array of `i32`s.
193+
/// `U` must be a **const** array of `i32`s. This means it msut either refer to a named
194+
/// const or be given as an inline const expression (`const { ... }`).
194195
///
195196
/// `V` must be a vector with the same element type as `T` and the same length as `U`.
196197
///
197-
/// Concatenates `x` and `y`, then returns a new vector such that each element is selected from
198-
/// the concatenation by the matching index in `idx`.
198+
/// Returns a new vector such that element `i` is selected from `xy[idx[i]]`, where `xy`
199+
/// is the concatenation of `x` and `y`.
199200
pub fn simd_shuffle<T, U, V>(x: T, y: T, idx: U) -> V;
200201

202+
/// Shuffle two vectors by const indices.
203+
///
204+
/// `T` must be a vector.
205+
///
206+
/// `V` must be a vector with the same element type as `T` and the same length as `IDX`.
207+
///
208+
/// Returns a new vector such that element `i` is selected from `xy[idx[i]]`, where `xy`
209+
/// is the concatenation of `x` and `y`.
210+
pub fn simd_shuffle_generic<T, U, const IDX: &'static [u32]>(x: T, y: T) -> U;
211+
201212
/// Read a vector of pointers.
202213
///
203214
/// `T` must be a vector.

0 commit comments

Comments
 (0)