From patchwork Thu Oct 20 12:21:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 616791 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp348431pvb; Thu, 20 Oct 2022 08:37:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM65Lch40Nv4uVl/eg+2H88hVOACnU9agYaZRFGO3cltXyoz5Wn4+tzqG7nNZi6xxGsPfRCI X-Received: by 2002:ac8:5e54:0:b0:399:e614:3b0b with SMTP id i20-20020ac85e54000000b00399e6143b0bmr11703115qtx.89.1666280265084; Thu, 20 Oct 2022 08:37:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666280265; cv=none; d=google.com; s=arc-20160816; b=FDJhpYbgjgNegft9FNeI2tokCxhoX7lTzqVcb1QdMYfW6tA+b/YMDQrn6zt4pGafcO o/Ta/6oiSvvzNWruiOj6hKy2Tq+SgznagdJsPXstPpiM1FiURmdfh3/Ol+Seq9KvNzxj zqFeSBifViqCOO3GY6nwEXUJ5VvEF3JGGBENJvAhUjq+A3bJyJbQKm/VUoMiOcqw8Typ Boc/ObG4+h38po5S1kk13vchf5cyN8leSPTc+48L7kfUzy3+IuREKxKqdfAHzJxQlHnj O05r6e7xNk6+ilPmjHGjRBuVfHGt+7qzwq6rgwu2xy+tP/e4WJJrJEogmSvPfYVVmBGD tW/w== 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=x/W3YkfaznZAYyZCbVAFL8NmzfZ6dPSqWWMDIBipNM8=; b=w6qiTvX3q/Ddj0tUGzK/eq+3fdv/+JVjhqJCWlMEtLhvAmgTkuQW1+Q61cN0Dc39Cj 1zXTuA7U2OnDNPA1wZYqm1d5i5ISlAQFkcyzaAazei84iFYB5ckPP/x2HnaEDM0mtpld lpR6f9L83BaUHwa3bRZe1ypKwzXablrqZmvzWtIlU6reZQVsKEw7vZpdH1e8Q7nvR8ES gNfasZph6j2B9dglqDrj7y/X2hyHI2MYTaEZrKwmULs+oxUbn3tzsP2qNxDMIpvAJiXm 2WBJqw5EkagiV4jdO4I6ezkOJiUzEoUNcXk7J+arQoSdgDyglB0uNueBlt8pyRKT3sIN A+JA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=owkWYdUw; 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 f22-20020ac84716000000b0039cc5347753si9889070qtp.695.2022.10.20.08.37.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Oct 2022 08:37:45 -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=owkWYdUw; 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]:48774 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olXc7-0001hF-5u for patch@linaro.org; Thu, 20 Oct 2022 11:37:43 -0400 Received: from [::1] (helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olXZ7-0000JK-2q for patch@linaro.org; Thu, 20 Oct 2022 11:34:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58196) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olUZL-0001b2-NI for qemu-devel@nongnu.org; Thu, 20 Oct 2022 08:23:00 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:42524) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1olUZ1-00016k-4V for qemu-devel@nongnu.org; Thu, 20 Oct 2022 08:22:33 -0400 Received: by mail-wr1-x430.google.com with SMTP id bp11so34123429wrb.9 for ; Thu, 20 Oct 2022 05:22:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=x/W3YkfaznZAYyZCbVAFL8NmzfZ6dPSqWWMDIBipNM8=; b=owkWYdUwpB/bdcdNRRdNmzFo9tCi/ZHHgEH4u3pEH3ge45RXu2UIRVJg8ZYfJsqKve BDtLGBVmTGdelIqtNN9ZctCPwm22VESWLEYxLjJYLtobMrcbA7QKtQv5vVvrQeMJXbdY FJ4KaS5+mdbpn0csAAXyu/vdUkPuEkGKlo7+C0LbGhobu326RtUioK3Twy5BGHLSRQ6B R9sYO0XR9ObuqEr405EhcXTpUYvALA778qXwjTO4cCHW6TTFLyVGgQ3Z+6V7cqoF6Ehj i5xlBJrSYZdcxKlwNVZQqMqY0+4uT1Q5Ri0bg6umZO8Sw0lMUwo/oA5bbdthRqEd/nkQ Z5ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=x/W3YkfaznZAYyZCbVAFL8NmzfZ6dPSqWWMDIBipNM8=; b=zlNNVjO+/pCCWliu162I3bWDu7hiz+64K70YwoY+qo2sE7RmV3Wi/yLVa3QyQLc25s GCm8ialwa9n5nvkfvNPn/+sNcBx5yFIWUI58+WpcTF+zdVFETg3SAOeopTITNzw8G2gU Ek3AMNxdqNULv0wA96zhkbNWTeucahtD+z1HBntwG0Eo/BY0TfgdGUxHJ/eVCJmAc306 c5olkkcP1Win3WDaUuJAETvXWEnh6vU7m+WFjDZlFqDfQ1SjUKoKDDUpLgj3xaB7YKk2 vqzTZEYNQmHVlB06PF9sAPnCSizsFn2Z9DnE20yqIuwDs+WjTmmhNQFkCFnXGxLpQ15u tU/Q== X-Gm-Message-State: ACrzQf1QRDiy6tk2ZBMW9EmnYoLDlctugmlq9IIdJ7gC6xCmAjb6fvhW aHM5hAVAu/aL+tDim7UzkCVCOLzlXHbKCA== X-Received: by 2002:adf:d226:0:b0:235:d9ae:1de9 with SMTP id k6-20020adfd226000000b00235d9ae1de9mr2037431wrh.599.1666268533542; Thu, 20 Oct 2022 05:22:13 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id t15-20020a5d49cf000000b00230c9d427f9sm16520192wrs.53.2022.10.20.05.22.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 05:22:12 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 19/24] target/arm: Remove gen_exception_internal_insn pc argument Date: Thu, 20 Oct 2022 13:21:41 +0100 Message-Id: <20221020122146.3177980-20-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221020122146.3177980-1-peter.maydell@linaro.org> References: <20221020122146.3177980-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x430.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" From: Richard Henderson In preparation for TARGET_TB_PCREL, reduce reliance on absolute values. Since we always pass dc->pc_curr, fold the arithmetic to zero displacement. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Message-id: 20221020030641.2066807-6-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/translate-a64.c | 6 +++--- target/arm/translate.c | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 8ed192198fd..713f1a89a4a 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -332,9 +332,9 @@ static void gen_exception_internal(int excp) gen_helper_exception_internal(cpu_env, tcg_constant_i32(excp)); } -static void gen_exception_internal_insn(DisasContext *s, uint64_t pc, int excp) +static void gen_exception_internal_insn(DisasContext *s, int excp) { - gen_a64_update_pc(s, pc - s->pc_curr); + gen_a64_update_pc(s, 0); gen_exception_internal(excp); s->base.is_jmp = DISAS_NORETURN; } @@ -2211,7 +2211,7 @@ static void disas_exc(DisasContext *s, uint32_t insn) * Secondly, "HLT 0xf000" is the A64 semihosting syscall instruction. */ if (semihosting_enabled(s->current_el == 0) && imm16 == 0xf000) { - gen_exception_internal_insn(s, s->pc_curr, EXCP_SEMIHOST); + gen_exception_internal_insn(s, EXCP_SEMIHOST); } else { unallocated_encoding(s); } diff --git a/target/arm/translate.c b/target/arm/translate.c index 350f991649b..9104ab82325 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -1074,10 +1074,10 @@ static inline void gen_smc(DisasContext *s) s->base.is_jmp = DISAS_SMC; } -static void gen_exception_internal_insn(DisasContext *s, uint32_t pc, int excp) +static void gen_exception_internal_insn(DisasContext *s, int excp) { gen_set_condexec(s); - gen_update_pc(s, pc - s->pc_curr); + gen_update_pc(s, 0); gen_exception_internal(excp); s->base.is_jmp = DISAS_NORETURN; } @@ -1169,7 +1169,7 @@ static inline void gen_hlt(DisasContext *s, int imm) */ if (semihosting_enabled(s->current_el != 0) && (imm == (s->thumb ? 0x3c : 0xf000))) { - gen_exception_internal_insn(s, s->pc_curr, EXCP_SEMIHOST); + gen_exception_internal_insn(s, EXCP_SEMIHOST); return; } @@ -6556,7 +6556,7 @@ static bool trans_BKPT(DisasContext *s, arg_BKPT *a) if (arm_dc_feature(s, ARM_FEATURE_M) && semihosting_enabled(s->current_el == 0) && (a->imm == 0xab)) { - gen_exception_internal_insn(s, s->pc_curr, EXCP_SEMIHOST); + gen_exception_internal_insn(s, EXCP_SEMIHOST); } else { gen_exception_bkpt_insn(s, syn_aa32_bkpt(a->imm, false)); } @@ -8762,7 +8762,7 @@ static bool trans_SVC(DisasContext *s, arg_SVC *a) if (!arm_dc_feature(s, ARM_FEATURE_M) && semihosting_enabled(s->current_el == 0) && (a->imm == semihost_imm)) { - gen_exception_internal_insn(s, s->pc_curr, EXCP_SEMIHOST); + gen_exception_internal_insn(s, EXCP_SEMIHOST); } else { gen_update_pc(s, curr_insn_len(s)); s->svc_imm = a->imm;