Skip to content

Commit 67fea6e

Browse files
committed
Type-level integer/values alternatives for shuffles.
1 parent 135ba7d commit 67fea6e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

text/0000-simd-infrastructure.md

+11
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,17 @@ cfg_if_else! {
390390
compiler can know this. The `repr(simd)` approach means there may be
391391
more than one SIMD-vector type with the `Simd8<u32>` shape (or, in
392392
fact, there may be zero).
393+
- With type-level integers, there could be one shuffle intrinsic:
394+
395+
fn simd_shuffle<T, U, const N: usize>(x: T, y: T, idx: [u32; N]) -> U;
396+
397+
NB. It is possible to add this as an additional intrinsic (possibly
398+
deprecating the `simd_shuffleNNN` forms) later.
399+
- Type-level values can be applied more generally: since the shuffle
400+
indices have to be compile time constants, the shuffle could be
401+
402+
fn simd_shuffle<T, U, const N: usize, const IDX: [u32; N]>(x: T, y: T) -> U;
403+
393404
- Instead of platform detection, there could be feature detection
394405
(e.g. "platform supports something equivalent to x86's `DPPS`"), but
395406
there probably aren't enough cross-platform commonalities for this

0 commit comments

Comments
 (0)