From: Cerion Armour-Brown Date: Thu, 3 Feb 2005 13:40:49 +0000 (+0000) Subject: Undoing mistaken commit of r825. X-Git-Tag: svn/VALGRIND_3_0_1^2~508 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8697ffc9c0dbe277be857a80a106237163b3f21d;p=thirdparty%2Fvalgrind.git Undoing mistaken commit of r825. git-svn-id: svn://svn.valgrind.org/vex/trunk@826 --- diff --git a/VEX/priv/guest-arm/toIR.c b/VEX/priv/guest-arm/toIR.c index 10fa5940d6..297baa6d08 100644 --- a/VEX/priv/guest-arm/toIR.c +++ b/VEX/priv/guest-arm/toIR.c @@ -1843,7 +1843,7 @@ void dis_branch ( UInt theInstr ) assign( dest, binop(Iop_Add32, getIReg(15), mkU32(branch_offset)) ); irbb->jumpkind = link ? Ijk_Call : Ijk_Boring; - irbb->next = mkexpr(dest); + irbb->next = mkU32(dest); // Note: Not actually writing to R15 - let the IR stuff do that. @@ -1921,6 +1921,8 @@ static DisResult disInstr ( /*IN*/ Bool resteerOK, { UInt* code = (UInt*)(guest_code + delta); + // CAB: easy way to rotate left? + /* Spot this: E1A00EE0 mov r0, r0, ror #29 E1A001E0 mov r0, r0, ror #3 diff --git a/VEX/priv/guest-ppc32/toIR.c b/VEX/priv/guest-ppc32/toIR.c index e55b02636d..8dd7545e03 100644 --- a/VEX/priv/guest-ppc32/toIR.c +++ b/VEX/priv/guest-ppc32/toIR.c @@ -899,6 +899,7 @@ static Bool dis_int_arith ( UInt theInstr ) IRTemp tmp = newTemp(Ity_I32); IRTemp src1_64 = newTemp(Ity_I64); + IRTemp src2_64 = newTemp(Ity_I64); IRTemp res64 = newTemp(Ity_I64); assign( Ra, getIReg(Ra_addr) ); @@ -948,7 +949,7 @@ static Bool dis_int_arith ( UInt theInstr ) case 0x07: // mulli (Multiply Low Immediate, p544) DIP("mulli %d,%d,0x%x\n", Rd_addr, Ra_addr, SIMM_16); assign( res64, binop(Iop_MullS32, mkexpr(Ra), mkU32(EXTS_SIMM)) ); - assign( Rd, unop(Iop_64to32, mkexpr(res64)) ); + assign( Rd, unop(Iop_64HIto32, mkexpr(res64)) ); break; case 0x08: // subfic (Subtract from Immediate Carrying, p613) @@ -1048,8 +1049,9 @@ static Bool dis_int_arith ( UInt theInstr ) Rd_addr, Ra_addr, Rb_addr); // CAB: Don't think this is right... assign( src1_64, binop(Iop_32HLto64, mkU32(0), mkexpr(Ra)) ); + assign( src2_64, binop(Iop_32HLto64, mkU32(0), mkexpr(Rb)) ); assign( res64, binop(Iop_DivModS64to32, - mkexpr(src1_64), mkexpr(Rb)) ); + mkexpr(src1_64), mkexpr(src2_64)) ); assign( Rd, unop(Iop_64to32,mkexpr(res64)) ); if (flag_Rc) { setFlags_CR0_Result( mkexpr(Rd) ); } if (flag_OE) { @@ -1066,8 +1068,9 @@ static Bool dis_int_arith ( UInt theInstr ) Rd_addr, Ra_addr, Rb_addr); // CAB: Don't think this is right... assign( src1_64, binop(Iop_32HLto64, mkU32(0), mkexpr(Ra)) ); + assign( src2_64, binop(Iop_32HLto64, mkU32(0), mkexpr(Rb)) ); assign( res64, binop(Iop_DivModU64to32, - mkexpr(src1_64), mkexpr(Rb)) ); + mkexpr(src1_64), mkexpr(src2_64)) ); assign( Rd, unop(Iop_64to32,mkexpr(res64)) ); if (flag_Rc) { setFlags_CR0_Result( mkexpr(Rd) ); } if (flag_OE) { @@ -2153,10 +2156,7 @@ static Bool dis_branch ( theInstr ) // vex_printf("disInstr(ppc32): LI: %,039b\n", LI_24 << 2); // vex_printf("disInstr(ppc32): LI: %,031b\n", extend_s_24to32(LI_24 << 2)); -// 0xFFDE9C4: 429F0005 bcl 20,31,0xFFDE9C8 -// 0xFFDE9C4: bcl 0x14, 0x1F, 0x1 - - switch (opc1) { + switch (opc1) { case 0x12: // b (Branch, p390) DIP("b%s%s 0x%x\n", flag_LK ? "l" : "", flag_AA ? "a" : "", LI_24); nia = exts_LI; @@ -2259,7 +2259,9 @@ static Bool dis_branch ( theInstr ) stmt( IRStmt_Put( OFFB_LR, mkexpr(lr) )); } - stmt( IRStmt_Exit( unop(Iop_Not1, unop(Iop_32to1, mkexpr(cond_ok))), + // CAB: Can't give ir_nia as IRConst, so reversing things... + // Not sure about this at all... + stmt( IRStmt_Exit( unop(Iop_32to1, unop(Iop_Not32, mkexpr(cond_ok))), Ijk_Boring, IRConst_U32(guest_cia_curr_instr + 4) )); @@ -2312,7 +2314,9 @@ static Bool dis_branch ( theInstr ) stmt( IRStmt_Put( OFFB_LR, mkexpr(lr) )); } - stmt( IRStmt_Exit( unop(Iop_Not1, unop(Iop_32to1, mkexpr(do_branch))), + // CAB: Can't give ir_nia as IRConst, so reversing things... + // Not sure about this at all... + stmt( IRStmt_Exit( unop(Iop_32to1, unop(Iop_Not32, mkexpr(do_branch))), Ijk_Boring, IRConst_U32(guest_cia_curr_instr + 4) )); @@ -2393,6 +2397,7 @@ static Bool dis_memsync ( UInt theInstr ) } DIP("isync\n"); + // CAB: This right? What's the diff from 'sync' ? stmt( IRStmt_MFence() ); break; diff --git a/VEX/priv/ir/irdefs.c b/VEX/priv/ir/irdefs.c index f2b4a563c1..b53bf9364c 100644 --- a/VEX/priv/ir/irdefs.c +++ b/VEX/priv/ir/irdefs.c @@ -166,9 +166,6 @@ void ppIROp ( IROp op ) case Iop_CmpLT32U: vex_printf("CmpLT32U"); return; case Iop_CmpLE32U: vex_printf("CmpLE32U"); return; - case Iop_DivU32: vex_printf("DivU32"); return; - case Iop_DivS32: vex_printf("DivS32"); return; - case Iop_DivModU64to32: vex_printf("DivModU64to32"); return; case Iop_DivModS64to32: vex_printf("DivModS64to32"); return; @@ -1243,9 +1240,6 @@ void typeOfPrimop ( IROp op, IRType* t_dst, IRType* t_arg1, IRType* t_arg2 ) case Iop_Clz32: case Iop_Ctz32: UNARY(Ity_I32,Ity_I32); - case Iop_DivU32: case Iop_DivS32: - BINARY(Ity_I32, Ity_I32,Ity_I32); - case Iop_DivModU64to32: case Iop_DivModS64to32: BINARY(Ity_I64, Ity_I64,Ity_I32); diff --git a/VEX/priv/main/vex_main.c b/VEX/priv/main/vex_main.c index f64344777e..01567a0e75 100644 --- a/VEX/priv/main/vex_main.c +++ b/VEX/priv/main/vex_main.c @@ -451,7 +451,7 @@ VexTranslateResult LibVEX_Translate ( vex_printf("\n"); } - if (1) { *host_bytes_used = 0; return VexTransOK; } + if (0) { *host_bytes_used = 0; return VexTransOK; } if (vex_traceflags & VEX_TRACE_VCODE) vex_printf("\n------------------------"