Function safe_arch::shuffle_av_i8z_half_m256i

source ยท
pub fn shuffle_av_i8z_half_m256i(a: m256i, v: m256i) -> m256i
Available with target feature avx2 only.
Expand description

Shuffle i8 lanes in a using i8 values in v.

Each lane selection value picks only within that 128-bit half of the overall register.

If a lane in v is negative, that output is zeroed.

let a = m256i::from([
  3_i8, 11, 2, 13, 4, 15, 6, 17, 8, 19, 20, 21, 22, 23, 24, 127, 7, 11, 2, 13, 4, 15, 6, 17, 8,
  19, 20, 21, 22, 23, 24, 127,
]);
let b = m256i::from([
  -1_i8, 1, 0, 2, 2, 3, 4, 5, 6, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 12, 11, 10, 9,
  8, 7, 6, 5, 4,
]);
let c: [i8; 32] = shuffle_av_i8z_half_m256i(a, b).into();
assert_eq!(
  c,
  [
    0, 11, 3, 2, 2, 13, 4, 15, 6, 6, 17, 8, 8, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 22, 21,
    20, 19, 8, 17, 6, 15, 4
  ]
);