From patchwork Sun Nov 5 20:12:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 741049 Delivered-To: patch@linaro.org Received: by 2002:adf:fd90:0:b0:32d:baff:b0ca with SMTP id d16csp793145wrr; Sun, 5 Nov 2023 12:13:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IFSc6hvOnWcke8rGDFBq+IRMedg0fbL6EGyWrXzNquse5y2uXKYARzrGBnskbSQoQopUuDC X-Received: by 2002:a1f:2f81:0:b0:49a:a3ee:d280 with SMTP id v123-20020a1f2f81000000b0049aa3eed280mr22508336vkv.16.1699215234173; Sun, 05 Nov 2023 12:13:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699215234; cv=none; d=google.com; s=arc-20160816; b=QZ4z9rVY0DUbf/0AHLatnPPJ+8wRi++nHutkpcJoJoF/zM0AgFIShlNotDqNNWCP3o z+xlaq+PYbWEF74iMV1eD3e9NwC/s0ijHsAyffYtPv8MCzzrSBv60hK3IjzCOrWYCxf+ xDfT3Ub38f4XreckrmGjsYnuEYKl0ofqkHwDLIqMw3RGP9quN/N3qYZriPKCHjMUe8se EPrArCVwbelhTm3CGSj4H4btN8KI8EWRUVGwlWVKGH5iS+vLYsFq6gj7gytwo9sdMef4 4ApwYAf6VuCUnqxU/Wcj+t/lGzFglRA7D3rpA8MCWDx9n3xZQ5tkO6TjJA7I9f+mjkXN QqnQ== 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=J1YIzqOFSgMcnN6BcwtNadmOERabr9cbQIvdlvZH1EA=; fh=rYI8DiHAAFX3O5g969KmOAQ7d45Sb8OxQX1+DywGDk4=; b=nIQaOahR1lk9MrV1WGs9132eRZU67i+Qbmju9GP+sOOx35ZKB+Myy32jbb319hzbDQ RcOZX6aNVB2oilx3wYAYWFoExbVTcrzWS6ipcSfcIBH5+L93eytNV5iMR7SJRcOQCcDA qT959M7wMyodBkzQmUSRoJZ12sfNUMVXQPh9cO+IOT6BKRx08gzU8EYHS0qt2VJNKu24 NIc89zNjLDFeLGaWdvr3S1LIUpd9d/SX92tdli2JBeiVl6pC4YtIWRHtgi7FKCmgnk6c DBEEohL2ndjAwaFrhCS/Y9sXxfIOON8P593EbZtW6BJ0lyqdxMyIVZ0WAuyHqyXSSOC7 g93g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ximxj220; 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 y14-20020a05622a120e00b0041817f7086dsi4451991qtx.556.2023.11.05.12.13.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 05 Nov 2023 12:13:54 -0800 (PST) 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=Ximxj220; 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 1qzjUB-0003RA-IW; Sun, 05 Nov 2023 15:12:43 -0500 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 1qzjU7-0003O5-Ep for qemu-devel@nongnu.org; Sun, 05 Nov 2023 15:12:39 -0500 Received: from mail-oi1-x232.google.com ([2607:f8b0:4864:20::232]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzjU5-0002AE-QA for qemu-devel@nongnu.org; Sun, 05 Nov 2023 15:12:39 -0500 Received: by mail-oi1-x232.google.com with SMTP id 5614622812f47-3b2e44c7941so2521057b6e.2 for ; Sun, 05 Nov 2023 12:12:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699215156; x=1699819956; 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=J1YIzqOFSgMcnN6BcwtNadmOERabr9cbQIvdlvZH1EA=; b=Ximxj220XcPmDSdnSbGF6hP7NB9DLVVuBFWM+NnqUfAvO8W6DRd+aQ5McsmNll8Z4U 0TMesuXwjErD+5iPHtMwzZvZgK8ySmkEuFcq5rj8i6HmWMFWUFx6Pz3JZI3mAvX6SHMF FTKOQ16tDzV46ShkuFhhNWc6VbrxdKqP07N5Vz98X8NmNvCe/OK+0PdMCFP9T4hraJ5a gq5pnvkZq5DK8JVYo4JPQDwX+e5M685fDH8grL8+uDzTLFH7tgbIAZSVZ+uVibyC0m5s 59j54HT7CQASKQo6vF4QrxD/DuVeMekfV7EzmJMvXGg2Ly4Zzy1sQ4ZLHB+8NYibtDV9 BwCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699215156; x=1699819956; 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=J1YIzqOFSgMcnN6BcwtNadmOERabr9cbQIvdlvZH1EA=; b=qzbB9WHiKPP93tMN6KNiocPYKvYTHDKcjMFaj3nZMqE5gYu4NXFym4RMiHESIPNrYc 3PZL8IwF9NcR8X2YPrtkj2kyVRJja333hQyPa6S0EC1BlJPHiTWE/uTNpQ8A82dpsPsJ 2/lk8BcGVz+bFCrtzH6z4salTmef+/JU0UbTeJSLEOVOc3tJwBF8RuHZpkGzYGBk6Rsv FNIAkbnhchQzicTeUcwUs2fAwrTJmYOXvrHiRWm0DljGSLm+L5ftHdnsj1y8s0N6UM1d dlGZ6Ya82DvaC6zN8zSzTjYQxnArUsuHDQOmYH99K3X+knZRloYWIrRBgDyJlAtv985f uQpw== X-Gm-Message-State: AOJu0YxPYJcWQdrx3x65tMGde2yG/GfhlIMYhikG1oES+eLyCfR5BsxQ Q0pON1RvImPBoC3cGpAfQ/p4uyRbOrm4dLaveak= X-Received: by 2002:aca:1a02:0:b0:398:5d57:3d08 with SMTP id a2-20020aca1a02000000b003985d573d08mr28443756oia.37.1699215156742; Sun, 05 Nov 2023 12:12:36 -0800 (PST) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id u23-20020a056a00099700b006884549adc8sm4359777pfg.29.2023.11.05.12.12.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 12:12:36 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland Subject: [PULL 15/21] target/sparc: Pass displacement to advance_jump_cond Date: Sun, 5 Nov 2023 12:12:16 -0800 Message-Id: <20231105201222.202395-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231105201222.202395-1-richard.henderson@linaro.org> References: <20231105201222.202395-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::232; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x232.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Tested-by: Mark Cave-Ayland Acked-by: Mark Cave-Ayland Signed-off-by: Richard Henderson --- target/sparc/translate.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index cbee5435a3..1233911b69 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -2379,8 +2379,9 @@ static bool advance_pc(DisasContext *dc) */ static bool advance_jump_cond(DisasContext *dc, DisasCompare *cmp, - bool annul, target_ulong dest) + bool annul, int disp) { + target_ulong dest = address_mask_i(dc, dc->pc + disp * 4); target_ulong npc; if (cmp->cond == TCG_COND_ALWAYS) { @@ -2475,11 +2476,10 @@ static bool gen_trap_float128(DisasContext *dc) static bool do_bpcc(DisasContext *dc, arg_bcc *a) { - target_long target = address_mask_i(dc, dc->pc + a->i * 4); DisasCompare cmp; gen_compare(&cmp, a->cc, a->cond, dc); - return advance_jump_cond(dc, &cmp, a->a, target); + return advance_jump_cond(dc, &cmp, a->a, a->i); } TRANS(Bicc, ALL, do_bpcc, a) @@ -2487,14 +2487,13 @@ TRANS(BPcc, 64, do_bpcc, a) static bool do_fbpfcc(DisasContext *dc, arg_bcc *a) { - target_long target = address_mask_i(dc, dc->pc + a->i * 4); DisasCompare cmp; if (gen_trap_ifnofpu(dc)) { return true; } gen_fcompare(&cmp, a->cc, a->cond); - return advance_jump_cond(dc, &cmp, a->a, target); + return advance_jump_cond(dc, &cmp, a->a, a->i); } TRANS(FBPfcc, 64, do_fbpfcc, a) @@ -2502,7 +2501,6 @@ TRANS(FBfcc, ALL, do_fbpfcc, a) static bool trans_BPr(DisasContext *dc, arg_BPr *a) { - target_long target = address_mask_i(dc, dc->pc + a->i * 4); DisasCompare cmp; if (!avail_64(dc)) { @@ -2513,7 +2511,7 @@ static bool trans_BPr(DisasContext *dc, arg_BPr *a) } gen_compare_reg(&cmp, a->cond, gen_load_gpr(dc, a->rs1)); - return advance_jump_cond(dc, &cmp, a->a, target); + return advance_jump_cond(dc, &cmp, a->a, a->i); } static bool trans_CALL(DisasContext *dc, arg_CALL *a)