|
From: <sv...@va...> - 2008-05-02 22:15:08
|
Author: sewardj
Date: 2008-05-02 23:15:12 +0100 (Fri, 02 May 2008)
New Revision: 1833
Log:
Specialise CondNZ after SUBW for both x86 and amd64.
Modified:
trunk/priv/guest-amd64/ghelpers.c
trunk/priv/guest-x86/ghelpers.c
Modified: trunk/priv/guest-amd64/ghelpers.c
===================================================================
--- trunk/priv/guest-amd64/ghelpers.c 2008-05-01 20:13:04 UTC (rev 1832)
+++ trunk/priv/guest-amd64/ghelpers.c 2008-05-02 22:15:12 UTC (rev 1833)
@@ -1001,6 +1001,13 @@
unop(Iop_64to16,cc_dep1),
unop(Iop_64to16,cc_dep2)));
}
+ if (isU64(cc_op, AMD64G_CC_OP_SUBW) && isU64(cond, AMD64CondNZ)) {
+ /* word sub/cmp, then NZ --> test dst!=src */
+ return unop(Iop_1Uto64,
+ binop(Iop_CmpNE16,
+ unop(Iop_64to16,cc_dep1),
+ unop(Iop_64to16,cc_dep2)));
+ }
if (isU64(cc_op, AMD64G_CC_OP_SUBW) && isU64(cond, AMD64CondLE)) {
/* word sub/cmp, then LE (signed less than or equal)
Modified: trunk/priv/guest-x86/ghelpers.c
===================================================================
--- trunk/priv/guest-x86/ghelpers.c 2008-05-01 20:13:04 UTC (rev 1832)
+++ trunk/priv/guest-x86/ghelpers.c 2008-05-02 22:15:12 UTC (rev 1833)
@@ -925,6 +925,13 @@
unop(Iop_32to16,cc_dep1),
unop(Iop_32to16,cc_dep2)));
}
+ if (isU32(cc_op, X86G_CC_OP_SUBW) && isU32(cond, X86CondNZ)) {
+ /* word sub/cmp, then NZ --> test dst!=src */
+ return unop(Iop_1Uto32,
+ binop(Iop_CmpNE16,
+ unop(Iop_32to16,cc_dep1),
+ unop(Iop_32to16,cc_dep2)));
+ }
/*---------------- SUBB ----------------*/
|