[−][src]Function safe_arch::blend_varying_i8_m256i
#[must_use]pub fn blend_varying_i8_m256i(a: m256i, b: m256i, mask: m256i) -> m256i
This is supported with target feature
avx2
only.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_avg_epu16
- Assembly:
vpavgw ymm, ymm, ymm