From: Julian Seward Date: Wed, 25 Apr 2012 14:33:03 +0000 (+0000) Subject: Add spec rules for Z and NZ after LOGICW. X-Git-Tag: svn/VALGRIND_3_8_1^2~164 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a8385177a37080ea61dfa536557cdfc2616005a;p=thirdparty%2Fvalgrind.git Add spec rules for Z and NZ after LOGICW. git-svn-id: svn://svn.valgrind.org/vex/trunk@2314 --- diff --git a/VEX/priv/guest_amd64_helpers.c b/VEX/priv/guest_amd64_helpers.c index 80b5a74bcd..c749c397b8 100644 --- a/VEX/priv/guest_amd64_helpers.c +++ b/VEX/priv/guest_amd64_helpers.c @@ -1198,6 +1198,23 @@ IRExpr* guest_amd64_spechelper ( HChar* function_name, mkU64(1)); } + /*---------------- LOGICW ----------------*/ + + if (isU64(cc_op, AMD64G_CC_OP_LOGICW) && isU64(cond, AMD64CondZ)) { + /* word and/or/xor, then Z --> test dst==0 */ + return unop(Iop_1Uto64, + binop(Iop_CmpEQ64, + binop(Iop_And64, cc_dep1, mkU64(0xFFFF)), + mkU64(0))); + } + if (isU64(cc_op, AMD64G_CC_OP_LOGICW) && isU64(cond, AMD64CondNZ)) { + /* word and/or/xor, then NZ --> test dst!=0 */ + return unop(Iop_1Uto64, + binop(Iop_CmpNE64, + binop(Iop_And64, cc_dep1, mkU64(0xFFFF)), + mkU64(0))); + } + /*---------------- LOGICB ----------------*/ if (isU64(cc_op, AMD64G_CC_OP_LOGICB) && isU64(cond, AMD64CondZ)) {