From patchwork Thu Mar 11 14:39:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 397510 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp386332jai; Thu, 11 Mar 2021 07:00:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJwk14X8dML6FplNlQuxgy6dIIh3L3abhmPyAiNW1COBQuyON20c+LBVzlk1XokbSx5OToB0 X-Received: by 2002:a92:da11:: with SMTP id z17mr6608291ilm.45.1615474814087; Thu, 11 Mar 2021 07:00:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615474814; cv=none; d=google.com; s=arc-20160816; b=L52DK8YlI/dVKGNNtB7oEL/TQX+NjC5nUtgOzawOsx1ksqLVca1VGQRJLrRCTGtTtL A9Zcdf3B1uxI2xIsW4H3FoTWR+La5aA4ZOkcmUnvlHkpd9fpLRPrdWEmhZw8YpnVgTYp xZQrJbKK00H6Fh7N40VCMYURBuuT3xrtUPdKKY2cdrCs63VWDBDSn5c6EnXXntRyVE4L o4mTekpIklV3xjnCUf3ZIANWdbrPC1LtoXHgZGaM0WnqqV8jTm3qKRQNDwOaq0mBqtY6 AiXhEQsmzwrZiiFCLSDWEdjPr8GIWcduQ/jR903TpPEyQ/B9q4H0Z9TNyD74HeNWwUjc uLyQ== 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=d4UcJfUmSBM9VOqxvtOAW6MIP8Y392mqNvjUdLnR4KNB4Xqs8wmXJo2H373T1eDoUN +HryHdFzjFWDM4Rub4FkKhWNmUNim5mwvPjzJ2KvysGHcoBQGLXj+pRJVVdExZpCpQsA hmW3amkPWwi3mHu3p4LI4BmbXOA/ZyAixFJJHSIM0yXVBgnu0VksWN6vcVt0aEmtIdD1 vLA4t97UagWHLuyGcIDaj3OHUh4CfHNd//X/pGgAAV+CDSxZfi8GCeX5H54e+KSWhVys bKHfhZRkQP68dlDQWs5Hsa81XlauN5apTK/VddGbZV19j84fjaCBlw4CgYs5Tb71mXAO uZ7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=XyYsQi8S; 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=fail (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 c11si2840608ioi.68.2021.03.11.07.00.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Mar 2021 07:00:14 -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=fail header.i=@linaro.org header.s=google header.b=XyYsQi8S; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:49030 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lKMnN-0005nn-Fs for patch@linaro.org; Thu, 11 Mar 2021 10:00:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39912) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKMUN-0003dG-FY for qemu-devel@nongnu.org; Thu, 11 Mar 2021 09:40:35 -0500 Received: from mail-qk1-x733.google.com ([2607:f8b0:4864:20::733]:45027) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lKMUL-0006Vs-PF for qemu-devel@nongnu.org; Thu, 11 Mar 2021 09:40:35 -0500 Received: by mail-qk1-x733.google.com with SMTP id 130so20749632qkh.11 for ; Thu, 11 Mar 2021 06:40:30 -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=XyYsQi8Sl5M1QLZWcju+fpxXdo8vmpu858SeXAAqQaZisBMQGhbEDDkdCbEUr2SF4C /xrda1VgQ8wDEqiH/Jn3gDTqiTW//l/a7iaL4P4vHLatGNKJomhmzaJ0DQv7NKL7BZjt /Cp4Jtc5srrqz1p1Aze/9wYIlo3gLV4nrF9eIiYNy/Y2I9I1N9mp37+7wDgEBod9crJe WknLO9Cz11RFOCxukRPRLP9xtGFJLudCSkQF2N+V1OfLHx1bD/qZ73kntx9Y6DmtgOg5 nLeKtQiIEWwewxQIQ3pRD4BG/YGGjF5Qty3EUOmdWxjf7uWpQICJ6ESXj5Tj9SXX/Xz5 FMSg== 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=IgmRZUF3aIyxJLY28pDJfU1BaEF5CtiRXDn5yFr0NreKBNc5Xq/4kg/4ypx9FyQe/x SuCbrxmME0Ign0zjLAqSEy0O4ZJfvqPuuQsiQsWlvqSU53i5WKoXG7aLEs9vOr9bYxyE Prqf55moZsBVl7rU6SZwhEl/ejh4HShYW9hH6ha8A6mZVU85r+Q8/D1imPFtAAY5cu+d xMUsZ1KSjAjQl1lEMMLny2+QR2CQe4nedQJhG60cVwHV/B9EVioDAcuPhDxJhMiJi9+9 ukuyvlbdkfugGXu8scEOH5zapgd1wadYAT79gpvppY8nW03dsmNEWibLLFq/w6Dm8VvD 5jaw== X-Gm-Message-State: AOAM530IaerMKlDZJj1oodn7wOtlRA5K/Z/queVA/zyci7JIFHCNT4ub Zb6v8L10Yp26FsVhFo449cO/M+WbnXoQlvJq X-Received: by 2002:a05:620a:798:: with SMTP id 24mr7908872qka.493.1615473630257; Thu, 11 Mar 2021 06:40:30 -0800 (PST) Received: from localhost.localdomain (fixed-187-189-51-144.totalplay.net. [187.189.51.144]) by smtp.gmail.com with ESMTPSA id d84sm2070324qke.53.2021.03.11.06.40.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 06:40:29 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v5 24/57] tcg/tci: Improve tcg_target_call_clobber_regs Date: Thu, 11 Mar 2021 08:39:25 -0600 Message-Id: <20210311143958.562625-25-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210311143958.562625-1-richard.henderson@linaro.org> References: <20210311143958.562625-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::733; envelope-from=richard.henderson@linaro.org; helo=mail-qk1-x733.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, alex.bennee@linaro.org, f4bug@amsat.org 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);