From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53750) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHZLw-0007kB-94 for qemu-devel@nongnu.org; Fri, 08 Jan 2016 10:53:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aHZLs-0006SR-Uj for qemu-devel@nongnu.org; Fri, 08 Jan 2016 10:53:24 -0500 Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]:34381) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHZLs-0006SN-E4 for qemu-devel@nongnu.org; Fri, 08 Jan 2016 10:53:20 -0500 Received: by mail-wm0-x22a.google.com with SMTP id u188so142014417wmu.1 for ; Fri, 08 Jan 2016 07:53:20 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Fri, 8 Jan 2016 15:53:12 +0000 Message-Id: <1452268394-31252-1-git-send-email-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [RFC PATCH 0/2] Attempt to clean-up softmmu templates List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , jani.kokkonen@huawei.com, claudio.fontana@huawei.com, a.rigo@virtualopensystems.com Hi, While reviewing Alvise's LL/SC patches we were discussing how to avoid duplication in some of the re-factoring work. The softmmu_template.h code has a lot of duplication in due to BE and LE helpers. By pushing code into an inline helper we can let the compiler do the hard work of optimising away un-used branches but still keep broadly the same generated code. The VICTIM_TLB_HIT conversion was a proof of concept which only slightly changes the code ordering in probe_write. The do_unl_store() conversion changes a bit more as removing the goto means the code is inlined twice. This can be fixed. If this RFC seems a sane way to go then I can look at properly re-factoring the code to remove duplication and maybe make the code easier to follow and experiment with as well. Alex Bennée (1): softmmu_template: add smmu_helper, convert VICTIM_TLB_HIT Alvise Rigo (1): softmmu: simplify helper_*_st_name with smmu_helper(do_unl_store) softmmu_template.h | 150 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 85 insertions(+), 65 deletions(-) -- 2.6.4