Function blend_varying_i8_m256i
pub fn blend_varying_i8_m256i(a: m256i, b: m256i, mask: m256i) -> m256i
Available on crate feature
dep_safe_arch
only.Expand description
Blend i8
lanes according to a runtime varying mask.
- Mask lanes should be non-negative for
a
and negative forb
.
let a = m256i::from([5_i8; 32]);
let b = m256i::from([10_i8; 32]);
let mask = m256i::from([
0_i8, 0, 0, -1, -1, -1, 0, 0, 0, -1, -1, -1, 0, 0, 0, -1, -1, -1, 0, 0, 0, -1, -1, -1, 0, 0, 0,
-1, -1, -1, 0, 0,
]);
let c: [i8; 32] = blend_varying_i8_m256i(a, b, mask).into();
assert_eq!(
c,
[
5, 5, 5, 10, 10, 10, 5, 5, 5, 10, 10, 10, 5, 5, 5, 10, 10, 10, 5, 5, 5, 10, 10, 10, 5, 5, 5,
10, 10, 10, 5, 5
]
);
- Intrinsic:
_mm256_blendv_epi8
- Assembly:
vpavgw ymm, ymm, ymm