From: Cerion Armour-Brown Date: Tue, 1 Mar 2005 09:11:49 +0000 (+0000) Subject: Backend bug: mkFormD wasn't smallifying the imm X-Git-Tag: svn/VALGRIND_3_0_1^2~345 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4e5d7bb489f1e712c45a623da1db8ab26390156b;p=thirdparty%2Fvalgrind.git Backend bug: mkFormD wasn't smallifying the imm (plus not-quite-right vassert) Small change to front-end cmp DIP git-svn-id: svn://svn.valgrind.org/vex/trunk@989 --- diff --git a/VEX/priv/guest-ppc32/toIR.c b/VEX/priv/guest-ppc32/toIR.c index 0d73b3e3a8..2277da6c97 100644 --- a/VEX/priv/guest-ppc32/toIR.c +++ b/VEX/priv/guest-ppc32/toIR.c @@ -1430,8 +1430,8 @@ static Bool dis_int_cmp ( UInt theInstr ) switch (opc1) { case 0x0B: // cmpi (Compare Immediate, p398) - DIP("cmpi crf%d,%u,r%d,0x%x\n", crfD, flag_L, Ra_addr, SIMM_16); EXTS_SIMM = extend_s_16to32(SIMM_16); + DIP("cmpi crf%d,%u,r%d,0x%x\n", crfD, flag_L, Ra_addr, EXTS_SIMM); irx_tst1 = binop(Iop_CmpEQ32, mkexpr(Ra), mkU32(EXTS_SIMM)); irx_tst2 = binop(Iop_CmpLT32S, mkexpr(Ra), mkU32(EXTS_SIMM)); break; diff --git a/VEX/priv/host-ppc32/hdefs.c b/VEX/priv/host-ppc32/hdefs.c index 1f719b6de0..37a4612435 100644 --- a/VEX/priv/host-ppc32/hdefs.c +++ b/VEX/priv/host-ppc32/hdefs.c @@ -1810,7 +1810,8 @@ static UChar* mkFormD ( UChar* p, UInt op1, UInt r1, UInt r2, UInt imm ) vassert(op1 < 0x40); vassert(r1 < 0x20); vassert(r2 < 0x20); - vassert(imm < 0x10000 || imm >= 0xFFFF0000); // Pos|Neg + vassert(imm < 0x10000 || imm >= 0xFFFF8000); // Pos|Neg + imm = imm & 0xFFFF; UInt theInstr = ((op1<<26) | (r1<<21) | (r2<<16) | (imm)); return emit32(p, theInstr); }