From nobody Fri Nov 7 14:49:05 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1548242580381819.3727541816354; Wed, 23 Jan 2019 03:23:00 -0800 (PST) Received: from localhost ([127.0.0.1]:60880 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gmGcV-0005sf-Bf for importer@patchew.org; Wed, 23 Jan 2019 06:22:59 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54207) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gmGXO-00025B-0l for qemu-devel@nongnu.org; Wed, 23 Jan 2019 06:17:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gmGXL-0007fK-Va for qemu-devel@nongnu.org; Wed, 23 Jan 2019 06:17:41 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:56777 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gmGXL-0007d8-Lu for qemu-devel@nongnu.org; Wed, 23 Jan 2019 06:17:39 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 5324C1A21B6; Wed, 23 Jan 2019 12:16:29 +0100 (CET) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.13.43]) by mail.rt-rk.com (Postfix) with ESMTPSA id E28721A0F00; Wed, 23 Jan 2019 12:16:28 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Date: Wed, 23 Jan 2019 12:15:58 +0100 Message-Id: <1548242160-16039-8-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1548242160-16039-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1548242160-16039-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 Subject: [Qemu-devel] [PATCH v2 7/9] target/mips: nanoMIPS: Fix branch handling X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: arikalo@wavecomp.com, amarkovic@wavecomp.com, aurelien@aurel32.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Stefan Markovic Fix nanoMIPS branch handling. Signed-off-by: Stefan Markovic Signed-off-by: Aleksandar Markovic Reviewed-by: Aleksandar Rikalo --- target/mips/translate.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/target/mips/translate.c b/target/mips/translate.c index aaf7dff..e9b5d1d 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -19758,6 +19758,10 @@ static void gen_compute_imm_branch(DisasContext *c= tx, uint32_t opc, goto out; } =20 + /* branch completion */ + clear_branch_hflags(ctx); + ctx->base.is_jmp =3D DISAS_NORETURN; + if (bcond_compute =3D=3D 0) { /* Uncoditional compact branch */ gen_goto_tb(ctx, 0, ctx->btarget); @@ -19798,6 +19802,10 @@ static void gen_compute_nanomips_pbalrsc_branch(Di= sasContext *ctx, int rs, tcg_gen_movi_tl(t1, ctx->base.pc_next + 4); gen_op_addr_add(ctx, btarget, t1, t0); =20 + /* branch completion */ + clear_branch_hflags(ctx); + ctx->base.is_jmp =3D DISAS_NORETURN; + /* unconditional branch to register */ tcg_gen_mov_tl(cpu_PC, btarget); tcg_gen_lookup_and_goto_ptr(); @@ -19936,6 +19944,10 @@ static void gen_compute_compact_branch_nm(DisasCon= text *ctx, uint32_t opc, goto out; } =20 + /* branch completion */ + clear_branch_hflags(ctx); + ctx->base.is_jmp =3D DISAS_NORETURN; + /* Generating branch here as compact branches don't have delay slo= t */ gen_goto_tb(ctx, 1, ctx->btarget); gen_set_label(fs); --=20 2.7.4