From patchwork Wed Jun 22 14:40:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 2173 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 71D8E23F42 for ; Wed, 22 Jun 2011 14:40:10 +0000 (UTC) Received: from mail-vx0-f180.google.com (mail-vx0-f180.google.com [209.85.220.180]) by fiordland.canonical.com (Postfix) with ESMTP id 395A0A180B5 for ; Wed, 22 Jun 2011 14:40:10 +0000 (UTC) Received: by vxd7 with SMTP id 7so944264vxd.11 for ; Wed, 22 Jun 2011 07:40:09 -0700 (PDT) Received: by 10.52.98.97 with SMTP id eh1mr1098566vdb.7.1308753609668; Wed, 22 Jun 2011 07:40:09 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.52.183.130 with SMTP id em2cs141028vdc; Wed, 22 Jun 2011 07:40:09 -0700 (PDT) Received: by 10.227.69.194 with SMTP id a2mr819190wbj.57.1308753608818; Wed, 22 Jun 2011 07:40:08 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk [81.2.115.146]) by mx.google.com with ESMTPS id fr1si1574392wbb.110.2011.06.22.07.40.08 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 22 Jun 2011 07:40:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) client-ip=81.2.115.146; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1QZOb8-0004fb-Ls; Wed, 22 Jun 2011 15:40:06 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Aurelien Jarno Subject: [PATCH] tcg/README: Expand advice on number of TCG ops per target insn Date: Wed, 22 Jun 2011 15:40:06 +0100 Message-Id: <1308753606-17928-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 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