use crate::{
S,
delta_encoding::{H, V},
profiles::Profile,
};
#[inline(always)]
#[allow(unused)] pub fn compute_block<P: Profile>(h0: &mut H, v: &mut V, ca: &P::A, cb: &P::B) {
let eq = P::eq(ca, cb); let (vp, vm) = v.pm();
let vx = eq | vm;
let eq = eq | h0.m();
let hx = (((eq & vp).wrapping_add(vp)) ^ vp) | eq;
let hp = vm | !(hx | vp);
let hm = vp & hx;
let hpw = hp >> (u64::BITS - 1);
let hmw = hm >> (u64::BITS - 1);
let hp = (hp << 1) | h0.p();
let hm = (hm << 1) | h0.m();
*h0 = H::from(hpw, hmw);
*v = V::from(hm | !(vx | hp), hp & vx);
}
#[inline(always)]
pub fn compute_block_simd(hp0: &mut S, hm0: &mut S, vp: &mut S, vm: &mut S, eq: S) {
let vx = eq | *vm;
let eq = eq | *hm0;
let hx = (((eq & *vp) + *vp) ^ *vp) | eq;
let hp = *vm | !(hx | *vp);
let hm = *vp & hx;
let right_shift = u64::BITS as u64 - 1;
let hpw = hp >> right_shift;
let hmw = hm >> right_shift;
let hp = (hp << 1) | *hp0;
let hm = (hm << 1) | *hm0;
*hp0 = hpw;
*hm0 = hmw;
let tmp: S = vx | hp;
*vp = hm | !tmp;
*vm = hp & vx;
}