From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:54118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZObN-0004XF-Kf for qemu-devel@nongnu.org; Wed, 22 Jun 2011 10:40:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QZObC-0002ec-Ky for qemu-devel@nongnu.org; Wed, 22 Jun 2011 10:40:21 -0400 Received: from mnementh.archaic.org.uk ([81.2.115.146]:38888) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZObB-0002cZ-Ts for qemu-devel@nongnu.org; Wed, 22 Jun 2011 10:40:10 -0400 From: Peter Maydell Date: Wed, 22 Jun 2011 15:40:06 +0100 Message-Id: <1308753606-17928-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH] tcg/README: Expand advice on number of TCG ops per target insn List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Aurelien Jarno , patches@linaro.org Expand the note on the number of TCG ops generated per target insn, to be clearer about the range of applicability of the 20 op rule of thumb. Also add a note about the hard MAX_OP_PER_INSTR limit. Signed-off-by: Peter Maydell --- The expansion of the first bullet point is based on remarks by Aurelien in this email: http://lists.gnu.org/archive/html/qemu-devel/2011-06/msg00395.html tcg/README | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/tcg/README b/tcg/README index 6600122..cfdfd96 100644 --- a/tcg/README +++ b/tcg/README @@ -504,7 +504,15 @@ register. - Don't hesitate to use helpers for complicated or seldom used target instructions. There is little performance advantage in using TCG to implement target instructions taking more than about twenty TCG - instructions. + instructions. Note that this rule of thumb is more applicable to + helpers doing complex logic or arithmetic, where the C compiler has + scope to do a good job of optimisation; it is less relevant where + the instruction is mostly doing loads and stores, and in those cases + inline TCG may still be faster for longer sequences. + +- The hard limit on the number of TCG instructions you can generate + per target instruction is set by MAX_OP_PER_INSTR in exec-all.h -- + you cannot exceed this without risking a buffer overrun. - Use the 'discard' instruction if you know that TCG won't be able to prove that a given global is "dead" at a given program point. The -- 1.7.1