|
From: <sv...@va...> - 2006-11-27 04:09:58
|
Author: sewardj
Date: 2006-11-27 04:09:52 +0000 (Mon, 27 Nov 2006)
New Revision: 1685
Log:
Add a couple of %rflags spec rules which improve performance of amd64
FP comparisons.
Modified:
trunk/priv/guest-amd64/ghelpers.c
Modified: trunk/priv/guest-amd64/ghelpers.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
--- trunk/priv/guest-amd64/ghelpers.c 2006-11-24 23:32:55 UTC (rev 1684)
+++ trunk/priv/guest-amd64/ghelpers.c 2006-11-27 04:09:52 UTC (rev 1685)
@@ -1261,6 +1261,43 @@
);
}
=20
+ if (isU64(cc_op, AMD64G_CC_OP_COPY)=20
+ && (isU64(cond, AMD64CondZ) || isU64(cond, AMD64CondNZ))) {
+ /* COPY, then Z --> extract Z from dep1, and test (Z =3D=3D 1).=
*/
+ /* COPY, then NZ --> extract Z from dep1, and test (Z =3D=3D 0)=
. */
+ UInt nnn =3D isU64(cond, AMD64CondZ) ? 1 : 0;
+ return
+ unop(
+ Iop_1Uto64,
+ binop(
+ Iop_CmpEQ64,
+ binop(
+ Iop_And64,
+ binop(Iop_Shr64, cc_dep1, mkU8(AMD64G_CC_SHIFT_Z)),
+ mkU64(1)
+ ),
+ mkU64(nnn)
+ )
+ );
+ }
+
+ if (isU64(cc_op, AMD64G_CC_OP_COPY) && isU64(cond, AMD64CondP)) {
+ /* COPY, then P --> extract P from dep1, and test (P =3D=3D 1).=
*/
+ return
+ unop(
+ Iop_1Uto64,
+ binop(
+ Iop_CmpNE64,
+ binop(
+ Iop_And64,
+ binop(Iop_Shr64, cc_dep1, mkU8(AMD64G_CC_SHIFT_P)),
+ mkU64(1)
+ ),
+ mkU64(0)
+ )
+ );
+ }
+
return NULL;
}
=20
|