]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
fix 303116 - Add support for the POWER instruction popcntb (Valgrind side)
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Fri, 6 Jul 2012 21:59:03 +0000 (21:59 +0000)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Fri, 6 Jul 2012 21:59:03 +0000 (21:59 +0000)
patch from carll@us.ibm.com

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12719

NEWS
none/tests/ppc32/jm-insns.c
none/tests/ppc32/jm-int.stdout.exp
none/tests/ppc64/jm-int.stdout.exp

diff --git a/NEWS b/NEWS
index eb4d93abfe7724cf750fb147701820acbe5c43b8..37667c50ddf56ded43da7079341e695e4a78589d 100644 (file)
--- 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)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
index 023ab9aac7c729e3fdd851731f6e96c100180ff8..14e2ea841005f445cb685df30703affc5044e213 100644 (file)
@@ -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;
index 9d524da29364ea2d7cec80290e3f7d98b5154e6b..5198d02a2df5e9d929c6122f58ba6517f0600959 100644 (file)
@@ -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
index dec93708e2398c09c8e417b78db3d3a49cd12b10..4dba79bb5a184f0e7159b156bc7272ca7ac91113 100644 (file)
@@ -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