From nobody Mon Feb 9 23:40:33 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610058467; cv=none; d=zohomail.com; s=zohoarc; b=ALAilxSdFgHS+uzcZZCfOcQfFXbxW6dSce+Bv0i/ZXmoEU2U6m7nDRY0mK+32T/8wfl4J05fOcxF0RayxHaTY3Vq7/mW6QTqm5Jhbxe96n2x6f6Jnfrgt3c7aZd6C7Zn3H6zPHEZ8MSmb7HTLgWjwTXjDek05OUk4H2MfC/gjy0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610058467; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ohRDermR0mkMdvDegF26EL3fB4ZqSyCTCt3CGv8BgrM=; b=a/gQ9dfQBb2dKLT/Z3wYsdTQSGld7wM5PSdGBkl3hs0yBLGWJ8IjpTo5yVB38yJ9cCyE+A2/7KQeJhQarhmdPk2VQJZul52DPNo2vKtQJ15Q5IKuvJVdfUYmoeQK0iXVH+Pi5+em0Of8VwYLa1HU4DKh7OO9tjBLVtI9tJTXtLo= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1610058467477934.2329571722571; Thu, 7 Jan 2021 14:27:47 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-439-xu7coz7FOr-AwHXC1qoV6Q-1; Thu, 07 Jan 2021 17:27:43 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DB57C1842159; Thu, 7 Jan 2021 22:27:37 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BA0A160BF1; Thu, 7 Jan 2021 22:27:37 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 895F85002E; Thu, 7 Jan 2021 22:27:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 107MRaZh031495 for ; Thu, 7 Jan 2021 17:27:36 -0500 Received: by smtp.corp.redhat.com (Postfix) id E7E392166B29; Thu, 7 Jan 2021 22:27:35 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E016A2166B2E for ; Thu, 7 Jan 2021 22:27:35 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CB942858281 for ; Thu, 7 Jan 2021 22:27:35 +0000 (UTC) Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-76-hfPVKaEOOvycACSbx0PPiw-1; Thu, 07 Jan 2021 17:27:31 -0500 Received: by mail-wr1-f47.google.com with SMTP id c5so7111303wrp.6; Thu, 07 Jan 2021 14:27:30 -0800 (PST) Received: from x1w.redhat.com (241.red-88-10-103.dynamicip.rima-tde.net. [88.10.103.241]) by smtp.gmail.com with ESMTPSA id w189sm9557825wmg.31.2021.01.07.14.27.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Jan 2021 14:27:29 -0800 (PST) X-MC-Unique: xu7coz7FOr-AwHXC1qoV6Q-1 X-MC-Unique: hfPVKaEOOvycACSbx0PPiw-1 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=ohRDermR0mkMdvDegF26EL3fB4ZqSyCTCt3CGv8BgrM=; b=q9KKA/QEzELllj74252MLthkXz9V+oc/eJz/JxzTlm7Id3fZmCz6dkDgJ6LuHq4hWY BVcwfICUFGYt2ifenKvkI1kOtqLK7wXl2Uuy58cQFY9tJvHG3qBDkWkChIIMkui2BUKD Zxw1k1RBDuqqeIQO95PwbGF1LnyA8eLzr22EQ1t9e9zmfJ7+08CFVVQb1SPsh3SxfQ7f /JYSL/0rsgX/zv9sPAUai40XTmA11iNjRFUqiHpkOCu1GqP6okcWIpZ0i6Law2cFFI9W ml5yMqw48jzxT/FQuSJUQ645H5ntZZEmAKwzafLEq7Kv9Af3XGBFXEPt9oh8xg6z8AeD ovNQ== X-Gm-Message-State: AOAM532jtnW0KamoRUx2LPw+ZWzFthX/fN9MZ1MWV4Jbd+1QiZAr8L2Y 6gFDvc6nsnQErFF3W2ufZng= X-Google-Smtp-Source: ABdhPJzmlF9GZ/x2TYLqqOujsEGL9AtgxyOtqF9BsHqaARz0MImBXI7atAOgqyLObw3GtnMCJZgMtQ== X-Received: by 2002:a5d:4882:: with SMTP id g2mr650959wrq.273.1610058449889; Thu, 07 Jan 2021 14:27:29 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 53/66] target/mips: Use decode_ase_msa() generated from decodetree Date: Thu, 7 Jan 2021 23:22:40 +0100 Message-Id: <20210107222253.20382-54-f4bug@amsat.org> In-Reply-To: <20210107222253.20382-1-f4bug@amsat.org> References: <20210107222253.20382-1-f4bug@amsat.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Cc: Aleksandar Rikalo , Paul Burton , kvm@vger.kernel.org, libvir-list@redhat.com, Huacai Chen , Richard Henderson , Laurent Vivier , Jiaxun Yang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Aurelien Jarno X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Now that we can decode the MSA ASE with decode_ase_msa(), use it and remove the previous code, now unreachable. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20201215225757.764263-21-f4bug@amsat.org> Tested-by: Jiaxun Yang --- target/mips/translate.h | 12 ------------ target/mips/msa_translate.c | 29 +---------------------------- target/mips/translate.c | 32 ++++++++++---------------------- 3 files changed, 11 insertions(+), 62 deletions(-) diff --git a/target/mips/translate.h b/target/mips/translate.h index 858e47cf833..35e9c4cd135 100644 --- a/target/mips/translate.h +++ b/target/mips/translate.h @@ -82,8 +82,6 @@ enum { OPC_BC1 =3D (0x08 << 21) | OPC_CP1, /* bc */ OPC_BC1ANY2 =3D (0x09 << 21) | OPC_CP1, OPC_BC1ANY4 =3D (0x0A << 21) | OPC_CP1, - OPC_BZ_V =3D (0x0B << 21) | OPC_CP1, - OPC_BNZ_V =3D (0x0F << 21) | OPC_CP1, OPC_S_FMT =3D (FMT_S << 21) | OPC_CP1, OPC_D_FMT =3D (FMT_D << 21) | OPC_CP1, OPC_E_FMT =3D (FMT_E << 21) | OPC_CP1, @@ -93,14 +91,6 @@ enum { OPC_PS_FMT =3D (FMT_PS << 21) | OPC_CP1, OPC_BC1EQZ =3D (0x09 << 21) | OPC_CP1, OPC_BC1NEZ =3D (0x0D << 21) | OPC_CP1, - OPC_BZ_B =3D (0x18 << 21) | OPC_CP1, - OPC_BZ_H =3D (0x19 << 21) | OPC_CP1, - OPC_BZ_W =3D (0x1A << 21) | OPC_CP1, - OPC_BZ_D =3D (0x1B << 21) | OPC_CP1, - OPC_BNZ_B =3D (0x1C << 21) | OPC_CP1, - OPC_BNZ_H =3D (0x1D << 21) | OPC_CP1, - OPC_BNZ_W =3D (0x1E << 21) | OPC_CP1, - OPC_BNZ_D =3D (0x1F << 21) | OPC_CP1, }; =20 #define MASK_CP1_FUNC(op) (MASK_CP1(op) | (op & 0x3F)) @@ -164,8 +154,6 @@ extern TCGv bcond; =20 /* MSA */ void msa_translate_init(void); -void gen_msa(DisasContext *ctx); -void gen_msa_branch(DisasContext *ctx, uint32_t op1); =20 /* decodetree generated */ bool decode_ase_msa(DisasContext *ctx, uint32_t insn); diff --git a/target/mips/msa_translate.c b/target/mips/msa_translate.c index 5efb0a1fc8a..8a48f889aa2 100644 --- a/target/mips/msa_translate.c +++ b/target/mips/msa_translate.c @@ -412,33 +412,6 @@ static bool trans_BNZ_x(DisasContext *ctx, arg_msa_bz = *a) return gen_msa_BxZ(ctx, a->df, a->wt, a->s16, true); } =20 -void gen_msa_branch(DisasContext *ctx, uint32_t op1) -{ - uint8_t df =3D (ctx->opcode >> 21) & 0x3; - uint8_t wt =3D (ctx->opcode >> 16) & 0x1f; - int64_t s16 =3D (int16_t)ctx->opcode; - - switch (op1) { - case OPC_BZ_V: - case OPC_BNZ_V: - gen_msa_BxZ_V(ctx, wt, s16, (op1 =3D=3D OPC_BZ_V) ? - TCG_COND_EQ : TCG_COND_NE); - break; - case OPC_BZ_B: - case OPC_BZ_H: - case OPC_BZ_W: - case OPC_BZ_D: - gen_msa_BxZ(ctx, df, wt, s16, false); - break; - case OPC_BNZ_B: - case OPC_BNZ_H: - case OPC_BNZ_W: - case OPC_BNZ_D: - gen_msa_BxZ(ctx, df, wt, s16, true); - break; - } -} - static void gen_msa_i8(DisasContext *ctx) { #define MASK_MSA_I8(op) (MASK_MSA_MINOR(op) | (op & (0x03 << 24))) @@ -2188,7 +2161,7 @@ static void gen_msa_vec(DisasContext *ctx) } } =20 -void gen_msa(DisasContext *ctx) +static void gen_msa(DisasContext *ctx) { uint32_t opcode =3D ctx->opcode; =20 diff --git a/target/mips/translate.c b/target/mips/translate.c index 01fe4609c9d..3da12e31351 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -6,6 +6,7 @@ * Copyright (c) 2006 Thiemo Seufer (MIPS32R2 support) * Copyright (c) 2009 CodeSourcery (MIPS16 and microMIPS support) * Copyright (c) 2012 Jia Liu & Dongxue Zhang (MIPS ASE DSP support) + * Copyright (c) 2020 Philippe Mathieu-Daud=C3=A9 * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -135,8 +136,6 @@ enum { OPC_JIALC =3D (0x3E << 26), /* MDMX ASE specific */ OPC_MDMX =3D (0x1E << 26), - /* MSA ASE, same as MDMX */ - OPC_MSA =3D OPC_MDMX, /* Cache and prefetch */ OPC_CACHE =3D (0x2F << 26), OPC_PREF =3D (0x33 << 26), @@ -28828,21 +28827,6 @@ static bool decode_opc_legacy(CPUMIPSState *env, D= isasContext *ctx) } break; } - case OPC_BZ_V: - case OPC_BNZ_V: - case OPC_BZ_B: - case OPC_BZ_H: - case OPC_BZ_W: - case OPC_BZ_D: - case OPC_BNZ_B: - case OPC_BNZ_H: - case OPC_BNZ_W: - case OPC_BNZ_D: - if (ase_msa_available(env)) { - gen_msa_branch(ctx, op1); - break; - } - /* fall through */ default: MIPS_INVAL("cp1"); gen_reserved_instruction(ctx); @@ -29024,16 +29008,13 @@ static bool decode_opc_legacy(CPUMIPSState *env, = DisasContext *ctx) gen_compute_branch(ctx, op, 4, rs, rt, offset, 4); } break; - case OPC_MSA: /* OPC_MDMX */ + case OPC_MDMX: /* MMI_OPC_LQ */ if (ctx->insn_flags & INSN_R5900) { #if defined(TARGET_MIPS64) - gen_mmi_lq(env, ctx); /* MMI_OPC_LQ */ + gen_mmi_lq(env, ctx); #endif } else { /* MDMX: Not implemented. */ - if (ase_msa_available(env)) { - gen_msa(ctx); - } } break; case OPC_PCREL: @@ -29066,6 +29047,13 @@ static void decode_opc(CPUMIPSState *env, DisasCon= text *ctx) gen_set_label(l1); } =20 + /* Transition to the auto-generated decoder. */ + + /* ISA extensions */ + if (ase_msa_available(env) && decode_ase_msa(ctx, ctx->opcode)) { + return; + } + if (!decode_opc_legacy(env, ctx)) { gen_reserved_instruction(ctx); } --=20 2.26.2