]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Undoing mistaken commit of r825.
authorCerion Armour-Brown <cerion@valgrind.org>
Thu, 3 Feb 2005 13:40:49 +0000 (13:40 +0000)
committerCerion Armour-Brown <cerion@valgrind.org>
Thu, 3 Feb 2005 13:40:49 +0000 (13:40 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@826

VEX/priv/guest-arm/toIR.c
VEX/priv/guest-ppc32/toIR.c
VEX/priv/ir/irdefs.c
VEX/priv/main/vex_main.c

index 10fa5940d6547463896c1e0244e197a948d01bbd..297baa6d0888e4a6871bfe36ae5160d84d5bc8b9 100644 (file)
@@ -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
index e55b02636da98bd3fc17af9fc5af36389845d5d4..8dd7545e03ba0329159c8ce27f6a7e1a1aedbbfc 100644 (file)
@@ -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;
 
index f2b4a563c1157b22eb0c102293bd2a4cfae6c8c8..b53bf9364ca701065028bba2c004419a7f7762d7 100644 (file)
@@ -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);
 
index f64344777ee85817a0626e1c42707f142e4ccd7a..01567a0e75a490f14f21d01df23b4e3f8070f757 100644 (file)
@@ -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------------------------"