#helper #standalone #assembly #check #test #function #dav1d

checkasm

Helper to check stand-alone assembly functions, derived from dav1d

1 unstable release

0.1.0 Dec 30, 2020

#419 in Video

BSD-2-Clause

97KB
2.5K SLoC

Assembly 2K SLoC // 0.1% comments GNU Style Assembly 562 SLoC // 0.2% comments Rust 141 SLoC // 0.0% comments

checkasm helper for rust

It is a port of the dav1d checkasm harness to rust.

Usage


#[cfg(test)]
mod test {
    use checkasm::declare_fn;
    use std::ffi::c_void;

    extern fn variant_avx2(a: *mut u8, len: usize);
    extern fn variant_avx512(a: *mut u8, len: usize);

    declare_fn { check_variant(a: *mut u8, len: usize) };

    #[test]
    fn variant() {
        let mut buf = vec![0u8; 128];

        check_variant(variant_avx512 as *mut c_void, buf.as_mut_ptr(), buf.len());
    }
}

Status

  • builds
  • reports errors on stderr
  • panics correctly

Dependencies

~190KB