From nobody Tue Feb 10 03:40:03 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.208.47 as permitted sender) client-ip=209.85.208.47; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ed1-f47.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.208.47 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1614033573; cv=none; d=zohomail.com; s=zohoarc; b=LurQhImEVioYvUuns803BahYzd3oxGqitUSJEY5y/rezg4rBS5VHaTAVFkY6M230POEWWOQDs4oZ0T61OHKRUoOEb77xkwL22bsbIB6RRN6qe0bJQoBBgr5bRuOR/Az0XKNAQoZgjasbUoV43D33exGdByR9nUDVl5/X/8Qrmcc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614033573; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=hhlpouH+U3rNOrspZgB0QgIcQmhAf1zcqiPcomofBiI=; b=WKiR5bzkCsyPCRBw5Evg+J2QhY3Tb77QQaYgRHZSRGxrlZKG0kF/QfR8rH0qYhVVDMrGRLAHQcQc1KcxTL6Vl6saOrx03e89yD53wIbvPC/Y8n1stAWemuOjEBAzt82HaevGALrHKmG6+/C/zMhDGtHUf/0gUMmX1sZHuyieVX0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.208.47 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) by mx.zohomail.com with SMTPS id 1614033572648896.5889563316454; Mon, 22 Feb 2021 14:39:32 -0800 (PST) Received: by mail-ed1-f47.google.com with SMTP id d2so23862027edq.10 for ; Mon, 22 Feb 2021 14:39:32 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (68.red-83-57-175.dynamicip.rima-tde.net. [83.57.175.68]) by smtp.gmail.com with ESMTPSA id x17sm13176654edq.42.2021.02.22.14.39.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Feb 2021 14:39:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hhlpouH+U3rNOrspZgB0QgIcQmhAf1zcqiPcomofBiI=; b=UkHdRzu1SPs4TbCGedYqhjNBjNrFEYSGbqLo4NSxdLNLZaHEYC7LQD5UPUeElpD8vs KHc13V0KbINvaKqtM4cSou0XHW40gpC7fK6M5lJ4u3RsD7C57kM02mMarXBwMIJEkIWF POBBpDD/NRwrC4C85N+ICjxN6zuQ7mRD6Lyya/LgnjgKr4mDw7MPhoZ5Fw2HJuZctX1U yft2JKx1UXVEgNsL9C5mJiTBMnUwHVY6WrxgaPYqZzNjNRQ2myxPAMozVnI3MypdmFij 1Yp2Cb3EbZ+XQmgKNH0iN2rqRSxqN8OROWe5SdcwI08SNdW2drgM3NP0G1tjrgZ/bmGc TDAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=hhlpouH+U3rNOrspZgB0QgIcQmhAf1zcqiPcomofBiI=; b=GZDM+nFlhoC9uSz0sguyVxdugSNBeKIt3JuQ/tBn6iElzPXAw+R43ajupsrpXqlsEG qv860gSJU1XG7hex8dVVuQjlODT1tIdNLWsfuAvtuzgKF9CwPIzeUgBNr31p0zKcO9Tp 2aD9wyDwzh+5PSEdWz8fmIh1yJ8MFcu9z2w/GkNdg15WttVtvwjrrsec9BUX/cwh/Px7 uVsGbP/CF0976NDsUUeBJrJaKo1+oLO3wWmp1ImA/MVcvUDOzV3V1a+59ooVD88l4QLR gHlcqaGAfkYTfKxiubB6kt8LJGr+0HAYUfz7stUznQQoK1euUBYOdqRs70J0kDIJhlR3 KjIQ== X-Gm-Message-State: AOAM530TL1cQk+GHq/hZ49hxyH9beiyoM3veH64pbhna/9lLZDK2IXZ7 3NaM8Sw1UHLkXgHBCUvH7KmIct/Gfbg= X-Google-Smtp-Source: ABdhPJzZJKd++38iXJTzzoH/HCYOR9QnGGAiKOvFY7VFGs6kBEXxLbKhLePddPMuiRZCPzCm8ruFIg== X-Received: by 2002:aa7:dace:: with SMTP id x14mr4903561eds.142.1614033570925; Mon, 22 Feb 2021 14:39:30 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Aurelien Jarno , Jiaxun Yang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Rikalo Subject: [PATCH v3 05/10] target/mips: Extract decode_ase_mxu() from decode_opc_mxu() Date: Mon, 22 Feb 2021 23:38:56 +0100 Message-Id: <20210222223901.2792336-6-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210222223901.2792336-1-f4bug@amsat.org> References: <20210222223901.2792336-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) To easily convert MXU code to decodetree, extract decode_ase_mxu() from decode_opc_mxu(), making it return a boolean. We will keep decode_opc_mxu() in the translate.c unit because it calls gen_arith(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- target/mips/translate.c | 45 ++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/target/mips/translate.c b/target/mips/translate.c index 9e875fa4a25..6f853fcdcce 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -25777,34 +25777,18 @@ static void decode_opc_mxu__pool19(DisasContext *= ctx) } } =20 -/* - * Main MXU decoding function - */ -static void decode_opc_mxu(DisasContext *ctx, uint32_t insn) +static bool decode_ase_mxu(DisasContext *ctx, uint32_t insn) { uint32_t opcode =3D extract32(insn, 0, 6); =20 - if (opcode =3D=3D OPC__MXU_MUL) { - uint32_t rs, rt, rd, op1; - - rs =3D extract32(insn, 21, 5); - rt =3D extract32(insn, 16, 5); - rd =3D extract32(insn, 11, 5); - op1 =3D MASK_SPECIAL2(insn); - - gen_arith(ctx, op1, rd, rs, rt); - - return; - } - if (opcode =3D=3D OPC_MXU_S32M2I) { gen_mxu_s32m2i(ctx); - return; + return true; } =20 if (opcode =3D=3D OPC_MXU_S32I2M) { gen_mxu_s32i2m(ctx); - return; + return true; } =20 { @@ -25845,6 +25829,29 @@ static void decode_opc_mxu(DisasContext *ctx, uint= 32_t insn) gen_set_label(l_exit); tcg_temp_free(t_mxu_cr); } + + return true; +} + +/* + * Main MXU decoding function + */ +static void decode_opc_mxu(DisasContext *ctx, uint32_t insn) +{ + if (extract32(insn, 0, 6) =3D=3D OPC__MXU_MUL) { + uint32_t rs, rt, rd, op1; + + rs =3D extract32(insn, 21, 5); + rt =3D extract32(insn, 16, 5); + rd =3D extract32(insn, 11, 5); + op1 =3D MASK_SPECIAL2(insn); + + gen_arith(ctx, op1, rd, rs, rt); + + return; + } + + decode_ase_mxu(ctx, insn); } =20 #endif /* !defined(TARGET_MIPS64) */ --=20 2.26.2