From: Cerion Armour-Brown Date: Mon, 22 May 2006 12:41:19 +0000 (+0000) Subject: ppc backend: handle vector constant of zero. X-Git-Tag: svn/VALGRIND_3_2_3^2~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe6a39455ae53ec55537ecf155c312e0a139cdc8;p=thirdparty%2Fvalgrind.git ppc backend: handle vector constant of zero. git-svn-id: svn://svn.valgrind.org/vex/trunk@1623 --- diff --git a/VEX/priv/host-ppc/isel.c b/VEX/priv/host-ppc/isel.c index de63a4a1b9..afc9731349 100644 --- a/VEX/priv/host-ppc/isel.c +++ b/VEX/priv/host-ppc/isel.c @@ -976,6 +976,16 @@ void set_FPU_rounding_mode ( ISelEnv* env, IRExpr* mode ) /*--- ISEL: vector helpers ---*/ /*---------------------------------------------------------*/ +/* Generate all-zeroes into a new vector register. +*/ +static HReg generate_zeroes_V128 ( ISelEnv* env ) +{ + HReg dst = newVRegV(env); + addInstr(env, PPCInstr_AvBinary(Pav_XOR, dst, dst, dst)); + return dst; +} + + /* Generates code for AvSplat - takes in IRExpr* of type 8|16|32 @@ -3549,6 +3559,13 @@ static HReg iselVecExpr_wrk ( ISelEnv* env, IRExpr* e ) } /* switch (e->Iex.Binop.op) */ } /* if (e->tag == Iex_Binop) */ + if (e->tag == Iex_Const ) { + vassert(e->Iex.Const.con->tag == Ico_V128); + if (e->Iex.Const.con->Ico.V128 == 0x0000) { + return generate_zeroes_V128(env); + } + } + vex_printf("iselVecExpr(ppc) (subarch = %s): can't reduce\n", LibVEX_ppVexHwCaps(mode64 ? VexArchPPC64 : VexArchPPC32, env->hwcaps));