[−][src]Function safe_arch::blend_varying_m256
#[must_use]pub fn blend_varying_m256(a: m256, b: m256, mask: m256) -> m256
This is supported with target feature
avx
only.Blend the lanes according to a runtime varying mask.
The sign bit of each lane in the mask
value determines if the output
lane uses a
(mask non-negative) or b
(mask negative).
let a = m256::from_array([0.0, 1.0, 2.0, 3.0, 8.0, 9.0, 10.0, 11.0]); let b = m256::from_array([4.0, 5.0, 6.0, 7.0, -4.0, -5.0, -6.0, -7.0]); let mask = m256::from_array([-1.0, 0.0, -1.0, 0.0, -1.0, -1.0, 0.0, 0.0]); let c = blend_varying_m256(a, b, mask).to_array(); assert_eq!(c, [4.0, 1.0, 6.0, 3.0, -4.0, -5.0, 10.0, 11.0]);