From patchwork Sun Nov 5 20:12:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 741055 Delivered-To: patch@linaro.org Received: by 2002:adf:fd90:0:b0:32d:baff:b0ca with SMTP id d16csp793349wrr; Sun, 5 Nov 2023 12:14:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IEECL7bvjXWu4Gzd0bmd+lRODIYKzc4hY2pwwn9va9EvPot0InGWWPxUBWotkyLqy9bMC2q X-Received: by 2002:ac8:5f4d:0:b0:412:1e0a:772a with SMTP id y13-20020ac85f4d000000b004121e0a772amr29932103qta.17.1699215284162; Sun, 05 Nov 2023 12:14:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699215284; cv=none; d=google.com; s=arc-20160816; b=Su9Loz+hjdPwFpXatR0ReRUmY3jSWi9/uDwhYJ5fHHsp+kY0BF3EonHqlt3YJMmAoO 69+m6n8HmOcH0ga58Y07gq49bxOzzm+kAfDg7G/Jf+jNa7AG5KKRA0RRIiDpjRbcaapH wQVmKd7iZOnkqd0uGYvkaw7uPA02yJjSea+s8jm/JRE7sdzdlxpVcSSfe5axGecJpHto sR5lP/0VJnIpYhKwWpWGDtzPIe55xxHDJJ9UjtGTiS0xi9KiXCU2xP/ntbT/uMf+GFmB kxq92NblstSL+DnoynvgyD+5FtvwtVBcNuBzD3UTAzuJPJ0RJ5VQsfhiLi4Li1YMCM0M NRlg== 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=XHJ3cfI2sXHgMNE5o/c/XelGrRA35h8Xfg71kYgqG0o=; fh=rYI8DiHAAFX3O5g969KmOAQ7d45Sb8OxQX1+DywGDk4=; b=Wu6rSxfc5pIlLq6lRLZR3VW1nsExWLnDZlzFqmQfRcZVmmaHpPCbGhP4i4HH3NSHRq PJ2ufdbpK5jcuG6OjaYM0eTkK7+59JSPPdffM9QH3d+lS45/BL0WyxcvGQJtOuD7i8pt wo7G0UePEOP1xDkZ9AOC9Ow3fhSQ+YVV8eJogn/iEwqBTnAqOuUZvp+8GljJYK1VeWyD 3mMhVnyGyXA+iSr/EVVRLqodfGfWaR2MHvPfw6W9mpDnIVbGdBcVadjWBgyh4wXFT6E9 jDsoMpsaK6XDnMvK8T34JSukBSsIyH4DsmDJsKNwnkUAUAY5DiBCX8x8Cljffy76urWn hy+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XWVmnAhC; 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 c14-20020ac85a8e000000b00403b977323dsi4867076qtc.18.2023.11.05.12.14.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 05 Nov 2023 12:14:44 -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=XWVmnAhC; 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 1qzjU7-0003O3-Ew; Sun, 05 Nov 2023 15:12:39 -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 1qzjU6-0003Nn-7W for qemu-devel@nongnu.org; Sun, 05 Nov 2023 15:12:38 -0500 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzjU4-00029w-NJ for qemu-devel@nongnu.org; Sun, 05 Nov 2023 15:12:37 -0500 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-6ba54c3ed97so3975345b3a.2 for ; Sun, 05 Nov 2023 12:12:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699215155; x=1699819955; 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=XHJ3cfI2sXHgMNE5o/c/XelGrRA35h8Xfg71kYgqG0o=; b=XWVmnAhCaHBvZ5KNmspNnmOUlSg+qpYuyfqgvXKmKU4mIWGH8lue6ehFZAVm3KlPAW iDpYQbtgpOYyqYwxomPpj6QHdtn8+8nPSX5SWGrWHfqvH150gMq0TSTvjwdwvEJRA0tj cmYLjaMzFopLzx5mhm460wOyeDUSWReghSQP+Bt8DKtVX6Nz3VgYrfbmXJSHHJlVDgmq /sI+zrpI6lZuEe9ut11zNnjFDMO3CP/Qw4nCzpb/Di3QhEtITPGjUqnI/NFeG2h5EVpf T3y3tVSKXrVnNaiYFpYNn4JdUOJBN/AL3YuTsap7T8hBIX5CJpAKg5kVxym36tOKO9gH 51EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699215155; x=1699819955; 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=XHJ3cfI2sXHgMNE5o/c/XelGrRA35h8Xfg71kYgqG0o=; b=azauj3NtlcbL0Xu047qL1xkUBmWvKoHqWu9eqZiWqziVg/vJBDaKrk52HRr19SQUkx zsvgI7bWbp8pztQZwruqL1Ni0GJiM8jOdEnUOnY9uFLgqAAN/0gSkDTQVlWL3yzQs5SC EqZPUWKyU+LCwd4q7IspFjy2cj5bhAtqCytS5Byb4KfWfuinvgRfPMaw+yeLvXRcUsqo KRixifdWfv5gfhMHfCdO7lzmHRdb10Ea+76ngyhrVp+38kLUkYa71HAKrgRV2sGSkU/K PUsBC30pETQvwwaNjr1yNgP5gje5ifjYI9JPwv8IE5mQkqgRCTEBG1fv7AYmPYNFLjhm Su8g== X-Gm-Message-State: AOJu0YwiE9Z2M4FMWv+7xDxF2eVhehR9l1b/QkFuxYkgM2/SXxSqGEqX w1xMySOwUW8NDPPaUaE59xEw61KvMVazUep7ESQ= X-Received: by 2002:a05:6a00:b8e:b0:68a:5395:7aa5 with SMTP id g14-20020a056a000b8e00b0068a53957aa5mr31996329pfj.17.1699215154931; Sun, 05 Nov 2023 12:12:34 -0800 (PST) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id u23-20020a056a00099700b006884549adc8sm4359777pfg.29.2023.11.05.12.12.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 12:12:34 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland Subject: [PULL 13/21] target/sparc: Merge gen_branch2 into advance_pc Date: Sun, 5 Nov 2023 12:12:14 -0800 Message-Id: <20231105201222.202395-14-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::42b; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42b.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 The function had only one caller. Canonicalize the cpu_cond test to TCG_COND_NE, the "natural" sense of its value. Tested-by: Mark Cave-Ayland Acked-by: Mark Cave-Ayland Signed-off-by: Richard Henderson --- target/sparc/translate.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 2e7deb5e33..e134ba8821 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -908,19 +908,6 @@ static void gen_op_eval_fbo(TCGv dst, TCGv src, unsigned int fcc_offset) tcg_gen_xori_tl(dst, dst, 0x1); } -static void gen_branch2(DisasContext *dc, target_ulong pc1, - target_ulong pc2, TCGv r_cond) -{ - TCGLabel *l1 = gen_new_label(); - - tcg_gen_brcondi_tl(TCG_COND_EQ, r_cond, 0, l1); - - gen_goto_tb(dc, 0, pc1, pc1 + 4); - - gen_set_label(l1); - gen_goto_tb(dc, 1, pc2, pc2 + 4); -} - static void gen_generic_branch(DisasContext *dc) { TCGv npc0 = tcg_constant_tl(dc->jump_pc[0]); @@ -2352,6 +2339,8 @@ static int extract_qfpreg(DisasContext *dc, int x) /* Default case for non jump instructions. */ static bool advance_pc(DisasContext *dc) { + TCGLabel *l1; + if (dc->npc & 3) { switch (dc->npc) { case DYNAMIC_PC: @@ -2359,11 +2348,22 @@ static bool advance_pc(DisasContext *dc) dc->pc = dc->npc; gen_op_next_insn(); break; + case JUMP_PC: /* we can do a static jump */ - gen_branch2(dc, dc->jump_pc[0], dc->jump_pc[1], cpu_cond); + l1 = gen_new_label(); + tcg_gen_brcondi_tl(TCG_COND_NE, cpu_cond, 0, l1); + + /* jump not taken */ + gen_goto_tb(dc, 1, dc->jump_pc[1], dc->jump_pc[1] + 4); + + /* jump taken */ + gen_set_label(l1); + gen_goto_tb(dc, 0, dc->jump_pc[0], dc->jump_pc[0] + 4); + dc->base.is_jmp = DISAS_NORETURN; break; + default: g_assert_not_reached(); }