]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
additional grail' fixes for ppc32 and ppc64
authorCarl Love <carll@us.ibm.com>
Wed, 18 Mar 2020 17:29:20 +0000 (12:29 -0500)
committerCarl Love <carll@us.ibm.com>
Thu, 19 Mar 2020 15:37:17 +0000 (10:37 -0500)
The grail changes introduce a kludge call for ppc64.  The call fails
on some tests as the flatten call generates adds

addStmtToIRSB(bb, IRStmt_WrTmp(t1,
            IRExpr_ITE(flatten_Expr(bb, ex->Iex.ITE.cond),
                       flatten_Expr(bb, ex->Iex.ITE.iftrue),
                       flatten_Expr(bb, ex->Iex.ITE.iffalse))));

for V128 expressions.  Iex_ITE isn't supported for V128 type.  This patch
adds the needed V128 support for the Iex_ITE expressions.

Bugzilla 418004

NEWS
VEX/priv/host_ppc_isel.c

diff --git a/NEWS b/NEWS
index 52377430ce1756002195ee26ec3ba3d4de9d08ef..4b4dad0086fec1d2025f144218f683d2de558295 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -133,7 +133,7 @@ n-i-bz  Add --run-cxx-freeres=no in outer args to avoid inner crashes.
 n-i-bz  Add support for the Linux io_uring system calls
 n-i-bz  sys_statx: don't complain if both |filename| and |buf| are NULL.
 n-i-bz  Fix non-glibc build of test suite with s390x_features
-
+418004  Grail code additions break ppc64.
 
 Release 3.15.0 (12 April 2019)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
index 9c954dafefc424a8c2f30f9e90d23374941efa95..10dbd65976fc3cfec1caa78175efdcb2b3f66d6b 100644 (file)
@@ -5587,6 +5587,18 @@ static HReg iselVecExpr_wrk ( ISelEnv* env, const IRExpr* e,
    vassert(e);
    vassert(ty == Ity_V128);
 
+   if (e->tag == Iex_ITE) {
+      HReg r1 = iselVecExpr( env, e->Iex.ITE.iftrue, IEndianess );
+      HReg r0 = iselVecExpr( env, e->Iex.ITE.iffalse, IEndianess );
+      HReg r_dst = newVRegV(env);
+
+      // Use OR operator to do move r1 to r_dst
+      addInstr(env, PPCInstr_AvBinary( Pav_OR, r_dst, r0, r0));
+      PPCCondCode cc = iselCondCode(env, e->Iex.ITE.cond, IEndianess);
+      addInstr(env, PPCInstr_AvCMov(cc, r_dst, r1));
+      return r_dst;
+   }
+
    if (e->tag == Iex_RdTmp) {
       return lookupIRTemp(env, e->Iex.RdTmp.tmp);
    }