From: Carl Love Date: Fri, 24 Jan 2014 16:42:26 +0000 (+0000) Subject: This patch by adrian.sendroiu@freescale.com fixes the lrmw and stmw X-Git-Tag: svn/VALGRIND_3_10_1^2~162 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=116bf43f97a2fe47ab984b22c12b39b96a662b4a;p=thirdparty%2Fvalgrind.git This patch by adrian.sendroiu@freescale.com fixes the lrmw and stmw instructions. The patch also adds ppc32 and ppc64 test cases for the instructions. The patch is a fix for bugzilla 329956 "valgrind crashes when lmw/stmw instructions are used on ppc64". git-svn-id: svn://svn.valgrind.org/vex/trunk@2808 --- diff --git a/VEX/priv/guest_ppc_toIR.c b/VEX/priv/guest_ppc_toIR.c index d56287fe98..edb736ba3f 100644 --- a/VEX/priv/guest_ppc_toIR.c +++ b/VEX/priv/guest_ppc_toIR.c @@ -5233,6 +5233,7 @@ static Bool dis_int_ldst_mult ( UInt theInstr ) Int simm16 = extend_s_16to32(uimm16); IRType ty = mode64 ? Ity_I64 : Ity_I32; + IROp mkAdd = mode64 ? Iop_Add64 : Iop_Add32; IRTemp EA = newTemp(ty); UInt r = 0; UInt ea_off = 0; @@ -5248,7 +5249,7 @@ static Bool dis_int_ldst_mult ( UInt theInstr ) } DIP("lmw r%u,%d(r%u)\n", rD_addr, simm16, rA_addr); for (r = rD_addr; r <= 31; r++) { - irx_addr = binop(Iop_Add32, mkexpr(EA), mkU32(ea_off)); + irx_addr = binop(mkAdd, mkexpr(EA), mode64 ? mkU64(ea_off) : mkU32(ea_off)); putIReg( r, mkWidenFrom32(ty, loadBE(Ity_I32, irx_addr ), False) ); ea_off += 4; @@ -5258,7 +5259,7 @@ static Bool dis_int_ldst_mult ( UInt theInstr ) case 0x2F: // stmw (Store Multiple Word, PPC32 p527) DIP("stmw r%u,%d(r%u)\n", rS_addr, simm16, rA_addr); for (r = rS_addr; r <= 31; r++) { - irx_addr = binop(Iop_Add32, mkexpr(EA), mkU32(ea_off)); + irx_addr = binop(mkAdd, mkexpr(EA), mode64 ? mkU64(ea_off) : mkU32(ea_off)); storeBE( irx_addr, mkNarrowTo32(ty, getIReg(r)) ); ea_off += 4; }