Function safe_arch::add_saturating_u16_m128i
source ยท pub fn add_saturating_u16_m128i(a: m128i, b: m128i) -> m128i
Available with target feature
sse2
only.Expand description
Lanewise saturating a + b
with lanes as u16
.
let a = m128i::from([u16::MAX, 0, 3, 4, 1, 2, 3, 4]);
let b = m128i::from([u16::MAX, 0, 7, 8, 15, 26, 37, 48]);
let c: [u16; 8] = add_saturating_u16_m128i(a, b).into();
assert_eq!(c, [u16::MAX, 0, 10, 12, 16, 28, 40, 52]);