|
From: <sv...@va...> - 2008-03-31 01:51:54
|
Author: sewardj
Date: 2008-03-31 02:51:57 +0100 (Mon, 31 Mar 2008)
New Revision: 1816
Log:
Specialise CondNS after SUBB. The lack of this was causing Memcheck to
report false positives in some tricky bitfield code in OOo 2.4 (writer)
when loading MS Word docs.
Modified:
trunk/priv/guest-x86/ghelpers.c
Modified: trunk/priv/guest-x86/ghelpers.c
===================================================================
--- trunk/priv/guest-x86/ghelpers.c 2008-03-29 14:02:57 UTC (rev 1815)
+++ trunk/priv/guest-x86/ghelpers.c 2008-03-31 01:51:57 UTC (rev 1816)
@@ -968,6 +968,19 @@
mkU32(1));
}
+ if (isU32(cc_op, X86G_CC_OP_SUBB) && isU32(cond, X86CondNS)
+ && isU32(cc_dep2, 0)) {
+ /* byte sub/cmp of zero, then NS --> test !(dst-0 <s 0)
+ --> test !(dst <s 0)
+ --> (UInt) !dst[7]
+ */
+ return binop(Iop_Xor32,
+ binop(Iop_And32,
+ binop(Iop_Shr32,cc_dep1,mkU8(7)),
+ mkU32(1)),
+ mkU32(1));
+ }
+
/*---------------- LOGICL ----------------*/
if (isU32(cc_op, X86G_CC_OP_LOGICL) && isU32(cond, X86CondZ)) {
|