From: Carl Love Date: Mon, 3 Oct 2016 15:30:46 +0000 (+0000) Subject: Fix rounding mode check and instruction stxvl X-Git-Tag: svn/VALGRIND_3_12_0^2~14^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=316575fda35b5a16ba17338846253ecf1a7fa70a;p=thirdparty%2Fvalgrind.git Fix rounding mode check and instruction stxvl In BE mode, the function FPU_rounding_mode_isOdd() has the assert vassert(mode->Iex.Const.con->Ico.U8 == 0x8); The value was set using mkU32 but in BE mode the U8 maps to the upper bits in the memory location not the lower bits. The comparison was fixed by changing the .U8 to .U32 to be consistent with how the field was set. The stxvl instruction called the 64-bit NOT not the 128-bit NOT when calculating the store_val. The stxvx instruction the temp word values were initialized I32 not I64. Not sure why this wasn't caught on LE. bugzilla 369175 git-svn-id: svn://svn.valgrind.org/vex/trunk@3252 --- diff --git a/VEX/priv/guest_ppc_toIR.c b/VEX/priv/guest_ppc_toIR.c index 712d2d514e..c5e2e5009e 100644 --- a/VEX/priv/guest_ppc_toIR.c +++ b/VEX/priv/guest_ppc_toIR.c @@ -20181,10 +20181,10 @@ dis_vx_store ( UInt theInstr ) { UInt ea_off = 0; IRExpr* irx_addr; - IRTemp word0 = newTemp( Ity_I32 ); - IRTemp word1 = newTemp( Ity_I32 ); - IRTemp word2 = newTemp( Ity_I32 ); - IRTemp word3 = newTemp( Ity_I32 ); + IRTemp word0 = newTemp( Ity_I64 ); + IRTemp word1 = newTemp( Ity_I64 ); + IRTemp word2 = newTemp( Ity_I64 ); + IRTemp word3 = newTemp( Ity_I64 ); DIP("stxvx %d,r%u,r%u\n", (UInt)XS, rA_addr, rB_addr); assign( word0, binop( Iop_Shr64, @@ -20346,7 +20346,7 @@ dis_vx_store ( UInt theInstr ) mkexpr( shift ) ), mkexpr( nb_mask ) ), binop( Iop_AndV128, - unop( Iop_Not64, mkexpr( nb_mask ) ), + unop( Iop_NotV128, mkexpr( nb_mask ) ), mkexpr( current_mem) ) ) ); } else { diff --git a/VEX/priv/host_ppc_isel.c b/VEX/priv/host_ppc_isel.c index 9887f27ece..07f519d409 100644 --- a/VEX/priv/host_ppc_isel.c +++ b/VEX/priv/host_ppc_isel.c @@ -1238,7 +1238,7 @@ Bool FPU_rounding_mode_isOdd (IRExpr* mode) { return False; vassert(mode->Iex.Const.con->tag == Ico_U32); - vassert(mode->Iex.Const.con->Ico.U8 == 0x8); + vassert(mode->Iex.Const.con->Ico.U32 == 0x8); return True; }