From patchwork Thu Jun 2 21:48:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 578163 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5806:0:0:0:0 with SMTP id j6csp970626max; Thu, 2 Jun 2022 15:39:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeRGL5E2WbHlpsUfxmZO4/AC51NiSaBhzhqrfTihUGkW3HaD7TbehgTckk14BkGdGQqXjw X-Received: by 2002:a05:6214:2a89:b0:464:b97d:b686 with SMTP id jr9-20020a0562142a8900b00464b97db686mr7775955qvb.65.1654209567747; Thu, 02 Jun 2022 15:39:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654209567; cv=none; d=google.com; s=arc-20160816; b=U9lWBlkgD/FcfOsmg7+wiGx5Ab0nAO+Iee33E/T5Uz537J//lm7aVZPYl5sz6QmJhF 5irnt0h85eVLlVWbYvS69pLtku07Y7mAz4TENISGiRMJk0cdrMxVMTLoWHk+2olhXysP KOfPS8JCbXZJExE4st2FXSVGgoamn0CvZxjaUM/ir1ifkgb1ML9YEtCYOIZViupn/pUc 1Isww2VvhaD4wU7K9k14NYfSZfJXmsopIzrw54c6hCCTqfXIs755bFcWi1Er//jYP2BB MjvzzZcMPmThUVTZFUdRodXUZ3wGHtnHhsO3BruSF9ZFnGUkZ0wgl0tLU5+mmeTKkDk7 fwlA== 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=rJ9jQIVXgPW88TErZyxfJAphrMIXEeDwD7105AVfBkg=; b=CRNUV5mRrEIcgaDCFliB806qo25x08yfSModnfga2fujvnxCarHBcGNVRXdzOTY33Y xWw8AMm6PzxaZ/Flmkc53zFaT+FwlrZGFbLtcIqyoCNaB+ahX2VA7RPpoKpBWAlMsGR4 fqTft3UwujtBMy9MXFKp2Wzlb12sv+kJmCQjgtzH2AkXUmhWXBqeQazkccSiZ2zmu1bm KD8p+dIqd/n2pv5aM+2inaJ5X/4M+cDdLP1l6Mv6u7IL/xwXu6c1gh9iKSfEzpd7gJUb 6dy1m2W8aqsf9gtkEHJN/+2pdbFA37HxlkfqO920E8yP1tLqs18Nk/w1uTFKlvzvdBiS FwXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CWKhqRzo; 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 js5-20020a0562142aa500b004646b15210asi2178402qvb.579.2022.06.02.15.39.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 Jun 2022 15:39:27 -0700 (PDT) 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=CWKhqRzo; 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]:48064 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nwtTT-0000Og-7l for patch@linaro.org; Thu, 02 Jun 2022 18:39:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38150) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nwsk9-0001IB-1e for qemu-devel@nongnu.org; Thu, 02 Jun 2022 17:52:37 -0400 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]:45777) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nwsk4-0000rf-KW for qemu-devel@nongnu.org; Thu, 02 Jun 2022 17:52:34 -0400 Received: by mail-pj1-x102a.google.com with SMTP id w2-20020a17090ac98200b001e0519fe5a8so5873332pjt.4 for ; Thu, 02 Jun 2022 14:52:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rJ9jQIVXgPW88TErZyxfJAphrMIXEeDwD7105AVfBkg=; b=CWKhqRzoztu9sfKpoafhnPVyKzgXn+P7p7DbyllQXjCOEjrH4C3ANZXGe7myOntxkK woQwAnimkp986a+AsqC41Oe1Cbvk+hbWzJ6TjjjgJF90EeTayaQI10Y9RsCWsVjAK5jc QHkVZdOyNWMdHfwtudPabqmcFBkp+GcxgZPFR7Y4HNDtZo6FvxKiTRRGE+XiXBcrH5SF Esz9kz4eNS5If5xQac3xGCIyzxFxJlLDYHIunLweDkHapT4yn8QCzgfI9zxCS2EhYL1+ +5S7X2JgqhSA7kKND8XJGMMFQ0IoRM2acMjIgYCJNrSk0c0B6ZHXvr/12Hau0ucjPwML w0Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rJ9jQIVXgPW88TErZyxfJAphrMIXEeDwD7105AVfBkg=; b=Pmc22OYmzJRh1z3GyTTKrwZ+Ys1M8vWczOfuVqMkNePWENbjegNoq4Ian99IneRazC u1qAgOyRqk1+Fl0+Zx+kXtjQXYatpaQZM6CL4CzlhcsL7VIJkFxkFCXPnKdAsHPLLHS5 QMuaogOs5FB0fzDxmJkXqMZYGG7FGC0sNK/BSh7K7sHoG9Z5fkxCBO16TPd7qZg6K6dp YOg6QUO8DAxrzb0ge72eh8nwDaeNDZ1OjLWfjcAhLaO9OwRWSj2hYFdLSKJIGpoXdo4I EblH0mVw6jrmpOqJpLELj4FQ8EvYYEmmXPInae4/dJOh9ZgVmeGXnaWDqkMOU6EmFFTM hCSg== X-Gm-Message-State: AOAM532Jf0cc4y+G1xNEkb8OEFTjuDLlQdL3cQe1IifZIi1Nt9SlhFM2 N6aK5vxsjkyjUSpipJzQ6SDrzGT2sduGMw== X-Received: by 2002:a17:90b:1bc5:b0:1e3:3c67:37bf with SMTP id oa5-20020a17090b1bc500b001e33c6737bfmr7470973pjb.87.1654206751124; Thu, 02 Jun 2022 14:52:31 -0700 (PDT) Received: from stoup.. (174-21-71-225.tukw.qwest.net. [174.21.71.225]) by smtp.gmail.com with ESMTPSA id e14-20020a170902ed8e00b0015edfccfdb5sm4039605plj.50.2022.06.02.14.52.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jun 2022 14:52:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH 41/71] target/arm: Add infrastructure for disas_sme Date: Thu, 2 Jun 2022 14:48:23 -0700 Message-Id: <20220602214853.496211-42-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220602214853.496211-1-richard.henderson@linaro.org> References: <20220602214853.496211-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102a.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=unavailable 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" This includes the build rules for the decoder, and the new file for translation, but excludes any instructions. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- target/arm/translate-a64.h | 1 + target/arm/sme.decode | 20 ++++++++++++++++++++ target/arm/translate-a64.c | 7 ++++++- target/arm/translate-sme.c | 35 +++++++++++++++++++++++++++++++++++ target/arm/meson.build | 2 ++ 5 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 target/arm/sme.decode create mode 100644 target/arm/translate-sme.c diff --git a/target/arm/translate-a64.h b/target/arm/translate-a64.h index f0970c6b8c..789b6e8e78 100644 --- a/target/arm/translate-a64.h +++ b/target/arm/translate-a64.h @@ -146,6 +146,7 @@ static inline int pred_gvec_reg_size(DisasContext *s) } bool disas_sve(DisasContext *, uint32_t); +bool disas_sme(DisasContext *, uint32_t); void gen_gvec_rax1(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs, uint32_t rm_ofs, uint32_t opr_sz, uint32_t max_sz); diff --git a/target/arm/sme.decode b/target/arm/sme.decode new file mode 100644 index 0000000000..c25c031a71 --- /dev/null +++ b/target/arm/sme.decode @@ -0,0 +1,20 @@ +# AArch64 SME instruction descriptions +# +# Copyright (c) 2022 Linaro, Ltd +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, see . + +# +# This file is processed by scripts/decodetree.py +# diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index b1d2840819..8a38fbc33b 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -14814,7 +14814,12 @@ static void aarch64_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu) } switch (extract32(insn, 25, 4)) { - case 0x0: case 0x1: case 0x3: /* UNALLOCATED */ + case 0x0: + if (!disas_sme(s, insn)) { + unallocated_encoding(s); + } + break; + case 0x1: case 0x3: /* UNALLOCATED */ unallocated_encoding(s); break; case 0x2: diff --git a/target/arm/translate-sme.c b/target/arm/translate-sme.c new file mode 100644 index 0000000000..786c93fb2d --- /dev/null +++ b/target/arm/translate-sme.c @@ -0,0 +1,35 @@ +/* + * AArch64 SME translation + * + * Copyright (c) 2022 Linaro, Ltd + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see . + */ + +#include "qemu/osdep.h" +#include "cpu.h" +#include "tcg/tcg-op.h" +#include "tcg/tcg-op-gvec.h" +#include "tcg/tcg-gvec-desc.h" +#include "translate.h" +#include "exec/helper-gen.h" +#include "translate-a64.h" +#include "fpu/softfloat.h" + + +/* + * Include the generated decoder. + */ + +#include "decode-sme.c.inc" diff --git a/target/arm/meson.build b/target/arm/meson.build index 02c91f72bb..c47d86c609 100644 --- a/target/arm/meson.build +++ b/target/arm/meson.build @@ -1,5 +1,6 @@ gen = [ decodetree.process('sve.decode', extra_args: '--decode=disas_sve'), + decodetree.process('sme.decode', extra_args: '--decode=disas_sme'), decodetree.process('neon-shared.decode', extra_args: '--decode=disas_neon_shared'), decodetree.process('neon-dp.decode', extra_args: '--decode=disas_neon_dp'), decodetree.process('neon-ls.decode', extra_args: '--decode=disas_neon_ls'), @@ -50,6 +51,7 @@ arm_ss.add(when: 'TARGET_AARCH64', if_true: files( 'sme_helper.c', 'translate-a64.c', 'translate-sve.c', + 'translate-sme.c', )) arm_softmmu_ss = ss.source_set()