From patchwork Mon May 13 07:46:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 796529 Delivered-To: patch@linaro.org Received: by 2002:a5d:452e:0:b0:34e:ceec:bfcd with SMTP id j14csp1884465wra; Mon, 13 May 2024 00:53:35 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWgpS/uBizVmG0aJPQqRykiiuYlygUUFvNLArNqpNDsdOkrNgMoN48iNUky/1Ob6O7eMliBtgupMaA3W/qe7eqC X-Google-Smtp-Source: AGHT+IFHAPJfKf6HV8ER/somqSufVtkLQA/EWXSdBS1MSPsqyvv/V/xey7mvAo0YVR2CY8VWXUUX X-Received: by 2002:a05:6122:d95:b0:4dc:d7aa:ccf9 with SMTP id 71dfb90a1353d-4df8834b383mr5778364e0c.12.1715586814979; Mon, 13 May 2024 00:53:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1715586814; cv=none; d=google.com; s=arc-20160816; b=IvcBlkr6di1PvfIioAUOq455gwzMZUe6WfI9huEyzZp3Xz5T2+WxF1v5xH8PQ/zEEE yZK/Kf1Steazi+TLeXZcai2U6MpBxeZmAku9DjipkThYstwCvCqzN8/Idi2mhRagEu/b o2frN4LlVAZqh5+j4zHiv0KQE4Vk8qPWApgtuaVgE6w4p52VOPc7OuVKTBACsSMkaZI2 lZH5MO7g2LSiwWPA/5XaL9IJ2wwRSg3Ekrwk+Oie6qtX7BkVcYm0/h8D32tBQt6xoL2e ZXLZXcgLUuFMPeu+uSrz+N1F6IH/HKEG7+DlLsx9IgWbrnqtURUqlhyl3toJPnStWhGu SieA== 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:cc:to :from:dkim-signature; bh=qKPKqoJyvGy1vMUAPJNKmuXb3GsYUFhU8QNMCUCZlFY=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=klpXnkI0d4l+WyqKsUiqY1gDuO5BFsMCBrFl5TnPSH+v5f01/cpg9WOBELfwjdOckI yJoTgHakEvhVEWD5bm+Oh5rfKou1hBMkc6bJ14PRDE0VJ8tR92qV7vB1OMjWoKzLZnLG 21EOgcLewu8mEDMjqY5ipxkEXO5cDDF1n9dpTO6wA5Pe23nnrv58E0J8t+wudD/Kczfs fSC4CdzekU6AkWYmTPsBic2ru+0tuUC84wsQmNPj1IDWqq4LxXyAaJP8d0qT2V5KWFvW f1o0Ea+Av4uy7x1zutqfzREgDCY/dEPPN0wdzZUwopEXEKTgOfI+/XCvg5k2FdqemMDN 9nsg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cs8+DM+e; 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 af79cd13be357-792bf30b2casi961133385a.244.2024.05.13.00.53.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 May 2024 00:53:34 -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=cs8+DM+e; 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 1s6QQ0-0003KK-4P; Mon, 13 May 2024 03:48:20 -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 1s6QPC-0002mj-Fg for qemu-devel@nongnu.org; Mon, 13 May 2024 03:47:30 -0400 Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s6QP9-0001L1-M6 for qemu-devel@nongnu.org; Mon, 13 May 2024 03:47:30 -0400 Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2dfb4ea2bbfso46219841fa.2 for ; Mon, 13 May 2024 00:47:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715586446; x=1716191246; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qKPKqoJyvGy1vMUAPJNKmuXb3GsYUFhU8QNMCUCZlFY=; b=cs8+DM+epqTnfRXHdEfzFGfp1CTT02EcInoRAVX/R0af2JV7eUPCJOQnUZUE7PrDWJ +K0JTilhUp0aWNNe5HH9+yvuVBozCblUINwURiujhm22ql+bVMHneBTWAz7ZPHq9Nh7A oq1x89jXP3XGRsYuzxKcCYU+mLTuoCDMpEz0sHk7ASpcrBfwtardOJPtIa317IVC5Ji+ eIZR7LAO0344CWHJsf1+OLBy0BCYleRbPeu10fJ/RyF9fgMHk2wWpx1cdK9oNQlOOI0o sDk3YeAuecqW6F+nlBmymEIMYS4NB+JJ4dtvhxI96+xCYguYX+JjEvfADhTm9yFwZlyz XCLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715586446; x=1716191246; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qKPKqoJyvGy1vMUAPJNKmuXb3GsYUFhU8QNMCUCZlFY=; b=KSgM6hDQCzOpsMIPrtBLU3/OLtQrgVLBww8BuqS2PuwPA/aVQ3w8kOPx4XTTAcVMSx GddafGoKc/sfE3Xns0MKTysecLREqxIkc+K3GRy8TBB302RlOgAcwUnC9jFhyMWs/+2Z l5it6YSCKynE/+C2QhkhUJfatIixDMBwI4EyQqjOabKLTHQgqR8IH6h4/bjcSRzfDl53 HxcOV1dj3tfHO8JAlJeCAWVTy9BekFXTKJmcXJIC0FRZJTODMTsLBrk+73qqjGHZv3I4 rRT5sico7qYMs047wpqk4Zjh94Y/TO+U/1KfWKvvdQYhO8EhWSIPcgx7cesu+/EZgZhc d0CQ== X-Gm-Message-State: AOJu0YyrPfY6JUq5hNYSHJAFmnVGS6wDQs3io22UkUwvElez3Ryk+Qvx s+ejBZ04TgdeDqSVEusrcndSmUvOLNiOBpe8XPnCMM4cY3f6tR5XfHel8JpgJs66AC0DHqsPScm kG0I= X-Received: by 2002:a2e:b01a:0:b0:2e6:a0b3:24a3 with SMTP id 38308e7fff4ca-2e6a0b326fdmr10299631fa.4.1715586445704; Mon, 13 May 2024 00:47:25 -0700 (PDT) Received: from stoup.. (12.red-213-97-13.staticip.rima-tde.net. [213.97.13.12]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-41fccee9318sm148204765e9.30.2024.05.13.00.47.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 00:47:25 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 09/45] target/hppa: Delay computation of IAQ_Next Date: Mon, 13 May 2024 09:46:41 +0200 Message-Id: <20240513074717.130949-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240513074717.130949-1-richard.henderson@linaro.org> References: <20240513074717.130949-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::233; envelope-from=richard.henderson@linaro.org; helo=mail-lj1-x233.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 Reviewed-by: Helge Deller --- 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 f816b337ee..a9196050dc 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1806,6 +1806,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; } @@ -1862,11 +1863,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); } @@ -4630,8 +4626,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); @@ -4683,14 +4677,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; @@ -4741,7 +4729,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;