Function safe_arch::blend_imm_i32_m128i

source ยท
pub fn blend_imm_i32_m128i<const IMM: i32>(a: m128i, b: m128i) -> m128i
Available with target feature avx2 only.
Expand description

Blends the i32 lanes in a and b into a single value.

  • The blend is controlled by an immediate mask value (an i32).
  • For each lane 0..=3, use 0 if you want that lane of the output to be from a and use 1 if you want that lane of the output to be from b.
let a = m128i::from([10, 20, 30, 40]);
let b = m128i::from([100, 200, 300, 400]);
//
let c: [i32; 4] = blend_imm_i32_m128i::<0b0110>(a, b).into();
assert_eq!(c, [10, 200, 300, 40]);