From: Julian Seward Date: Mon, 15 Nov 2004 12:42:26 +0000 (+0000) Subject: More eflags-specialisation rules. X-Git-Tag: svn/VALGRIND_3_0_1^2~783 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48d727597ffe941f33b0d1368a1e2d02b74c4a25;p=thirdparty%2Fvalgrind.git More eflags-specialisation rules. git-svn-id: svn://svn.valgrind.org/vex/trunk@551 --- diff --git a/VEX/priv/guest-x86/ghelpers.c b/VEX/priv/guest-x86/ghelpers.c index e1363b81ce..ebad1108e6 100644 --- a/VEX/priv/guest-x86/ghelpers.c +++ b/VEX/priv/guest-x86/ghelpers.c @@ -709,6 +709,16 @@ IRExpr* x86guest_spechelper ( Char* function_name, cc_dep2 = args[3]; cc_ndep = args[4]; + /*---------------- ADDL ----------------*/ + + if (isU32(cc_op, CC_OP_ADDL) && isU32(cond, CondZ)) { + /* long add, then Z --> test (dst+src == 0) */ + return unop(Iop_1Uto32, + binop(Iop_CmpEQ32, + binop(Iop_Add32, cc_dep1, cc_dep2), + mkU32(0))); + } + /*---------------- SUBL ----------------*/ if (isU32(cc_op, CC_OP_SUBL) && isU32(cond, CondZ)) { @@ -805,6 +815,15 @@ IRExpr* x86guest_spechelper ( Char* function_name, return unop(Iop_1Uto32,binop(Iop_CmpLE32S, cc_dep1, mkU32(0))); } + /*---------------- LOGICW ----------------*/ + + if (isU32(cc_op, CC_OP_LOGICW) && isU32(cond, CondZ)) { + /* byte and/or/xor, then Z --> test dst==0 */ + return unop(Iop_1Uto32, + binop(Iop_CmpEQ32, binop(Iop_And32,cc_dep1,mkU32(0xFFFF)), + mkU32(0))); + } + /*---------------- LOGICB ----------------*/ if (isU32(cc_op, CC_OP_LOGICB) && isU32(cond, CondZ)) { @@ -826,6 +845,13 @@ IRExpr* x86guest_spechelper ( Char* function_name, return unop(Iop_1Uto32,binop(Iop_CmpLT32S, cc_dep1, mkU32(0))); } + /*---------------- SHRL ----------------*/ + + if (isU32(cc_op, CC_OP_SHRL) && isU32(cond, CondZ)) { + /* SHRL, then Z --> test dep1 == 0 */ + return unop(Iop_1Uto32,binop(Iop_CmpEQ32, cc_dep1, mkU32(0))); + } + return NULL; }