]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
The existing overflow detection in VEX/priv/guest_ppc_toIR.c/set_XER_OV_64()
authorCarl Love <cel@us.ibm.com>
Fri, 6 Sep 2013 22:29:55 +0000 (22:29 +0000)
committerCarl Love <cel@us.ibm.com>
Fri, 6 Sep 2013 22:29:55 +0000 (22:29 +0000)
under the case PPCG_FLAG_OP_MULLW: does not apply to the mulldo as we need to
detect overflow when performing a Multiply Low Doubleword (not Multiply Low
Word). Hence, we added a new enumeration value PPCG_FLAG_OP_MULLD in
VEX/priv/guest_ppc_defs.h and a corresponding new case under which the
computation for detecting overflow for mulldo/mulldo. is added in
set_XER_OV_64(). The tests have been added to: none/tests/ppc32/jm-insns.c

Vex commit 2754 for the source code fix

This commit adds the test cases.

Bugzilla 324594, submitted by Anmol P. Paralkar

Patch reviewed and tested by Carl Love

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

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

index fefd2ae4bc50cab5576241ea5d7f60fc7b808466..86f6cd84d0b9d4d3e71c7ca2d95af47192f11578 100644 (file)
@@ -530,6 +530,11 @@ static void test_mulld (void)
     __asm__ __volatile__ ("mulld        17, 14, 15");
 }
 
+static void test_mulldo (void)
+{
+    __asm__ __volatile__ ("mulldo        17, 14, 15");
+}
+
 static void test_mulhd (void)
 {
     __asm__ __volatile__ ("mulhd        17, 14, 15");
@@ -572,6 +577,7 @@ static test_t tests_ia_ops_two[] = {
     { &test_mulhd           , "       mulhd", },
     { &test_mulhdu          , "      mulhdu", },
     { &test_mulld           , "       mulld", },
+    { &test_mulldo          , "      mulldo", },
     { &test_divd            , "        divd", },
     { &test_divdu           , "       divdu", },
 #endif // #ifdef __powerpc64__
@@ -674,6 +680,11 @@ static void test_mulld_ (void)
     __asm__ __volatile__ ("mulld.       17, 14, 15");
 }
 
+static void test_mulldo_ (void)
+{
+    __asm__ __volatile__ ("mulldo.       17, 14, 15");
+}
+
 static void test_divd_ (void)
 {
     __asm__ __volatile__ ("divd.        17, 14, 15");
@@ -706,6 +717,7 @@ static test_t tests_iar_ops_two[] = {
     { &test_mulhd_          , "      mulhd.", },
     { &test_mulhdu_         , "     mulhdu.", },
     { &test_mulld_          , "      mulld.", },
+    { &test_mulldo_          , "    mulldo.", },
     { &test_divd_           , "       divd.", },
     { &test_divdu_          , "      divdu.", },
 #endif // #ifdef __powerpc64__
index 4dba79bb5a184f0e7159b156bc7272ca7ac91113..fc3ed10e63f3ddc89bbf8f06388d297ef950c242 100644 (file)
@@ -177,6 +177,16 @@ PPC integer arith insns with two args:
        mulld ffffffffffffffff, 0000001cbe991def => ffffffe34166e211 (00000000 00000000)
        mulld ffffffffffffffff, ffffffffffffffff => 0000000000000001 (00000000 00000000)
 
+      mulldo 0000000000000000, 0000000000000000 => 0000000000000000 (00000000 00000000)
+      mulldo 0000000000000000, 0000001cbe991def => 0000000000000000 (00000000 00000000)
+      mulldo 0000000000000000, ffffffffffffffff => 0000000000000000 (00000000 00000000)
+      mulldo 0000001cbe991def, 0000000000000000 => 0000000000000000 (00000000 00000000)
+      mulldo 0000001cbe991def, 0000001cbe991def => 3f66304b8f2e0521 (00000000 c0000000)
+      mulldo 0000001cbe991def, ffffffffffffffff => ffffffe34166e211 (00000000 00000000)
+      mulldo ffffffffffffffff, 0000000000000000 => 0000000000000000 (00000000 00000000)
+      mulldo ffffffffffffffff, 0000001cbe991def => ffffffe34166e211 (00000000 00000000)
+      mulldo ffffffffffffffff, ffffffffffffffff => 0000000000000001 (00000000 00000000)
+
         divd 0000000000000000, 0000000000000000 => 0000000000000000 (00000000 00000000)
         divd 0000000000000000, 0000001cbe991def => 0000000000000000 (00000000 00000000)
         divd 0000000000000000, ffffffffffffffff => 0000000000000000 (00000000 00000000)
@@ -376,6 +386,16 @@ PPC integer arith insns with two args with flags update:
       mulld. ffffffffffffffff, 0000001cbe991def => ffffffe34166e211 (80000000 00000000)
       mulld. ffffffffffffffff, ffffffffffffffff => 0000000000000001 (40000000 00000000)
 
+    mulldo. 0000000000000000, 0000000000000000 => 0000000000000000 (20000000 00000000)
+    mulldo. 0000000000000000, 0000001cbe991def => 0000000000000000 (20000000 00000000)
+    mulldo. 0000000000000000, ffffffffffffffff => 0000000000000000 (20000000 00000000)
+    mulldo. 0000001cbe991def, 0000000000000000 => 0000000000000000 (20000000 00000000)
+    mulldo. 0000001cbe991def, 0000001cbe991def => 3f66304b8f2e0521 (50000000 c0000000)
+    mulldo. 0000001cbe991def, ffffffffffffffff => ffffffe34166e211 (80000000 00000000)
+    mulldo. ffffffffffffffff, 0000000000000000 => 0000000000000000 (20000000 00000000)
+    mulldo. ffffffffffffffff, 0000001cbe991def => ffffffe34166e211 (80000000 00000000)
+    mulldo. ffffffffffffffff, ffffffffffffffff => 0000000000000001 (40000000 00000000)
+
        divd. 0000000000000000, 0000000000000000 => 0000000000000000 (20000000 00000000)
        divd. 0000000000000000, 0000001cbe991def => 0000000000000000 (20000000 00000000)
        divd. 0000000000000000, ffffffffffffffff => 0000000000000000 (20000000 00000000)
@@ -4710,4 +4730,4 @@ PPC integer population count with one register args, no flags:
         popcntb 0000001cbe991def => 0000000306040407 (00000000 00000000)
         popcntb ffffffffffffffff => 0808080808080808 (00000000 00000000)
 
-All done. Tested 204 different instructions
+All done. Tested 206 different instructions