From patchwork Fri Apr 20 15:50:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 133896 Delivered-To: patch@linaro.org Received: by 10.46.66.142 with SMTP id h14csp436846ljf; Fri, 20 Apr 2018 08:51:19 -0700 (PDT) X-Google-Smtp-Source: AIpwx494qUH1eq/CNtHGinXincTnMYKmCxM+4+r5//+9yVOVT6AohuPSOYsu3GzQ5zyobG71F4mv X-Received: by 10.31.164.133 with SMTP id n127mr8370425vke.102.1524239479201; Fri, 20 Apr 2018 08:51:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524239479; cv=none; d=google.com; s=arc-20160816; b=OSPJhvj1lEcswq6JlvVDURBbP3/Jo64sEM/Eswt29Z/2XnWfsCFFfDoKBRNE8fI4AQ CpZyVZYofhNLGoqpaEYKJ+nVaTGUID4Ty0gesBx1ul1aRTTzdBNgm4eG8yGQsY452rpT r/mzGv9dFdP0U8Gmc0xUipU/V2ifKJaqo42bwB4ilThaGpaT6A/VP6COklseP5qUiB8h Yiy+w0DLNWn5Mh6Iidr1rA/HZpeHI7MAmOV6sW0yFXSHZzKvzaqSkEBNbI5iBETKq74I EdDCxXEaFQAjDjhQR3AgxUm/5CGqKMZoDDSppe2kGd2rMX9EPKaN0HVo2jchxf6zTPOE ZBMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:message-id:date:to:from :dkim-signature:arc-authentication-results; bh=TAz6Rzdy7s9c5enJlWqcGzy8S0yrsoYQEPZQc+UUzco=; b=yWqfDK1NPEkXiUidm+wjQiwC3bexurQzpOVAf0EHFS7no2tqjKamETYwwhkJtTfgLJ o9KUcSP6rxZDMJnw0ZDawDXZg3BW1obMwiz5EiMHbOk3f5dIEopHlCNdkirFvF9V8qxj PhcNSXXHF4tAtcCbcak2kauRjNki/MTsgNARMwlF0vfS3oxsaekgQ87Fz9gDrlUwsf4H Sr5JoVW9eZMD4fraWzpIYscoN1zR7MgRdyUpHkbTRDuPm+gkMtqiclG9bpek0Cd0/31P nanYDnBWVksLRHxJSSTQ31SvaCygUmOld0nhlouzp0uUOs7fe111a23vKdd+9Tyaz38u /t0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=RXp2n/i+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id p63si2117534vkg.205.2018.04.20.08.51.19 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 20 Apr 2018 08:51:19 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=RXp2n/i+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:39035 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9YJi-0005wO-JV for patch@linaro.org; Fri, 20 Apr 2018 11:51:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50794) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9YJH-0005v8-Km for qemu-devel@nongnu.org; Fri, 20 Apr 2018 11:50:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9YJE-0005od-E5 for qemu-devel@nongnu.org; Fri, 20 Apr 2018 11:50:51 -0400 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:39959) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9YJE-0005my-69 for qemu-devel@nongnu.org; Fri, 20 Apr 2018 11:50:48 -0400 Received: by mail-wr0-x242.google.com with SMTP id v60-v6so24200172wrc.7 for ; Fri, 20 Apr 2018 08:50:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TAz6Rzdy7s9c5enJlWqcGzy8S0yrsoYQEPZQc+UUzco=; b=RXp2n/i+fceyvj8ci89tVg4VPPXASOBJTrgnqdWHoX0+FZ2y6UXyhIkdytGtTQEvz3 692aUohaLsUbQcvLvngcSsmYBlLQaxeU0b931xXmbl/1ziUZKIOP3wQhmopuGgcXUH5k Bt58zH8xtD51CoeL7n95VZR+6gAos0pR/to1U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TAz6Rzdy7s9c5enJlWqcGzy8S0yrsoYQEPZQc+UUzco=; b=PUwk93yACszL0hrxcHI8TxnfMvjg3fBqC1lNaUK7k/37zPLP1EJWwlwQH010+ljT9Z jKGTTwXU1QVq/h/ye7fIokFY9U46LhkZrU9mVp9RG6HxP+JHkmPBLFNLk/D0lO8pb6nl FH1BxRL0q76m5FWxR606KzWRMtfLCgsm6r+0T0rV+bYnmbeDffQ/H94F4DUSdlTaCiln /tmd/3YbDuVedr+1Z5qXiUtlw3NJWYobjIKyllnOZu3H5LhflnMCu86Vug+s6UK+aXqZ 2Z0WfYKBJGac1k2mZocmR9zQ9vr+4Yf3B9gVwFNqopo1TYUaILJcSWAar9ELM4/AdTJs twzw== X-Gm-Message-State: ALQs6tATEKCW3qPsmVFs0BE7LQzXmTTUyZBKqHzWCbEHAnYuxXQujCI3 h9BCVl19IKcdA6hNzJjTw/k1Tg== X-Received: by 10.28.55.9 with SMTP id e9mr2435186wma.20.1524239446525; Fri, 20 Apr 2018 08:50:46 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id y68-v6sm8348436wrb.91.2018.04.20.08.50.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Apr 2018 08:50:45 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 208CA3E031E; Fri, 20 Apr 2018 16:50:45 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Fri, 20 Apr 2018 16:50:39 +0100 Message-Id: <20180420155045.18862-1-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::242 Subject: [Qemu-devel] [RFC PATCH 0/6] Convert softmmu-template into normal code X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , peter.maydell@linaro.org, richard.henderson@linaro.org, pbonzini@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Hi, This is very much a Friday RFC patch but was born out of a chat I had with Richard at Connect about our experience in the re-factoring of softfloat. The basic premise is we shouldn't need to jump through macro/glue abuse for stuff a decent compiler should be able to dead code away at compile time. Instead we can write common functions and use __flatten__ to force the compiler to evaluate the result of merging the inlined code as one complete blob. So far I haven't been able to measure any difference in performance on my system compile benchmark. Why go through all of this hassle? Some justifications: - no more "where is helper_le_stw_mmu defined?" - easier debugging in gdb - no duplicate code for be/le cases - more accessible code I think there is also scope for more re-factoring and clean-up in the code generally. I considered looking at the atomic and ldst templates as well but decided to see what reaction the softmmu conversion got first. So far this has had very light testing for aarch64 guests on x86_64 hosts but it seems stable enough. Any questions/thoughts/comments? Alex Bennée (6): accel/tcg: export some cputlb functions accel/tcg: new softmmu.c with DATA_SIZE=1 accel/tcg: add DATA_SIZE = 2 to softmmu accel/tcg: create load_helper accel/tcg: create store_helper accel/tcg: convert 4/8 byte access and remove softmmu_template accel/tcg/Makefile.objs | 1 + accel/tcg/cputlb.c | 61 +---- accel/tcg/cputlb.h | 20 ++ accel/tcg/softmmu.c | 497 +++++++++++++++++++++++++++++++++++ accel/tcg/softmmu_template.h | 435 ------------------------------ 5 files changed, 528 insertions(+), 486 deletions(-) create mode 100644 accel/tcg/cputlb.h create mode 100644 accel/tcg/softmmu.c delete mode 100644 accel/tcg/softmmu_template.h -- 2.17.0