From patchwork Wed Apr 24 23:59:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 791757 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp1116133wrq; Wed, 24 Apr 2024 17:03:16 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVYXP1feS3MFHGzaNo4VJBg+QbJ7qx4sdADrVWQn4bPSLNmffPDqRWU7RcXSzGpf+RIi627ohPI7NkwkF+zv3TF X-Google-Smtp-Source: AGHT+IFY5gAnnt2L5ja9dQ0aWepYL9jXytpage/QR2oCYqQHThaE+d1p7Yj0729Kji7u8ZBXpwgw X-Received: by 2002:a05:620a:1991:b0:790:9655:c5e5 with SMTP id bm17-20020a05620a199100b007909655c5e5mr2324369qkb.31.1714003395733; Wed, 24 Apr 2024 17:03:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714003395; cv=none; d=google.com; s=arc-20160816; b=pVTSEXBn82GVQzohwocbSClIbFLYh0QNwE/9HhIjrc+qwi4Dh8wz/iwtK0yoytge5F dfET7HMPevPRMAyomXrPTi3MXkIslFoIg8Y8i7mjt5KnvB+xk3cPshXTlVT0C9TUK+1p 8K/URnoiiVAeixqx9xr5yJdrUhAyZ3myztGZ4mrZy8PVMEUSqD3mofGRWBF2d7V/sJpS 74ommI/QBXw1HwcCN4b6oKieOuRxQYqElyi9RDROFtK545F3lC4AZmCeqR9kNJiM8wMW OxWuIfywlfSiHZ8H4G1kFiTxi+j0xeHiFiXnIkE8CV2Z1yXeWjEiedgGjEXxXQHXBtTy poeQ== 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=oF8t7cQPLARGajCa4VkThGHVsE7qiWEOEtD6odytNQQ=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=qYP0JXOGp7DR67FqID2ZkO8uLYLSgk8f6WADYRZMZ2F7S2sKCqWmO8Hng0M/5d1dlY pwlKWI6hpRN9hnDQq+fSqt3lrSVEEepTbQQ3Kw4w4h5wtgarCKJAAi/nxQYFYi2AjE0h /dDEAeJOXUN/H0XEWRAyc14zKy0P6KYtCiLC2deJkS1qNQJj+0d4GDecSm42hPbjUg4X ed3qggH3auAOTvgwSZmbhtJY1uCbMvY5I8NHDw81z7anVXnMWBfk1ZalMpfmPbw5/klu WQ4EUg2VP8HAt+lmFSf18UyD2EcCi9aawKBMGhK2Jrjx64USJIvmv0dupdVnSH/P4soK Gtpg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gCjuLkBk; 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 j29-20020a05620a0a5d00b0078f1530f4dfsi14679210qka.24.2024.04.24.17.03.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Apr 2024 17:03:15 -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=gCjuLkBk; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzmYD-0008Or-Nn; Wed, 24 Apr 2024 20:01:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rzmXZ-0008Ad-Gs for qemu-devel@nongnu.org; Wed, 24 Apr 2024 20:00:49 -0400 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzmXU-0006BI-VM for qemu-devel@nongnu.org; Wed, 24 Apr 2024 20:00:39 -0400 Received: by mail-pj1-x1031.google.com with SMTP id 98e67ed59e1d1-2ab88634cfaso396050a91.0 for ; Wed, 24 Apr 2024 17:00:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714003235; x=1714608035; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=oF8t7cQPLARGajCa4VkThGHVsE7qiWEOEtD6odytNQQ=; b=gCjuLkBkx7pIGDwqcboPjPDXZCsWoVcwzWbeKgmhfx4KZ+wHSXTd5VgxSFbH2kzIix eQgZWJOufQAk9H2lsp4bX1nA/k9tGf2noDEmHdoKXVBG9w8Ck8uQW/rDUFC7ZTOYYsc3 SSVMEp2GfNrH+zv3kHcEPfHNL+4Dx2/irvTd67rqiLeQrXOcwxtKLLXC2G8ucMUBEdnV zw8vZDNovEX6lke9bhRLJjx75MmBgl1CfGhfZDdQ5uyZeGQk2PVANTF3dYyNox7TD9EA exiYHS0xnOYAsMJdefI5PbJP//I4uZu7lNLbk/nvG5cmQsyIiO1xSeJqxJdZqeNn4z1/ 9w9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714003235; x=1714608035; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oF8t7cQPLARGajCa4VkThGHVsE7qiWEOEtD6odytNQQ=; b=KDdfQf7B2Sz4sFt9Epxi+VHke9jEtfqAmezGjr+dlm+y7Hk4udUwsrO9PT9VZehY5T 6cJ7IgmS8rWk0vP3pddxr0kk6SWF/OJ9JKuyG2A7FeF1yPTIYXp/S8NImt9vpwsvND5U A1GVl+Iz50qXAwct2Sc6WYF/Rsak2WywKdZO3PKh3KqJpgLBh9QrTXMP70RmtlIzyS3t a3M2SE2eLQTib1BOep/q/fTfUY75aOw2nvrEy8CqG+g0CCRpOlUzBSv7p7jUuCLn105z xiqnrEfgr4Kgl+vF+Jt9ap4fHxpE42KNGWnmQicAiuZT37WFGxm6tCzeac5/nSubvZ2y Nynw== X-Gm-Message-State: AOJu0YwAm6O4uEHJQEDrR4RgHMODxtNnPHUGaYZ8IyMuSQZXAOZK4oJS nREZbjR2xIdeNKKRFN0ZK/SJTdtgBJtNOwCez3iBnJ0tCyoy9cPGgpmViZ6caVmt+Qce7W5wi55 z X-Received: by 2002:a17:90a:4a03:b0:2a6:c395:1b95 with SMTP id e3-20020a17090a4a0300b002a6c3951b95mr4225371pjh.11.1714003234891; Wed, 24 Apr 2024 17:00:34 -0700 (PDT) Received: from stoup.. ([156.19.246.23]) by smtp.gmail.com with ESMTPSA id t6-20020a170902e84600b001e604438791sm12465715plg.156.2024.04.24.17.00.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 17:00:34 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 09/45] target/hppa: Delay computation of IAQ_Next Date: Wed, 24 Apr 2024 16:59:47 -0700 Message-Id: <20240425000023.1002026-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240425000023.1002026-1-richard.henderson@linaro.org> References: <20240425000023.1002026-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1031.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.29 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-bounces+patch=linaro.org@nongnu.org We no longer have to allocate a temp and perform an addition before translation of the rest of the insn. Signed-off-by: Richard Henderson --- target/hppa/translate.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 195a0e7e79..ac181180a6 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1805,6 +1805,7 @@ static bool do_dbranch(DisasContext *ctx, int64_t disp, if (ctx->null_cond.c == TCG_COND_NEVER && ctx->null_lab == NULL) { install_link(ctx, link, false); ctx->iaoq_n = dest; + ctx->iaoq_n_var = NULL; if (is_n) { ctx->null_cond.c = TCG_COND_ALWAYS; } @@ -1861,11 +1862,6 @@ static bool do_cbranch(DisasContext *ctx, int64_t disp, bool is_n, ctx->null_lab = NULL; } nullify_set(ctx, n); - if (ctx->iaoq_n == -1) { - /* The temporary iaoq_n_var died at the branch above. - Regenerate it here instead of saving it. */ - tcg_gen_addi_i64(ctx->iaoq_n_var, cpu_iaoq_b, 4); - } gen_goto_tb(ctx, 0, ctx->iaoq_b, ctx->iaoq_n); } @@ -4629,8 +4625,6 @@ static void hppa_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs) ctx->iaoq_f = (ctx->base.pc_first & ~iasq_f) + ctx->privilege; ctx->iaoq_b = (diff ? ctx->iaoq_f + diff : -1); #endif - ctx->iaoq_n = -1; - ctx->iaoq_n_var = NULL; ctx->zero = tcg_constant_i64(0); @@ -4682,14 +4676,8 @@ static void hppa_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) /* Set up the IA queue for the next insn. This will be overwritten by a branch. */ - if (ctx->iaoq_b == -1) { - ctx->iaoq_n = -1; - ctx->iaoq_n_var = tcg_temp_new_i64(); - tcg_gen_addi_i64(ctx->iaoq_n_var, cpu_iaoq_b, 4); - } else { - ctx->iaoq_n = ctx->iaoq_b + 4; - ctx->iaoq_n_var = NULL; - } + ctx->iaoq_n_var = NULL; + ctx->iaoq_n = ctx->iaoq_b == -1 ? -1 : ctx->iaoq_b + 4; if (unlikely(ctx->null_cond.c == TCG_COND_ALWAYS)) { ctx->null_cond.c = TCG_COND_NEVER; @@ -4740,7 +4728,13 @@ static void hppa_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) ? DISAS_EXIT : DISAS_IAQ_N_UPDATED); } else if (ctx->iaoq_b == -1) { - copy_iaoq_entry(ctx, cpu_iaoq_b, -1, ctx->iaoq_n_var); + if (ctx->iaoq_n_var) { + copy_iaoq_entry(ctx, cpu_iaoq_b, -1, ctx->iaoq_n_var); + } else { + tcg_gen_addi_i64(cpu_iaoq_b, cpu_iaoq_b, 4); + tcg_gen_andi_i64(cpu_iaoq_b, cpu_iaoq_b, + gva_offset_mask(ctx->tb_flags)); + } } break;