i4delt 0.1.0

Delta-based encoding for fast compilation of Riscv and Arm64/32
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
#![no_std]

use core::array;
pub fn i4delt<T>(a: impl Iterator<Item = T> + Clone) -> impl Iterator<Item = (usize, T)> + Clone {
    let a = a.enumerate();
    let mut x: [_; 4] = array::from_fn(|i| a.clone().filter(move |a| a.0 % 4 == i));
    x.into_iter().flatten().scan(0usize, |s, (a, x)| {
        let d = a.wrapping_sub(*s);
        *s = a;
        Some((d, x))
    })
}