]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
This patch by adrian.sendroiu@freescale.com fixes the lrmw and stmw
authorCarl Love <cel@us.ibm.com>
Fri, 24 Jan 2014 16:42:26 +0000 (16:42 +0000)
committerCarl Love <cel@us.ibm.com>
Fri, 24 Jan 2014 16:42:26 +0000 (16:42 +0000)
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

VEX/priv/guest_ppc_toIR.c

index d56287fe9819883ad8548ffb6d832453882ea1c7..edb736ba3f2e7b27684f4b73c9e00f2c93d3ff6f 100644 (file)
@@ -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;
       }