From: <sv...@va...> - 2012-04-25 14:33:12
|
sewardj 2012-04-25 15:33:03 +0100 (Wed, 25 Apr 2012) New Revision: 2314 Log: Add spec rules for Z and NZ after LOGICW. Modified files: trunk/priv/guest_amd64_helpers.c Modified: trunk/priv/guest_amd64_helpers.c (+17 -0) =================================================================== --- trunk/priv/guest_amd64_helpers.c 2012-04-24 12:49:03 +01:00 (rev 2313) +++ trunk/priv/guest_amd64_helpers.c 2012-04-25 15:33:03 +01:00 (rev 2314) @@ -1198,6 +1198,23 @@ 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)) { |