From patchwork Fri May 19 02:19:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weiwei Li X-Patchwork-Id: 13247601 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AD96AC77B7A for ; Fri, 19 May 2023 02:25:42 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzpmu-0004Uj-Sk; Thu, 18 May 2023 22:24:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzpml-0004Ri-F9; Thu, 18 May 2023 22:24:05 -0400 Received: from smtp80.cstnet.cn ([159.226.251.80] helo=cstnet.cn) by eggs.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1pzpmh-00028u-NT; Thu, 18 May 2023 22:24:02 -0400 Received: from localhost.localdomain (unknown [61.165.33.195]) by APP-01 (Coremail) with SMTP id qwCowACHjw+x3WZkAeNjAQ--.12622S2; Fri, 19 May 2023 10:23:46 +0800 (CST) From: Weiwei Li To: qemu-riscv@nongnu.org, qemu-devel@nongnu.org Cc: palmer@dabbelt.com, alistair.francis@wdc.com, bin.meng@windriver.com, dbarboza@ventanamicro.com, zhiwei_liu@linux.alibaba.com, wangjunqiang@iscas.ac.cn, lazyparser@gmail.com, Weiwei Li Subject: [PATCH 0/7] Add support for extension specific disas Date: Fri, 19 May 2023 10:19:19 +0800 Message-Id: <20230519021926.15362-1-liweiwei@isc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FwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVWUJVW8JbIYCTnIWI evJa73UjIFyTuYvjfUO_MaUUUUU X-Originating-IP: [61.165.33.195] X-CM-SenderInfo: 5olzvxxzhlqxpvfd2hldfou0/ Received-SPF: pass client-ip=159.226.251.80; envelope-from=liweiwei@iscas.ac.cn; helo=cstnet.cn X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Some extensions have conflict encodings, such as * Z*inx reuse the same encodings as normal float point extensions. * Zcm* reuse the some encodings of Zcd. * Custom extensions from different vendors may share the same encodings. To resolve this problem, this patchset tries to pass RISCVCPUConfig as disasemble_info.target_info to support extension specific disas, which means that the disas for this extensions is supported only when the related extension is supported. This patchset also fixes some style problems in disas/riscv.c. The port is available here: https://github.com/plctlab/plct-qemu/tree/plct-disas-upstream Weiwei Li (7): disas: Change type of disassemble_info.target_info to pointer target/riscv: Pass RISCVCPUConfig as target_info to disassemble_info disas/riscv.c: Support disas for Zcm* extensions disas/riscv.c: Support disas for Z*inx extensions disas/riscv.c: Remove unused decomp_rv32/64 value for vector instructions disas/riscv.c: Fix lines with over 80 characters disas/riscv.c: Remove redundant parentheses disas/riscv.c | 1206 +++++++++++++++++++++------------------ include/disas/dis-asm.h | 2 +- target/riscv/cpu.c | 1 + target/riscv/cpu.h | 114 +--- target/riscv/cpu_cfg.h | 135 +++++ 5 files changed, 789 insertions(+), 669 deletions(-) create mode 100644 target/riscv/cpu_cfg.h