Function safe_arch::add_saturating_i8_m128i
source · pub fn add_saturating_i8_m128i(a: m128i, b: m128i) -> m128i
Expand description
Lanewise saturating a + b
with lanes as i8
.
let a = m128i::from([
i8::MAX, i8::MIN, 3, 4, -1, -2, -3, -4,
3, 4, -1, -2, -1, -2, -3, -4,
]);
let b = m128i::from([
i8::MAX, i8::MIN, 7, 8, -15, -26, -37, 48,
7, 8, -15, -26, -15, -26, -37, 48,
]);
let c: [i8; 16] = add_saturating_i8_m128i(a, b).into();
assert_eq!(
c,
[
i8::MAX, i8::MIN, 10, 12, -16, -28, -40, 44,
10, 12, -16, -28, -16, -28, -40, 44
]
);