[][src]Macro lokacore::shuffle128

macro_rules! shuffle128 {
    ($a:expr, $b:expr, [$i0a:literal,$i1a:literal,$i2b:literal,$i3b:literal]) => { ... };
}

Shuffles around some f32 lanes into a new m128

This is a macro and not a function because the shuffle pattern must be a compile time constant. The macro takes some requested indexes and then makes the correct shuffle pattern constant for you.

  • $a and $b are any m128 expressions.
  • $i0a, $i1a, $i2b, and $i3b must each be 0, 1, 2, or 3. Technically any u32 literal will work, but only the lowest two bits are used so stick to 0, 1, 2, or 3.
  • Each lane in the output uses one of the lanes from an input. Like the names hint, indexes 0 and 1 will come from somewhere in $a, and indexes 2 and 3 will come from somewhere in $b.
shuffle128!(a, b, [0, 2, 1, 3])

Would give an output of: a[0], a[2], b[1], b[3]