|
From: <sv...@va...> - 2006-08-28 13:32:50
|
Author: sewardj
Date: 2006-08-28 14:32:48 +0100 (Mon, 28 Aug 2006)
New Revision: 1650
Log:
Merge r1640,1 (ppc cmp reg,reg fix)
Modified:
branches/VEX_3_2_BRANCH/priv/guest-ppc/toIR.c
Modified: branches/VEX_3_2_BRANCH/priv/guest-ppc/toIR.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/VEX_3_2_BRANCH/priv/guest-ppc/toIR.c 2006-08-28 13:30:48 UTC=
(rev 1649)
+++ branches/VEX_3_2_BRANCH/priv/guest-ppc/toIR.c 2006-08-28 13:32:48 UTC=
(rev 1650)
@@ -2936,6 +2936,13 @@
switch (opc2) {
case 0x000: // cmp (Compare, PPC32 p367)
DIP("cmp cr%u,%u,r%u,r%u\n", crfD, flag_L, rA_addr, rB_addr);
+ /* Comparing a reg with itself produces a result which
+ doesn't depend on the contents of the reg. Therefore
+ remove the false dependency, which has been known to cause
+ memcheck to produce false errors. */
+ if (rA_addr =3D=3D rB_addr)
+ a =3D b =3D typeOfIRExpr(irbb->tyenv,a) =3D=3D Ity_I64
+ ? mkU64(0) : mkU32(0);
if (flag_L =3D=3D 1) {
putCR321(crfD, unop(Iop_64to8, binop(Iop_CmpORD64S, a, b)));
} else {
@@ -2948,6 +2955,13 @@
=20
case 0x020: // cmpl (Compare Logical, PPC32 p369)
DIP("cmpl cr%u,%u,r%u,r%u\n", crfD, flag_L, rA_addr, rB_addr);
+ /* Comparing a reg with itself produces a result which
+ doesn't depend on the contents of the reg. Therefore
+ remove the false dependency, which has been known to cause
+ memcheck to produce false errors. */
+ if (rA_addr =3D=3D rB_addr)
+ a =3D b =3D typeOfIRExpr(irbb->tyenv,a) =3D=3D Ity_I64
+ ? mkU64(0) : mkU32(0);
if (flag_L =3D=3D 1) {
putCR321(crfD, unop(Iop_64to8, binop(Iop_CmpORD64U, a, b)));
} else {
|