From patchwork Tue Jul 13 16:42:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 474697 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp4142629jao; Tue, 13 Jul 2021 09:47:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxoETzXLXFFHn3hL7K0ryBpcT4j/2aAadzZKuhAzedSB8iVvnYY+OECv/C6fMeuUbPX8gCi X-Received: by 2002:a7b:cd9a:: with SMTP id y26mr337086wmj.76.1626194839774; Tue, 13 Jul 2021 09:47:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626194839; cv=none; d=google.com; s=arc-20160816; b=RobQeTQ6i2beQkPvYstOSGOSnVswItDDcg7rnw5dLB5NdUt6L0EiL6nycsq+HtW81z 80ZX9yL63BVjT0uOLicKCYKupsVzcGuJhACgD3ubXul7SxZW2YWuMiP/Fr8mQyAdbeC6 USPNt0oyLj992Jg/YG5OZFqA41rFZxb+B35ZbC81GSLwXsQ5dDKhdb3lODBfDsr9A7rd KrdmIapExmTRohX49Wrnz/69JYWD+5mEEzRYPHVU5GI+4GciDYKZx/ktkeKCPAXdtRk9 /sLuLKB7Qu4yVxDwBcaRicprY7ORFDojTHhvi9io7/mva5iPKR8SkHmdinBisTZqCNgF k77g== 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=UXF13QTS5AJHAq5VT/9hnMvu0uSbL+4zu4FScleCGMI=; b=gr9LKDqLuhMP4E0oIJ3EHgLylGicE7QfDV6yLknDRZpMZSh0jtE7FT+h/yNmwDmx1w KMK49SIx4Y1LRbJvTCCYEQUtvh9zg0Hx9rZfOCKtB4GF8BpRWj7Ma1BsQi7HpxTRMGFU BTMLvXOCcmxwsJnwCQEAEssKVu88HQiqDoTm6vNpSsZzD0OqGKlLCOCffdkzHma40uT8 VkJ6miWd+Wxkrumd0yB0eKFHfAfQ9C7Co0j0h2lDOvvBULPzgm4smjMN6NC5QjxIM5fe U1C0Feq+F/y84KFEOeFfro0757G2iZD/+bhOPTgy5tx2WJ52PKyvZOkY6q4bY1hYRT/E BYdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=auIbAaMZ; 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 u17si24629090wmq.148.2021.07.13.09.47.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Jul 2021 09:47:19 -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=auIbAaMZ; 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]:40846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3LZ0-0001DO-RQ for patch@linaro.org; Tue, 13 Jul 2021 12:47:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41160) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3LUD-0006tR-7R for qemu-devel@nongnu.org; Tue, 13 Jul 2021 12:42:21 -0400 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]:46920) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m3LU9-0005fH-MX for qemu-devel@nongnu.org; Tue, 13 Jul 2021 12:42:20 -0400 Received: by mail-pj1-x102d.google.com with SMTP id b5-20020a17090a9905b029016fc06f6c5bso2490232pjp.5 for ; Tue, 13 Jul 2021 09:42:17 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=UXF13QTS5AJHAq5VT/9hnMvu0uSbL+4zu4FScleCGMI=; b=auIbAaMZJ8l3mhaJmIb7KsrJTMttOAlcM/4UPIF2HR4ynwPWgZdc+IsL2Nbs8aDdia g2ARGztMRVTyPPJa/EHOcaovZafy7yNnJIWGo+xwlLDYKGidzjVu4UjzX7KQ/SFSVBqN HGqLv9w83E+yUyuIUuTkzoKVbga/0cFV4ORL2VIHKWPNUuKbI/ouVIO6XCDKteINdf1G 1HBhmZwh6fg2Hmti2zRSODbtc8iOFk391v9UlPkulsXZ1DltlTDOOE/KPSZZxRwKQrT8 ugN9TGBlfR2B7vRf5fhMyZ0JrLVa/V8reS9sRQMnwr9sTuxfcVp+hiDaEnsmVxxvpukz c1zA== 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=UXF13QTS5AJHAq5VT/9hnMvu0uSbL+4zu4FScleCGMI=; b=hzsKOCQr5S49zGXUNXTzb86u7f7187xZQfV+3+R2uCbB4PNI/Ik2EZ/SDWvnMcRIOh JCIJGaWI3hOXQenj2Ua11XuYc9oMhb+HwGsZtA1QvWZb0HoyN4zkccGkt7iL/xyrO6Mq g3qvfnXIns9jr/CAOGxrB1aTc612O8X4Y7HtCrQKce2pjLZSdToBfyFvhuZQ22/+dk2H edvie6xRDFPEXrNozEujYj1YaYLb4xSMtAsBkXAnqM6VQN5Vf0ZmnN58w92WhWDctDrr UpQwg64u9UF6g6Ji8Hwywe0w8rYpCDEqAuVEH4xNpn6skSdD2XVWEial5Fj62O23yDa7 +2Xg== X-Gm-Message-State: AOAM532FQiL02Q61nfbwOBt2ORIM49uuoxgRgG0YnnRMVhenJWRL8NJy e1qrgfAnBgyo6Ry2puK0+wdlkczhs+x6eg== X-Received: by 2002:a17:90a:1704:: with SMTP id z4mr207727pjd.213.1626194536418; Tue, 13 Jul 2021 09:42:16 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id z13sm4947865pfn.94.2021.07.13.09.42.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jul 2021 09:42:16 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 07/14] target/alpha: Use tcg_constant_i64 for zero and lit Date: Tue, 13 Jul 2021 09:42:04 -0700 Message-Id: <20210713164211.1520109-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210713164211.1520109-1-richard.henderson@linaro.org> References: <20210713164211.1520109-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102d.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: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" These constant temps do not need to be freed, and therefore need less bookkeeping from tcg producers. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/alpha/translate.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) -- 2.25.1 diff --git a/target/alpha/translate.c b/target/alpha/translate.c index 64c4865dda..58c0e08c0c 100644 --- a/target/alpha/translate.c +++ b/target/alpha/translate.c @@ -66,8 +66,6 @@ struct DisasContext { /* Temporaries for $31 and $f31 as source and destination. */ TCGv zero; TCGv sink; - /* Temporary for immediate constants. */ - TCGv lit; }; /* Target-specific return values from translate_one, indicating the @@ -157,7 +155,7 @@ void alpha_translate_init(void) static TCGv load_zero(DisasContext *ctx) { if (!ctx->zero) { - ctx->zero = tcg_const_i64(0); + ctx->zero = tcg_constant_i64(0); } return ctx->zero; } @@ -177,14 +175,6 @@ static void free_context_temps(DisasContext *ctx) tcg_temp_free(ctx->sink); ctx->sink = NULL; } - if (ctx->zero) { - tcg_temp_free(ctx->zero); - ctx->zero = NULL; - } - if (ctx->lit) { - tcg_temp_free(ctx->lit); - ctx->lit = NULL; - } } static TCGv load_gpr(DisasContext *ctx, unsigned reg) @@ -200,8 +190,7 @@ static TCGv load_gpr_lit(DisasContext *ctx, unsigned reg, uint8_t lit, bool islit) { if (islit) { - ctx->lit = tcg_const_i64(lit); - return ctx->lit; + return tcg_constant_i64(lit); } else if (likely(reg < 31)) { return ctx->ir[reg]; } else { @@ -2992,7 +2981,6 @@ static void alpha_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cpu) ctx->zero = NULL; ctx->sink = NULL; - ctx->lit = NULL; /* Bound the number of insns to execute to those left on the page. */ bound = -(ctx->base.pc_first | TARGET_PAGE_MASK) / 4;