]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
When doing rlwinm in 64-bit mode, bind the intermediate 32-bit result
authorJulian Seward <jseward@acm.org>
Thu, 19 Oct 2006 03:01:09 +0000 (03:01 +0000)
committerJulian Seward <jseward@acm.org>
Thu, 19 Oct 2006 03:01:09 +0000 (03:01 +0000)
to a temporary so it is only computed once.  What's there currently
causes it to be computed twice.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1671

VEX/priv/guest-ppc/toIR.c

index e1d6d007879180dbc3ee91776aa0118077d78135..5808a63ac2483d70677a0cb33eb538c3286b74e5 100644 (file)
@@ -3312,6 +3312,7 @@ static Bool dis_int_rot ( UInt theInstr )
       vassert(sh_imm  < 32);
 
       if (mode64) {
+         IRTemp rTmp = newTemp(Ity_I64);
          mask64 = MASK64(31-MaskEnd, 31-MaskBeg);
          DIP("rlwinm%s r%u,r%u,%d,%d,%d\n", flag_rC ? ".":"",
              rA_addr, rS_addr, sh_imm, MaskBeg, MaskEnd);
@@ -3319,8 +3320,10 @@ static Bool dis_int_rot ( UInt theInstr )
          // rA = ((tmp32 || tmp32) & mask64)
          r = ROTL( unop(Iop_64to32, mkexpr(rS) ), mkU8(sh_imm) );
          r = unop(Iop_32Uto64, r);
-         assign( rot, binop(Iop_Or64, r,
-                            binop(Iop_Shl64, r, mkU8(32))) );
+         assign( rTmp, r );
+         r = NULL;
+         assign( rot, binop(Iop_Or64, mkexpr(rTmp),
+                            binop(Iop_Shl64, mkexpr(rTmp), mkU8(32))) );
          assign( rA, binop(Iop_And64, mkexpr(rot), mkU64(mask64)) );
       }
       else {