From 218719fbd3e8f232567846348298bfa500f27a2c Mon Sep 17 00:00:00 2001 From: Julian Seward Date: Wed, 20 Jul 2005 01:12:48 +0000 Subject: [PATCH] Specialise NZ after ANDL/ORL/XORL. This fixes #109314. git-svn-id: svn://svn.valgrind.org/vex/trunk@1280 --- VEX/priv/guest-amd64/ghelpers.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/VEX/priv/guest-amd64/ghelpers.c b/VEX/priv/guest-amd64/ghelpers.c index 77022f0ded..5ffc209287 100644 --- a/VEX/priv/guest-amd64/ghelpers.c +++ b/VEX/priv/guest-amd64/ghelpers.c @@ -996,6 +996,14 @@ IRExpr* guest_amd64_spechelper ( HChar* function_name, mkU64(0))); } + if (isU64(cc_op, AMD64G_CC_OP_LOGICL) && isU64(cond, AMD64CondNZ)) { + /* long and/or/xor, then NZ --> test dst!=0 */ + return unop(Iop_1Uto64, + binop(Iop_CmpNE64, + binop(Iop_Shl64,cc_dep1,mkU8(32)), + mkU64(0))); + } + //.. if (isU32(cc_op, AMD64G_CC_OP_LOGICL) && isU32(cond, X86CondS)) { //.. /* long and/or/xor, then S --> test dst