On 2014-10-10 22:06:17 +0200, Henrik Gramner wrote: > Libav currently doesn't have any good unit tests for assembly code > which makes it difficult to write new assembly functions and/or > improve the existing ones. > > x264 have the checkasm tool which does the job, so I decided to try to > port it to libav, which turned into more of a rewrite to make it a bit > more modular and not rely on GCC-only features. > > It provides the following features: > * verify correctness by comparing the output to the C version. > * detect failure to save and restore clobbered callee-saved registers. > * detect 32-bit parameters being used as if they were 64-bit in x86-64 > (the upper halves are not guaranteed to be zero - but in practice they > very often are, which makes those bugs hard to spot otherwise). > * easy benchmarking. > > I wrote tests for most of the h264pred functions to begin with, > there's a fair amount of work to add tests for everything else later. > It's also currently not integrated into the build system (so it has to > be compiled and linked manually), help and/or suggestions for adding > it in a clean way are welcome.
Thanks for the work. Checkasm style asm function level unit tests are helpful when writing asm optimizations (at least when the tests is already written by someone else ;)). I started working on build system integration. It is somewhat tricky so giving pointers without doing it myself is hard. http://git.jannau.net/libav.git/log/?h=checkasm has my work in progress. It's now basicly working on my x86 linux machine but needs cleanup and better integration. make tests/checkasm/checkasm && ./tests/checkasm/checkasm [--bewnch] works as expected though. I got rid of all the changes to ff_h264_pred_init() by using av_set_cpu_flags_mask(). less changes to general code and the av_get_cpu_flags() calls remain hidden. Sorry for taking such a long time for moving forward on checkasm. Janne _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
