Version: 3.2.3 (using KDE KDE 3.5.7) Installed from: Gentoo Packages Compiler: gcc version 4.2.2 (Gentoo 4.2.2 p1.0) Configured with: /var/tmp/portage/sys-devel/gcc-4.2.2/work/gcc-4.2.2/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.2.2 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.2.2/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.2.2 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.2.2/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.2.2/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.2.2/include/g++-v4 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --disable-libunwind-exceptions --disable-multilib --enable-libmudflap --disable-libssp --disable-libgcj --with-arch=i686 --enable-languages=c,c++,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu OS: Linux I use valgrind for testing an x86 emulator. Emulator can run different x86 binaries (DOS, MS WINDOWS), checks instructions and operands validness and runs instructions on real processor. Some of binaries contain old instructions: DAA, DAS, etc. Valgrind crashes on them.
> instructions on real processor. Some of binaries contain > old instructions: DAA, DAS, etc. Write a program which tests DAA, DAS, etc, with all possible input values, so as to demonstrate correct behaviour of the instructions, and send it. That will make it much easier for me to implement the instructions.
Created attachment 22105 [details] C source for testing DAA instruction Small program loops around all significant values of AX: 0..0xFF; and EFLAGS: SF ZF AF PF CF (according to intel specs).
Same tests can be ran for AAS, AAD, DAS. * Should I attach 3 more files or write one test for all insns? * Does this test look good or I've chosen wrong way?
> * Should I attach 3 more files or write one test for all insns? One test for all 4 insns. > * Does this test look good or I've chosen wrong way? Yes, looks good. I just need to implement them now. Thanks.
Created attachment 22112 [details] Contains test for DAA, DAS, AAA, AAS insns New testcase, beware :) On my p4-3.0GHz: $ time { ./wr_sig > bcd_dump; } real 0m8.269s user 0m5.068s sys 0m2.654s Generates 320 MB log
Fixed (vex r1800). Please verify. Is it OK to include a simplified version of your test program in the Valgrind test suite?
> Fixed (vex r1800). Please verify. (after i've left only AF and CF) $ diff -uN orig_log vg_log | wc -l 0 Great. Seems to work! >Is it OK to include a simplified version of your test program in the >Valgrind test suite? Sure. Thanks!