From patchwork Mon Dec 17 15:01:12 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: 154002 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2567274ljp; Mon, 17 Dec 2018 07:03:13 -0800 (PST) X-Google-Smtp-Source: AFSGD/XWOTSPEVQn8M1jZzHeF/Cci6bPAN7kOP8cSP4Oa/xTg9NGdT4NLzJd9W7R7am3HjIaczeP X-Received: by 2002:a0c:d933:: with SMTP id p48mr13858932qvj.15.1545058993414; Mon, 17 Dec 2018 07:03:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545058993; cv=none; d=google.com; s=arc-20160816; b=WNfyJwW8WwV3xKcNEAfopQGpALZmmoP8wmZWss//alf6WSqzW22A28Wm7GJdz8mYTP 8ZNOgrxnxGpK/2bzMa9Bn0UaXr39mHQiu0NEikUvAgMuPNU/eH3U2bkth4jwLXZeLmBh esNlO9gh/oEPtOCg3W8YhC1UikOLBkOoT7++1W8VKrG2b9LPhPtikk/1bmkTEOpzIIWl ZGcmcS9n47+jDVXchr4WEfWMECdNsJr4bnZoItgX7F1UGQbk6P6wod8p6KkjT8fr46TP zWsQI5QqAhOfAAHtGCfkqfik5sXDdw1E68aUVEj5DTx5IuFdXAyAVPcAfwjXaxhoTvfn ZuBw== 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; bh=z8surCSI++Z/UVbFP2MdJm1F2uNmJ+07X0pYmKqu478=; b=z4qSzqUCMwWjVakKRsq/hmV95QI3gCJclbtv4b7nPhJFmrVNhpXK7cfnjxo3InWd23 GHl7k7R2kx2Osb5MV8Wys/AKmJKWRqfp602JFw/8cvAJK1W/qSPw3AMVlCUzKmRJ+1bM 6euN9wk5ZioffkI+W5ij0jIUQVNk+O1eKoqo4NcSRCWixcFGXCtawStghMH+OCWC3Cws CoTNSBvm9g6QbuJ2MzKahNInlX527ecgVvRlViV+wuvgVGJ1sJiqwmIBJaLkZyLjrW+r zuU3/T+zHQ5RhL6wDIuSiJX2DHjw7TRAHSRlMDyOE7Q4dLbZMgVkeO6xbXhv1wNcd8Td indA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=NW0pJnBn; 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 j14si1289550qvm.164.2018.12.17.07.03.13 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 17 Dec 2018 07:03:13 -0800 (PST) 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=NW0pJnBn; 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]:47294 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gYuQK-0006JD-Q0 for patch@linaro.org; Mon, 17 Dec 2018 10:03:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54717) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gYuOf-0005Th-VN for qemu-devel@nongnu.org; Mon, 17 Dec 2018 10:01:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gYuOe-0006s6-2P for qemu-devel@nongnu.org; Mon, 17 Dec 2018 10:01:29 -0500 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:35415) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gYuOd-0006kA-Nf for qemu-devel@nongnu.org; Mon, 17 Dec 2018 10:01:27 -0500 Received: by mail-wm1-x344.google.com with SMTP id c126so12926755wmh.0 for ; Mon, 17 Dec 2018 07:01:20 -0800 (PST) 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=z8surCSI++Z/UVbFP2MdJm1F2uNmJ+07X0pYmKqu478=; b=NW0pJnBnuNKUKYIU0OdqS+gqQVQHthSaEAjjd3oVlw73y/eUHNVfUlUF/2kZMKgqMw Fl35mB7FMuuzNvZOM/4B2g/NB6uUUNikbjBiKOAVeIjhdbmM8mutC54ExIRl6FdnR2bX OR3Ah6n54cL1EjrLzCvoebPXiMtjAouYvvf8A= 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=z8surCSI++Z/UVbFP2MdJm1F2uNmJ+07X0pYmKqu478=; b=WHKHEMko96vYMlaY8PHKNTqIO/07Zt6uaLDHYcGp/XAi1XtsjA85KAedULuKvWUatR 7bvYeR7KW/cRjTVxgiSILmMzu75RowVq02bd6ziHxYOX/RMEP6p5/r/vgA4o9x5c8C2/ v00jhcPZgdLh5wjOcG2CBincln7tLPPHQxAO1uhzp/suOmjxHsS6s94QQK+54iDSbd+9 lsT8SqUzrDpufIQODpb6hWjyzzQs3PS9+ofxkrV5sTYg+RFjVT94aS2KhcTYCBq37L8U e2Rco+aUDJET936yUa7mL/xePM9QxHmjUb2Vog1bEI/KdV/IqEkWqqI1wNbhIUt1eWwY Wvbg== X-Gm-Message-State: AA+aEWZNeRREUvPB3mF33AeW9+I0GAlAS9whLa0897HvDyG4aUmC2XBA a5oTi7zZ4/2kLgpbuticvyFj7Q== X-Received: by 2002:a1c:c44c:: with SMTP id u73mr12506047wmf.45.1545058878400; Mon, 17 Dec 2018 07:01:18 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id o81sm17481152wmd.10.2018.12.17.07.01.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Dec 2018 07:01:16 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 6B4D63E045E; Mon, 17 Dec 2018 15:01:16 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Mon, 17 Dec 2018 15:01:12 +0000 Message-Id: <20181217150116.10446-1-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::344 Subject: [Qemu-devel] [PATCH v1 0/4] de-macrofy softmmu 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: cota@braap.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Hi, This is a re-based re-spin of my RFC series with a few minor updates thanks to updates to the softmmu code. The series is attempting to achieve the same results we did with softfloat by replacing our nest of macro expansions with some common helpers. By using __flatten__ to force the whole function to be un-rolled the compiler can then dead-code away parts of the common function not used in each particular instantiated helper. This is a win from a debugging point of view - no more "where is helper_le_lduw_mmu defined" questions. I think it will also make eventual instrumentation easier because there is exactly one slow path load and store function to instrument. Although the individual functions are now bigger (__flatten__ stops the compiler ignoring inline if it wants to) the size of the resulting binary is slightly smaller! original - 73027224 bytes demacro - 66913848 bytes Unfortunately in my simple boot test I see a slight performance degradation: original: 10 times (100.00%), avg time 5.358 (0.02 varience/0.13 deviation) demacro: 10 times (100.00%), avg time 5.760 (0.08 varience/0.29 deviation) Emilio, Any chance you could run this through your more comprehensive benchmark suite? Alex Bennée (4): accel/tcg: export some cputlb functions accel/tcg: introduce softmmu.c accel/tcg: use TLB helpers from softmmu.o accel/tcg: remove softmmu_template.h accel/tcg/Makefile.objs | 1 + accel/tcg/cputlb.c | 63 +---- accel/tcg/cputlb.h | 21 ++ accel/tcg/softmmu.c | 452 +++++++++++++++++++++++++++++++++++ accel/tcg/softmmu_template.h | 446 ---------------------------------- 5 files changed, 485 insertions(+), 498 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.1