[−][src]Function safe_arch::sum_of_u8_abs_diff_m256i
#[must_use]pub fn sum_of_u8_abs_diff_m256i(a: m256i, b: m256i) -> m256i
This is supported with target feature
avx2
only.Compute "sum of u8
absolute differences".
u8
lanewiseabs(a - b)
, producingu8
intermediate values.- Sum the first eight and second eight values.
- Place into the low 16 bits of four
u64
lanes.
let a = m256i::from([ 0_u8, 11, 2, 13, 4, 15, 6, 17, 8, 19, 20, 21, 22, 23, 24, 127, 0, 11, 2, 13, 4, 15, 6, 17, 8, 19, 20, 21, 22, 23, 24, 127, ]); let b = m256i::from([ 20_u8, 110, 250, 103, 34, 105, 60, 217, 8, 19, 210, 201, 202, 203, 204, 127, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, ]); let c: [u64; 4] = sum_of_u8_abs_diff_m256i(a, b).into(); assert_eq!(c, [831_u64, 910, 40, 160]);