From patchwork Tue Oct 15 15:44:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 835482 Delivered-To: patch@linaro.org Received: by 2002:a5d:4c8f:0:b0:37d:45d0:187 with SMTP id z15csp306317wrs; Tue, 15 Oct 2024 08:50:03 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXz/0foJzSMSzGhjKL2ekfg7mPmTre/YfOzi8xvo6pz0xJMYY76kznGrCpF7/u9xtL06yb4Ng==@linaro.org X-Google-Smtp-Source: AGHT+IE6Y3SaCytyM026nxw1JKWVTAiZNjhdGYptnWjXSPEJvYwrki0L816jXGusJcHk81ewDzuv X-Received: by 2002:ac8:7d13:0:b0:458:2fb7:5035 with SMTP id d75a77b69052e-460583e8b95mr208005481cf.3.1729007402844; Tue, 15 Oct 2024 08:50:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1729007402; cv=none; d=google.com; s=arc-20240605; b=Kag6jahz8SdY1GFxs3Ghi6eHi3tZ2TLI/K/vohZuDjuEqkQb+zmzCNs7HBnJYgbfqo Bgye6DD29n0mJaTdHHeYm7Y6tDuQC45mjo/ijjBSOH6YhZqMUd8K5ZZdH1i72enRnI4f lC+AYqmwwbiahInpsLAhNbmSuiPwUvsULcTb8v9d0Vacl5LoX+zy7pTjam5T5VAme2gP j3vqBZpSzYbggqRFdOUlbPdADumMlgKjysjvzyPSvLm7HH3j+4wmlkaYHs0U13pJ6fQD ePSLstcuR0DGMoikAf0Og64Oc81LkK0IzTXHwrGp08IjgGmxjqD048l/MtqR09Yiv04j f5pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=NP/jQdl3vCj51cE4P9kHFWkOQjoBpIwLQmMBNAGca+s=; fh=qtn8prgQtzf5IzCNvLChUZDElvNECP6ej9YfjQeBz3I=; b=IbDgy62BLgeQBa06MRN3bnY57SZAOVel0Xsr3ioTdOXKhHb8h45oJNP6pkXhyQiW/z 9v5TziISRzlQ2P4zOq6sxj7VnbSugd4woYK81PTR3G+9JCTwY3pIME0CBRBCgQ6D1yIt tNSX2mJ6Nz7GHQTAEBBG6lH0DVxdEH8ntM5vehAHxynbHb9zYfPgVmAl/4OlyItG+ykK AEKN+Z0cIwuOdQyIYBUTj9anLpA+la6VrL34/Pg2GFkJKP+c/dt37E5g0wHeowXfyL+J nI5ei7+yritYbB6VCXnz5p8zce5MWsrfhBT0OjsUmsa0KTYePFqei+Yn5epM5yIVPrsr uQmA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=P0xnVIyk; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-4607b4a453asi17294011cf.498.2024.10.15.08.50.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 15 Oct 2024 08:50:02 -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=P0xnVIyk; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t0jmc-0001qC-5d; Tue, 15 Oct 2024 11:48:26 -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 1t0jmN-0001R1-J8 for qemu-devel@nongnu.org; Tue, 15 Oct 2024 11:48:12 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t0jmM-00014w-1q for qemu-devel@nongnu.org; Tue, 15 Oct 2024 11:48:11 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-71e4e481692so3061738b3a.1 for ; Tue, 15 Oct 2024 08:48:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729007287; x=1729612087; 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=NP/jQdl3vCj51cE4P9kHFWkOQjoBpIwLQmMBNAGca+s=; b=P0xnVIykjJvmMwrw8e4CESzUI0BZYmTpBTxnF8SVOE05KQ4fHNUy+iilIyDz1M7z/S zTLdtnIyw0nu9DW64YKqviCTTTG0WdK/t51DPLq46EKxbcnmqzWJloeLrymJRBkXuYj+ IAa/8MxLiFN8c6cYoLFsVlvW8ZsjmvFV0Qjug/5q/GmgkBaeawZg7kJ6lE3sqlASBe8o SHIuGYh2sRWm7ZO03lKRnF1YWEwIsb27Gvf07lb3u5na5j/nNRLGHqHxYR+Kw/PhUTrD r0oL7HkH9LXElHPSluxOnZq9hXPFTclJHLC+6XV7pLmMymT0Ee7jDBlTDfw4ROIPifGL +C1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729007287; x=1729612087; 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=NP/jQdl3vCj51cE4P9kHFWkOQjoBpIwLQmMBNAGca+s=; b=lx+wiccTguFuUEO/glLSTbroiqcKRWWXceTIP4qd2qqwI10NaFp6gCcX7h2dJQMu5w FJQW8P5oatIrNGn/ESBhRQIEvvKeVgyE8NsVtRLVQv8Bjf7L34CA7C+fVnef3AwG9fo5 QjyTZnLUXIGnjVDm+MoZHmneHp5XBF/9DCe4zuLudObx3wKCHKCOGDdBG3VNeaeOIBS+ 7poDlZrz1YTBr5k68e+YshXM2zC3kxPyDTCN6bntFJP1Stin+Z6Xq+XI+8Gb4FG7uETw 1JHJTixpXUeIFzj6cggPnsqOXn+zR2yA+S0MjTb43bbQHWsRY9PE/BAsqnnIPX8Cwgak iXyg== X-Gm-Message-State: AOJu0YwKaurMYS77hIwcmHtm5/6wrBCyb6DW2XNaEmU4ojtAnYb7lFJO kG52erRD+yql5LFao6pglO3HfWUYkSHS+FtiO2wQItIoh4UqiFNlszqWTyoXBdFgfh3XmcSXwEZ 7 X-Received: by 2002:a05:6a00:10c3:b0:71d:f012:6de7 with SMTP id d2e1a72fcca58-71e4c1cfd6fmr19522313b3a.27.1729007287043; Tue, 15 Oct 2024 08:48:07 -0700 (PDT) Received: from localhost.localdomain ([45.176.88.167]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71e773a3c39sm1418099b3a.73.2024.10.15.08.48.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Oct 2024 08:48:06 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 28/33] target/mips: Have gen_addiupc() expand $pc during translation Date: Tue, 15 Oct 2024 12:44:37 -0300 Message-ID: <20241015154443.71763-29-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241015154443.71763-1-philmd@linaro.org> References: <20241015154443.71763-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-pf1-x42a.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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 Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20241010215015.44326-12-philmd@linaro.org> --- target/mips/tcg/translate.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c index c0b97539a29..0ccf32d185e 100644 --- a/target/mips/tcg/translate.c +++ b/target/mips/tcg/translate.c @@ -11428,20 +11428,18 @@ static void gen_compute_compact_branch(DisasContext *ctx, uint32_t opc, void gen_addiupc(DisasContext *ctx, int rx, int imm, int is_64_bit, int extended) { - TCGv t0; + target_ulong npc; if (extended && (ctx->hflags & MIPS_HFLAG_BMASK)) { gen_reserved_instruction(ctx); return; } - t0 = tcg_temp_new(); - - tcg_gen_movi_tl(t0, pc_relative_pc(ctx)); - tcg_gen_addi_tl(cpu_gpr[rx], t0, imm); + npc = pc_relative_pc(ctx) + imm; if (!is_64_bit) { - tcg_gen_ext32s_tl(cpu_gpr[rx], cpu_gpr[rx]); + npc = (int32_t)npc; } + tcg_gen_movi_tl(cpu_gpr[rx], npc); } static void gen_cache_operation(DisasContext *ctx, uint32_t op, int base,