From patchwork Sun May 2 23:57:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 430538 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp2393718jao; Sun, 2 May 2021 17:06:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwHMIyB8RiNt8gXa4GtW8MjAhl8GUuTkIkHnxHvADyKLDb62Qsu80y1C4EQEPu4kpzVjNU X-Received: by 2002:a1f:df42:: with SMTP id w63mr12656609vkg.17.1620000392310; Sun, 02 May 2021 17:06:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620000392; cv=none; d=google.com; s=arc-20160816; b=bv/NYxDCTynDejUOwW2T4znFOP3FiqbIDm1gsKOFrqEg9NHzRnHzVY5MwRuyvB+QAu oMNh6JwDVD1shrRcrAgW5lKPFLQE2vxgozWsYP+GNwuNihXU9xeTDM4bka+d/542wM3M 7um60hud3VW5hlnFIihoyrnMB9XhPJrC799he2by2LPSh3iLVChu3ucUS0oYEkjoweRC yBtp2y80/wIh4KZOXcgzE1PGNFT2dTHyef1QJudgNH1/vmRG2SqeTk7K6K1tGhMxrHx/ 4il3JnZZhVMMCb858ULIFZFKmR12QuMJdxXfWC+IX8GhTR2SYXX1GDSakTzz2ytKfACR rzGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=gfApsUVxapPN3chTec8btRYUXrbwOLgLsDlRoxJfFYs=; b=PQ4MG5PiVrgDK2XwNBFjKaBdF9iAWXOg1SzqKmFO26xIVfglUFHas/4Nu6nclWSjbF 8FAq0kVSCmD92ENwWTyG8KIrkYK/ZWaxPh3T/eaHDYKTuKkKIECyR7NQdGkMrzMwHI93 DvZzyrDyNFmh2KMu/3yI2SNT6xpJ1EnVs9HDgz5y6+/JcSPgp5Gh09WUnaNtowhT81YY wEbf6+JIC+8mNSo4T4GctC+epXQ/lig568S4Hri0HoD/tAeGujlSONqR6CmR2NyByFEa V1+1/ZfRNghYt+CWQT248XFPRR010dGIMisD5wEFAjOh/gWCsY9wu6H5kG0GqHjNxcFl bC0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AXq9iY0a; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b22si2259133vsj.133.2021.05.02.17.06.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 02 May 2021 17:06:32 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AXq9iY0a; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:49524 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldM6Z-00018c-NI for patch@linaro.org; Sun, 02 May 2021 20:06:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43614) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldLxz-0007dl-Kp for qemu-devel@nongnu.org; Sun, 02 May 2021 19:57:39 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]:41473) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ldLxw-0000aA-UX for qemu-devel@nongnu.org; Sun, 02 May 2021 19:57:39 -0400 Received: by mail-pl1-x632.google.com with SMTP id e2so1888754plh.8 for ; Sun, 02 May 2021 16:57:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=gfApsUVxapPN3chTec8btRYUXrbwOLgLsDlRoxJfFYs=; b=AXq9iY0apu8TysWSNHXo8gw+obZ/HG1vU6AVyzy2n0hWuxunurVjS6Asae1mH4TN5q 7J0md1ZiTPkkCL7THHImZR2vDRSL72aMt5IAF62c5AuuTG16Remt8XGY86GzKEs18t21 BDmFz2XwhoNYXhMK8/HDM0VgA4zc4Cd9E5zVvLCqLe+1pMJwfxgWnozMpPLL1Q5xlBSq o4PQRNsxgWpRVr5Qo3VWmInRnbHXyHGDV5sg86dKfd/Xpn+qVnEhv1BfS9v158YZYpz+ 3zXq//bVhqH2eAEX4l4e4X+s0edLlqdPJjBgTn9o1fqajdz9m4gU7jSLfcwiQDiOd9x3 5a1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gfApsUVxapPN3chTec8btRYUXrbwOLgLsDlRoxJfFYs=; b=Jit803a+qiLlRZLEbqBRx0H31yXWnSRXLshuvhMx/YeC0TtLoKpPStu/vGefBZz3x1 lvnDzkDpqyrP2zcFvj64MVGtZffc09qITjz1Ku22havvYxweyAVmYuc+zSgoBrioevoI qp/FHGRRUW+vlQkZCFIZz7mq/IQKa9OJdspi/yNFLziGdvCC6nI38DRWMYYK/JwrWwjx e6hLj7XVR2m9B8VJ081yMkQ3PuqZWOgo/sU4cpSDQfrJTIcN4UrDKdVxs+kSKsGpjswU TZJVzpr9ivHtqyVzD35NyPeQBo+x9r+gDP1Ay8STaFBKq4ykfSwG7tA22dsY++z01hlP sSuA== X-Gm-Message-State: AOAM532yVxf4PfEa2MwM5RzLHJRQm5pIeIzFVvJZvwI5v39ygKgFK3Kr lHnQ8Xy2JPbnNnHPqFJmVlmZReZp8W+BGw== X-Received: by 2002:a17:902:8487:b029:e9:a884:7450 with SMTP id c7-20020a1709028487b02900e9a8847450mr17418575plo.49.1619999855524; Sun, 02 May 2021 16:57:35 -0700 (PDT) Received: from localhost.localdomain ([71.212.144.24]) by smtp.gmail.com with ESMTPSA id t184sm8098054pgt.32.2021.05.02.16.57.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 May 2021 16:57:35 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v6 09/26] tcg/tci: Improve tcg_target_call_clobber_regs Date: Sun, 2 May 2021 16:57:10 -0700 Message-Id: <20210502235727.1979457-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210502235727.1979457-1-richard.henderson@linaro.org> References: <20210502235727.1979457-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The current setting is much too pessimistic. Indicating only the one or two registers that are actually assigned after a call should avoid unnecessary movement between the register array and the stack array. Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.c.inc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index ee6cdfec71..fb7c927fdf 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -812,8 +812,14 @@ static void tcg_target_init(TCGContext *s) tcg_target_available_regs[TCG_TYPE_I32] = BIT(TCG_TARGET_NB_REGS) - 1; /* Registers available for 64 bit operations. */ tcg_target_available_regs[TCG_TYPE_I64] = BIT(TCG_TARGET_NB_REGS) - 1; - /* TODO: Which registers should be set here? */ - tcg_target_call_clobber_regs = BIT(TCG_TARGET_NB_REGS) - 1; + /* + * The interpreter "registers" are in the local stack frame and + * cannot be clobbered by the called helper functions. However, + * the interpreter assumes a 64-bit return value and assigns to + * the return value registers. + */ + tcg_target_call_clobber_regs = + MAKE_64BIT_MASK(TCG_REG_R0, 64 / TCG_TARGET_REG_BITS); s->reserved_regs = 0; tcg_regset_set_reg(s->reserved_regs, TCG_REG_CALL_STACK);