From: Julian Seward Date: Mon, 27 Nov 2006 04:09:52 +0000 (+0000) Subject: Add a couple of %rflags spec rules which improve performance of amd64 X-Git-Tag: svn/VALGRIND_3_3_1^2~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54f653c0abbe48ff82980c580a9ffccdb43053fa;p=thirdparty%2Fvalgrind.git Add a couple of %rflags spec rules which improve performance of amd64 FP comparisons. git-svn-id: svn://svn.valgrind.org/vex/trunk@1685 --- diff --git a/VEX/priv/guest-amd64/ghelpers.c b/VEX/priv/guest-amd64/ghelpers.c index 19b40ac78c..23952aba37 100644 --- a/VEX/priv/guest-amd64/ghelpers.c +++ b/VEX/priv/guest-amd64/ghelpers.c @@ -1261,6 +1261,43 @@ IRExpr* guest_amd64_spechelper ( HChar* function_name, ); } + if (isU64(cc_op, AMD64G_CC_OP_COPY) + && (isU64(cond, AMD64CondZ) || isU64(cond, AMD64CondNZ))) { + /* COPY, then Z --> extract Z from dep1, and test (Z == 1). */ + /* COPY, then NZ --> extract Z from dep1, and test (Z == 0). */ + UInt nnn = isU64(cond, AMD64CondZ) ? 1 : 0; + return + unop( + Iop_1Uto64, + binop( + Iop_CmpEQ64, + binop( + Iop_And64, + binop(Iop_Shr64, cc_dep1, mkU8(AMD64G_CC_SHIFT_Z)), + mkU64(1) + ), + mkU64(nnn) + ) + ); + } + + if (isU64(cc_op, AMD64G_CC_OP_COPY) && isU64(cond, AMD64CondP)) { + /* COPY, then P --> extract P from dep1, and test (P == 1). */ + return + unop( + Iop_1Uto64, + binop( + Iop_CmpNE64, + binop( + Iop_And64, + binop(Iop_Shr64, cc_dep1, mkU8(AMD64G_CC_SHIFT_P)), + mkU64(1) + ), + mkU64(0) + ) + ); + } + return NULL; }