From patchwork Mon Feb 8 02:37:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 378461 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp4322480jah; Sun, 7 Feb 2021 19:10:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJznMn+RjmWpdY12SzmWZJ619xyv+pMLbwQpsMn3888f9m0zDupNtmUf8wnhH/kVqlt1ja08 X-Received: by 2002:a5b:702:: with SMTP id g2mr9428778ybq.285.1612753805089; Sun, 07 Feb 2021 19:10:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612753805; cv=none; d=google.com; s=arc-20160816; b=U1zMq9u4FFI5ai4PgxNjFOSUWH/TJYtNzXqrdi+Kdh+/rhwTc5gBypLoeCr6EvJfg0 we5ZUDj3uMJmmOximnvylOL/Q14ZnW4g7oA0ODAFxIm10V9viOpa42dhUGcuFKgqUPpj i89R5KC6Ny8mIzo4wNy8oVhFkp3Ssiqcm5U+vLuaaUh/6qEPwYGhheJw95m44jVdT0hC TtFue0k+CmF88orP1DeD0BKC5ZLYNsnJjajXvqPTdt/8YSYSXkERXHVyFtKylw43vk6K ll2Z9NekF2fNcR+E0aPKO6bl5GDSAfyDNf56XzWoTknGj7gj4XotJZcS13AGqkL+EGcu ADBw== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=YQBNB7jLXwaZJSYBL0BvoU6n3wPE6zwxayv+Hpeg13U=; b=wD7fmHhSupitEhVwd+JlQssgciKyf2vy63XeDHIDn/fFBF0QAsy6diJxDxbUV/xlqR hKUP3fH4mG2Ut9J/0yHHT1vpoDNEdYVZua9hvKitEd17yBUgqMymxJZeFccht/7uD1Fg 56mkpxDJ+1Dw5nrnqkGm4J3YwvmkUEswELF0kOFdyWN+7nouJ7tKq1zDcyPf/Dc62WVJ ypeJqMv/qtnngTkKbYJWJdpx7VBj4TwBO8OUEZJl+dy0rQaAzzVeO5raok+VrDLD2qe4 4IA1cYyqHqi22nPKdUy6lE/Kts2u+ndehsV9EqQjb004nRMg2WsTSKqpaUvNaWbuov+n ys2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BKmkc3L+; 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 g13si21119236ybj.0.2021.02.07.19.10.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 07 Feb 2021 19:10:05 -0800 (PST) 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=BKmkc3L+; 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]:48474 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8ww8-00026L-GM for patch@linaro.org; Sun, 07 Feb 2021 22:10:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58164) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8wRq-0001m9-1u for qemu-devel@nongnu.org; Sun, 07 Feb 2021 21:38:46 -0500 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]:38465) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8wRn-0005ul-4i for qemu-devel@nongnu.org; Sun, 07 Feb 2021 21:38:45 -0500 Received: by mail-pf1-x435.google.com with SMTP id d26so7523957pfn.5 for ; Sun, 07 Feb 2021 18:38:42 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=YQBNB7jLXwaZJSYBL0BvoU6n3wPE6zwxayv+Hpeg13U=; b=BKmkc3L+y2YKo9x6+3VASigGz1F93P3W0BTkZgKmCoCjzlZvCkap6NtC+cFlpn9TKi 8FK7+WTjMbyGLT1WBDUOOUVsJZmaLgkVbP5YTtpbx4y1CqHTuSc0nqwR7chtc/G/wxj6 iTiZesgAnBRW96qIQEz+hxSaRy34xoQEpo58u3+gdc5kvkWVkiKByTLBXvAu+jq3Bxfh KuGQcHx/loiBNSgCFAsmlMJTv5zTFOVW/4e8zsHSPhlgIeS/P3LH7BVoS2IFgTNdOKgp p8qlBBnxORbgrSv2WmcgwsvPl72AnPhaAkO1Yt8Zyc5ua5TLd7cO2LbYvWraV8gZX+3M owcw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=YQBNB7jLXwaZJSYBL0BvoU6n3wPE6zwxayv+Hpeg13U=; b=stBtyPhHeQSL0KZNxE9wdPKHwitCe6WnkGYgGQM/rVTYwvuc9D5bWT6jIq1YEB9cK5 5T2Vfl+Q4LI8SCaw/oN+UH5sBT4+k7YqT+nHhrp2hPwO0cns+DvOgM46rt8hjiqTGyoy g4SxEjzBZqXNt9pf/0t/a3U2Mx+791Vh/tt8XB1hXogCnTPXQpvLoy9Lzu4vpnWFSexK WYJ3C3O0JecpXyG8BYLOAUFw408tSJsc6ZKawhz5DUdOddUFiWvmv9Uvc4Xe0wxobMdw d4NjX0LamJF47nsnl/PywQYn9rzyCSfI6tqRxDjYD9wfw/8Tl/mey+eMzId8oXWJJGrs oMug== X-Gm-Message-State: AOAM533WI2WhFsuzNw6apVlDgMO156qK1z1giz0phv1diRmTsb1afi4M Sv57xc/WfKKrU14tvNezZoQ7veHUib/uHQ== X-Received: by 2002:a63:d446:: with SMTP id i6mr15074741pgj.446.1612751921883; Sun, 07 Feb 2021 18:38:41 -0800 (PST) Received: from localhost.localdomain (174-21-150-71.tukw.qwest.net. [174.21.150.71]) by smtp.gmail.com with ESMTPSA id j17sm16158689pfh.183.2021.02.07.18.38.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Feb 2021 18:38:41 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 39/70] tcg/tci: Improve tcg_target_call_clobber_regs Date: Sun, 7 Feb 2021 18:37:21 -0800 Message-Id: <20210208023752.270606-40-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210208023752.270606-1-richard.henderson@linaro.org> References: <20210208023752.270606-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x435.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: , Cc: sw@weilnetz.de 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 8d75482546..4dae09deda 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -623,8 +623,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);