Function safe_arch::blend_varying_i8_m128i
source · pub fn blend_varying_i8_m128i(a: m128i, b: m128i, mask: m128i) -> m128i
Expand description
Blend the i8
lanes according to a runtime varying mask.
The sign bit of each i8
lane in the mask
value determines if the output
lane uses a
(mask non-negative) or b
(mask negative).
let a =
m128i::from([0_i8, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]);
let b = m128i::from([
0_i8, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15,
]);
let mask =
m128i::from([0_i8, -1, -1, 0, 0, 0, -1, -1, -1, 0, 0, 0, -1, -1, -1, 0]);
let c: [i8; 16] = blend_varying_i8_m128i(a, b, mask).into();
assert_eq!(c, [0, -1, -2, 3, 4, 5, -6, -7, -8, 9, 10, 11, -12, -13, -14, 15]);