I'm trying to implement vgf2p8mulb using portable SIMD but I found something intriuging.
// Accumulate result using bit tests
let mut result = <$u8_vec_type>::splat(0);
unroll! {
for i in 0..8 {
let bit = (b >> (i as u8)) & <$u8_vec_type>::splat(1);
result ^= bit * a_powers[i];
}
}
Although the correct code should be:
// Accumulate result using bit tests
let mut result = <$u8_vec_type>::splat(0);
for i in (0..8).rev() {
let bit = (b >> (i as u8)) & <$u8_vec_type>::splat(1);
result ^= bit * a_powers[i];
}
However, rev cannot be unrolled right now
I'm trying to implement vgf2p8mulb using portable SIMD but I found something intriuging.
Although the correct code should be:
However,
revcannot be unrolled right now