From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46047) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YM92o-00081D-Pi for qemu-devel@nongnu.org; Fri, 13 Feb 2015 00:44:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YM92j-0004Id-S3 for qemu-devel@nongnu.org; Fri, 13 Feb 2015 00:44:02 -0500 Received: from mail-qg0-x22a.google.com ([2607:f8b0:400d:c04::22a]:34521) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YM92j-0004IS-MM for qemu-devel@nongnu.org; Fri, 13 Feb 2015 00:43:57 -0500 Received: by mail-qg0-f42.google.com with SMTP id z107so11753485qgd.1 for ; Thu, 12 Feb 2015 21:43:56 -0800 (PST) Sender: Richard Henderson From: Richard Henderson Date: Thu, 12 Feb 2015 21:43:41 -0800 Message-Id: <1423806229-17766-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [PULL 0/8] Linked list for tcg ops List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Currently tcg ops are simply placed in a buffer in order. Which is fine until we want to actually do something with the opcode stream, such as optimize them. Note the horrible things like call opcodes needing their argument count both prefixed and postfixed so that we can iterate across the call either forward or backward. While I'm changing this, I also move quite a lot of tcg-op.h out of line. There is very little benefit to having most of them be inline, since their arguments are extracted from the guest instructions being translated, and thus their values are not really predictable. I chose a cutoff of one function call. If a tcg-op.h function consists of a single function call, inline it, otherwise move it out of line. This also removes a bit of boilerplate from each target. I haven't been able to measure a performance difference with this patch set. I wouldn't really expect any, as the complexity level remains the same. I simply find the link list significantly more maintainable. Thanks to Bastian for the reviews. r~ The following changes since commit 449008f86418583a1f0fb946cf91ee7b4797317d: Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20150210.0' into staging (2015-02-11 05:14:41 +0000) are available in the git repository at: git://github.com/rth7680/qemu.git tags/pull-tcg-20150212 for you to fetch changes up to 15fc7daa770764cc795158cbb525569f156f3659: tcg: Remove unused opcodes (2015-02-12 21:21:38 -0800) ---------------------------------------------------------------- Convert to linked list. ---------------------------------------------------------------- Richard Henderson (8): tcg: Move some opcode generation functions out of line tcg: Reduce ifdefs in tcg-op.c tcg: Move emit of INDEX_op_end into gen_tb_end tcg: Introduce tcg_op_buf_count and tcg_op_buf_full tcg: Put opcodes in a linked list tcg: Remove opcodes instead of noping them out tcg: Implement insert_op_before tcg: Remove unused opcodes Makefile.target | 2 +- include/exec/gen-icount.h | 22 +- target-alpha/translate.c | 16 +- target-arm/translate-a64.c | 10 +- target-arm/translate.c | 10 +- target-cris/translate.c | 15 +- target-i386/translate.c | 11 +- target-lm32/translate.c | 16 +- target-m68k/translate.c | 10 +- target-microblaze/translate.c | 22 +- target-mips/translate.c | 10 +- target-moxie/translate.c | 10 +- target-openrisc/translate.c | 15 +- target-ppc/translate.c | 11 +- target-s390x/translate.c | 11 +- target-sh4/translate.c | 10 +- target-sparc/translate.c | 10 +- target-tricore/translate.c | 5 +- target-unicore32/translate.c | 10 +- target-xtensa/translate.c | 8 +- tcg/optimize.c | 307 +++-- tcg/tcg-op.c | 1934 ++++++++++++++++++++++++++++++++ tcg/tcg-op.h | 2487 ++++++----------------------------------- tcg/tcg-opc.h | 9 - tcg/tcg.c | 532 +++------ tcg/tcg.h | 72 +- tci.c | 13 - 27 files changed, 2751 insertions(+), 2837 deletions(-) create mode 100644 tcg/tcg-op.c