From c4c289ae994dfb8195e8b4889746d5e3d8296d25 Mon Sep 17 00:00:00 2001 From: Carl Love Date: Wed, 18 Mar 2020 12:29:20 -0500 Subject: [PATCH] additional grail' fixes for ppc32 and ppc64 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 | 2 +- VEX/priv/host_ppc_isel.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 52377430ce..4b4dad0086 100644 --- 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) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/VEX/priv/host_ppc_isel.c b/VEX/priv/host_ppc_isel.c index 9c954dafef..10dbd65976 100644 --- a/VEX/priv/host_ppc_isel.c +++ b/VEX/priv/host_ppc_isel.c @@ -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); } -- 2.47.3