From nobody Tue Feb 10 21:40:07 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=1610058478; cv=none; d=zohomail.com; s=zohoarc; b=YDJyVpgd3N5a/oskpB9TkjGfqsul5IGutJQfSIkZVjxRm4bxby1V5tD9Xan9uTB+QLfgeyT13DwrRBU7OCkuG5RbYJjyH8z7pr1kA6QrtSCDBwOiPG3idBPWZCwJt6+RnND8pifCJHKnyQjvw/rTWb1qgH8l3LU2HbRhsGcQdUA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610058478; 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=fXnJoY5COKKqaViQrzHGXO3P7g2CyIkmu5oDvOAw7V8=; b=QGcN5+7yD3AbUS+S/BCGu9LFBoul5KsKOdQZvB3O28Xa9OZ/7fKN1Vhps2/uhSRx0O/Z5t1CkXWKJ4PnSDp7gqb3u64SYdsWzjE8Abwrzzas9nXYANqdODFiw47eS3tPZhgEGxgZ65Muu3t8AGoBkW5YWZ4XSBDJmJdCDp9fp5Q= 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 1610058478677417.2539165836213; Thu, 7 Jan 2021 14:27:58 -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-1-eHBmb6q2OrOkgfMheqophA-1; Thu, 07 Jan 2021 17:27:54 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0C5A2803649; Thu, 7 Jan 2021 22:27:48 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DD72871CBA; Thu, 7 Jan 2021 22:27:47 +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 A45701809CA1; Thu, 7 Jan 2021 22:27:47 +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 107MRkDL031587 for ; Thu, 7 Jan 2021 17:27:46 -0500 Received: by smtp.corp.redhat.com (Postfix) id 09C442166B29; Thu, 7 Jan 2021 22:27:46 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 048532166B28 for ; Thu, 7 Jan 2021 22:27:46 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (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 E3862811E76 for ; Thu, 7 Jan 2021 22:27:45 +0000 (UTC) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-443-AvOh1YPNOnOF8nnfRIE9Jg-1; Thu, 07 Jan 2021 17:27:41 -0500 Received: by mail-wm1-f42.google.com with SMTP id g185so6835195wmf.3; Thu, 07 Jan 2021 14:27:40 -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 w8sm10003601wrl.91.2021.01.07.14.27.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Jan 2021 14:27:39 -0800 (PST) X-MC-Unique: eHBmb6q2OrOkgfMheqophA-1 X-MC-Unique: AvOh1YPNOnOF8nnfRIE9Jg-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=fXnJoY5COKKqaViQrzHGXO3P7g2CyIkmu5oDvOAw7V8=; b=cVBp/Xt5I2q7XbkROARzOoUq35MeFgqmS/HdcqnGCw2eEKihdbsgnnaq7tnve/hwDX P7oYVJmcnrPjOasF2/kavgxYRm2so5L+IBL01psnRuc8Ss16Xa4ZJTILovODAyYFVU/N /n18CzXfwHrvA7wbNPgnhoU+bjhYtqYhoigxNfbyz20Y8DPtK4cXyz7a9dlU2CRLhwaz GLhtY9YNx65sSqH16sCAce1mGhNXynYQi+ATWbQjG26IJ2OJXs9RiZrv/USvTemyQiUh 3teRrswT/ynP2ydGRbZBqxGGkRrTrYH3VyRZPGOWWgnO0/jk9QbzVo3VvMDA2wv86uou R7ug== X-Gm-Message-State: AOAM532y2yRwo394mpP+mWssZ+gJ5ikbkKgIAK4ypk4rv5IYXbcX9YNb jvLxKS3TACW7iVP9GpzfEZ4= X-Google-Smtp-Source: ABdhPJx4Sw9YkvyMOSz1j6l4//C+swB7Ehawld7rbm9wWnEhdS49W2zJ3bBVSKrxYAHspGHLrfxgpA== X-Received: by 2002:a7b:c19a:: with SMTP id y26mr519327wmi.20.1610058459860; Thu, 07 Jan 2021 14:27:39 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 55/66] target/mips: Introduce decodetree helpers for MSA LSA/DLSA opcodes Date: Thu, 7 Jan 2021 23:22:42 +0100 Message-Id: <20210107222253.20382-56-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.16 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 Add the LSA opcode to the MSA32 decodetree config, add DLSA to a new config for the MSA64 ASE, and call decode_msa64() in the main decode_opc() loop. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20201215225757.764263-23-f4bug@amsat.org> --- target/mips/msa32.decode | 4 ++++ target/mips/msa64.decode | 17 +++++++++++++++++ target/mips/msa_translate.c | 14 ++++++++++++++ target/mips/meson.build | 1 + 4 files changed, 36 insertions(+) create mode 100644 target/mips/msa64.decode diff --git a/target/mips/msa32.decode b/target/mips/msa32.decode index d69675132b8..0b2f0863251 100644 --- a/target/mips/msa32.decode +++ b/target/mips/msa32.decode @@ -10,11 +10,15 @@ # (Document Number: MD00866-2B-MSA32-AFP-01.12) # =20 +&lsa rd rt rs sa &msa_bz df wt s16 =20 +@lsa ...... rs:5 rt:5 rd:5 ... sa:2 ...... &lsa @bz ...... ... .. wt:5 s16:16 &msa_bz df=3D3 @bz_df ...... ... df:2 wt:5 s16:16 &msa_bz =20 +LSA 000000 ..... ..... ..... 000 .. 000101 @lsa + BZ_V 010001 01011 ..... ................ @bz BNZ_V 010001 01111 ..... ................ @bz =20 diff --git a/target/mips/msa64.decode b/target/mips/msa64.decode new file mode 100644 index 00000000000..8dcbbcd8538 --- /dev/null +++ b/target/mips/msa64.decode @@ -0,0 +1,17 @@ +# MIPS SIMD Architecture Module instruction set +# +# Copyright (C) 2020 Philippe Mathieu-Daud=C3=A9 +# +# SPDX-License-Identifier: LGPL-2.1-or-later +# +# Reference: +# MIPS Architecture for Programmers Volume IV-j +# The MIPS64 SIMD Architecture Module, Revision 1.12 +# (Document Number: MD00868-1D-MSA64-AFP-01.12) +# + +&lsa rd rt rs sa !extern + +@lsa ...... rs:5 rt:5 rd:5 ... sa:2 ...... &lsa + +DLSA 000000 ..... ..... ..... 000 .. 010101 @lsa diff --git a/target/mips/msa_translate.c b/target/mips/msa_translate.c index 8a48f889aa2..e97370e54c2 100644 --- a/target/mips/msa_translate.c +++ b/target/mips/msa_translate.c @@ -19,6 +19,7 @@ =20 /* Include the auto-generated decoder. */ #include "decode-msa32.c.inc" +#include "decode-msa64.c.inc" =20 #define OPC_MSA (0x1E << 26) =20 @@ -2266,7 +2267,20 @@ static bool trans_MSA(DisasContext *ctx, arg_MSA *a) return true; } =20 +static bool trans_LSA(DisasContext *ctx, arg_LSA *a) +{ + return gen_LSA(ctx, a->rd, a->rt, a->rs, a->sa); +} + +static bool trans_DLSA(DisasContext *ctx, arg_LSA *a) +{ + return gen_DLSA(ctx, a->rd, a->rt, a->rs, a->sa); +} + bool decode_ase_msa(DisasContext *ctx, uint32_t insn) { + if (TARGET_LONG_BITS =3D=3D 64 && decode_msa64(ctx, insn)) { + return true; + } return decode_msa32(ctx, insn); } diff --git a/target/mips/meson.build b/target/mips/meson.build index 9afee0ca955..21b75254047 100644 --- a/target/mips/meson.build +++ b/target/mips/meson.build @@ -1,5 +1,6 @@ gen =3D [ decodetree.process('msa32.decode', extra_args: [ '--static-decode=3Ddeco= de_msa32' ]), + decodetree.process('msa64.decode', extra_args: [ '--static-decode=3Ddeco= de_msa64' ]), ] =20 mips_ss =3D ss.source_set() --=20 2.26.2