From: Philippe Waroquiers Date: Fri, 6 Jul 2012 21:59:03 +0000 (+0000) Subject: fix 303116 - Add support for the POWER instruction popcntb (Valgrind side) X-Git-Tag: svn/VALGRIND_3_8_0~149 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2254b8ab602b8c0ffb03c9ddcf7507bf48f0d1e1;p=thirdparty%2Fvalgrind.git fix 303116 - Add support for the POWER instruction popcntb (Valgrind side) patch from carll@us.ibm.com git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12719 --- diff --git a/NEWS b/NEWS index eb4d93abfe..37667c50dd 100644 --- a/NEWS +++ b/NEWS @@ -224,6 +224,7 @@ n-i-bz Fix assert in gdbserver for watchpoints watching the same address == 273475 (canonical avx) 302709 valgrind for ARM needs extra tls support for android emulator under Linux 302918 Enable testing of the vmaddfp and vnsubfp instructions in the testsuite +303116 Add support for the POWER instruction popcntb Release 3.7.0 (5 November 2011) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/none/tests/ppc32/jm-insns.c b/none/tests/ppc32/jm-insns.c index 023ab9aac7..14e2ea8410 100644 --- a/none/tests/ppc32/jm-insns.c +++ b/none/tests/ppc32/jm-insns.c @@ -360,6 +360,7 @@ enum test_flags { PPC_COMPARE = 0x00000300, PPC_CROP = 0x00000400, PPC_LDST = 0x00000500, + PPC_POPCNT = 0x00000600, PPC_TYPE = 0x00000F00, /* Family */ PPC_INTEGER = 0x00010000, @@ -1686,6 +1687,17 @@ static test_t tests_ist_ops_three[] = { { NULL, NULL, }, }; +static void +tests_popcnt_one(void) +{ + __asm__ __volatile__ ("popcntb 17, 14"); +} + +static test_t tests_popcnt_ops_one[] = { + { &tests_popcnt_one , " popcntb", }, + { NULL, NULL, }, +}; + #if !defined (NO_FLOAT) static void test_fsel (void) { @@ -3934,6 +3946,11 @@ static test_table_t all_tests[] = { "PPC integer store insns with three register args", 0x0001050b, }, + { + tests_popcnt_ops_one , + "PPC integer population count with one register args, no flags", + 0x00010601, + }, #if !defined (NO_FLOAT) { tests_fa_ops_three , @@ -7344,7 +7361,8 @@ static void do_tests ( insn_sel_flags_t seln_flags, if ((type == PPC_ARITH && !seln_flags.arith) || (type == PPC_LOGICAL && !seln_flags.logical) || (type == PPC_COMPARE && !seln_flags.compare) || - (type == PPC_LDST && !seln_flags.ldst)) + (type == PPC_LDST && !seln_flags.ldst) || + (type == PPC_POPCNT && !seln_flags.arith)) continue; /* Check instruction family */ family = all_tests[i].flags & PPC_FAMILY; diff --git a/none/tests/ppc32/jm-int.stdout.exp b/none/tests/ppc32/jm-int.stdout.exp index 9d524da293..5198d02a2d 100644 --- a/none/tests/ppc32/jm-int.stdout.exp +++ b/none/tests/ppc32/jm-int.stdout.exp @@ -1596,4 +1596,9 @@ PPC integer store insns with three register args: stwux 000f423f, 4 => 000f423f, 4 (00000000 00000000) stwux ffffffff, 8 => ffffffff, 8 (00000000 00000000) -All done. Tested 154 different instructions +PPC integer population count with one register args, no flags: + popcntb 00000000 => 00000000 (00000000 00000000) + popcntb 000f423f => 00040206 (00000000 00000000) + popcntb ffffffff => 08080808 (00000000 00000000) + +All done. Tested 155 different instructions diff --git a/none/tests/ppc64/jm-int.stdout.exp b/none/tests/ppc64/jm-int.stdout.exp index dec93708e2..4dba79bb5a 100644 --- a/none/tests/ppc64/jm-int.stdout.exp +++ b/none/tests/ppc64/jm-int.stdout.exp @@ -4705,4 +4705,9 @@ PPC integer store insns with three register args: stdux 0000001cbe991def, 8 => 0000001cbe991def, 8 (00000000 00000000) stdux ffffffffffffffff, 16 => ffffffffffffffff, 16 (00000000 00000000) -All done. Tested 203 different instructions +PPC integer population count with one register args, no flags: + popcntb 0000000000000000 => 0000000000000000 (00000000 00000000) + popcntb 0000001cbe991def => 0000000306040407 (00000000 00000000) + popcntb ffffffffffffffff => 0808080808080808 (00000000 00000000) + +All done. Tested 204 different instructions