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 lists1p.gnu.org (lists1p.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 5E9EFF4368A for ; Fri, 17 Apr 2026 10:47:52 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wDgjE-00011M-R7; Fri, 17 Apr 2026 06:47:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wDgjA-000104-PK; Fri, 17 Apr 2026 06:47:12 -0400 Received: from smtp21.cstnet.cn ([159.226.251.21] 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 1wDgj7-0007tO-Gz; Fri, 17 Apr 2026 06:47:12 -0400 Received: from Huawei.localdomain (unknown [36.110.52.2]) by APP-01 (Coremail) with SMTP id qwCowAB3H2ulD+JpLDmSDQ--.804S2; Fri, 17 Apr 2026 18:47:02 +0800 (CST) From: Molly Chen To: palmer@dabbelt.com, alistair.francis@wdc.com, liwei1518@gmail.com, daniel.barboza@oss.qualcomm.com, zhiwei_liu@linux.alibaba.com, chao.liu.zevorn@gmail.com Cc: xiaoou@iscas.ac.cn, qemu-riscv@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 00/14] target/riscv: add support for RISC-V P extension (v0.20 draft) Date: Fri, 17 Apr 2026 18:46:37 +0800 Message-Id: <20260417104652.17857-1-xiaoou@iscas.ac.cn> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: qwCowA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.2] X-CM-SenderInfo: 50ld003x6l2u1dvotugofq/ Received-SPF: pass client-ip=159.226.251.21; envelope-from=xiaoou@iscas.ac.cn; helo=cstnet.cn X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, HK_RANDOM_ENVFROM=0.998, HK_RANDOM_FROM=0.998, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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: qemu development 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 This series adds support for the RISC-V Packed SIMD (P) extension. The P extension defines packed-SIMD fixed-point operations intended for DSP-style workloads such as multimedia and signal processing. These instructions operate on packed subword elements within general-purpose registers (GPRs). The implementation follows the current development draft of the specification (v0.20): https://www.jhauser.us/RISCV/ext-P/ All instructions defined prior to the v0.20 update were verified using a simple instruction coverage test suite: https://github.com/mollybuild/qemu-riscv-test-uart Instructions newly introduced in v0.20 were not tested yet because toolchain support for generating them is still under development. The implementation focuses on functional correctness and ISA coverage. Performance optimizations were not considered at this stage. Feedback on implementation details would be highly appreciated. Co-Authored by: Yin Zhang Co-Authored by: Dajun Huang Co-Authored by: Zhiyuan Yang Molly Chen (14): target/riscv: rvp: Add option defines and dependency check for packed simd extension target/riscv: rvp: add arithmetic instructions,including saturating and non-saturating operations target/riscv: rvp: add averaging operations target/riscv: rvp: add absolute value and difference,comparison and mask generation operations target/riscv: rvp: add shift operations target/riscv: rvp: add exchange operations target/riscv: rvp: add horizontal reduction, pack, merge and cout leading operations target/riscv: rvp: add pure multiplication operations target/riscv: rvp: add multiply-accumulate operations target/riscv: rvp: add Q-format multiplication operations target/riscv: rvp: add two-way and four-way multiply and accumulate operations target/riscv: rvp: add load and replicate instructions. target/riscv: rvp: add rv32-only register-pair instructions target/riscv: rvp: update to v020, add SHL and PNCLIP[U]P.* instructions target/riscv/cpu.c | 5 +- target/riscv/cpu.h | 1 + target/riscv/helper.h | 531 ++ target/riscv/insn32.decode | 829 ++ target/riscv/insn_trans/trans_rvp.c.inc | 1691 ++++ target/riscv/meson.build | 3 +- target/riscv/psimd_helper.c | 9452 +++++++++++++++++++++++ target/riscv/tcg/tcg-cpu.c | 16 + target/riscv/translate.c | 3 + 9 files changed, 12528 insertions(+), 3 deletions(-) create mode 100644 target/riscv/insn_trans/trans_rvp.c.inc create mode 100644 target/riscv/psimd_helper.c -- 2.34.1