Function safe_arch::average_u8_m128i
source ยท pub fn average_u8_m128i(a: m128i, b: m128i) -> m128i
Available with target feature
sse2
only.Expand description
Lanewise average of the u8
values.
let a = m128i::from([
u8::MAX, 0, 3, 4, 254, 2, 3, 4,
3, 4, 1, 2, 1, 2, 128, 4,
]);
let b = m128i::from([
u8::MAX, 0, 7, 8, 15, 26, 37, 48,
7, 8, 15, 26, 15, 26, 37, 48,
]);
let c: [u8; 16] = average_u8_m128i(a, b).into();
assert_eq!(
c,
[
u8::MAX, 0, 5, 6, 135, 14, 20, 26,
5, 6, 8, 14, 8, 14, 83, 26
]
);