From patchwork Wed Jun 7 12:56:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiawei X-Patchwork-Id: 55820 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F3EF7385C6E8 for ; Wed, 7 Jun 2023 12:57:24 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from cstnet.cn (smtp80.cstnet.cn [159.226.251.80]) by sourceware.org (Postfix) with ESMTPS id F3109385771F for ; Wed, 7 Jun 2023 12:57:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F3109385771F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=iscas.ac.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=iscas.ac.cn Received: from localhost.localdomain (unknown [47.106.175.39]) by APP-01 (Coremail) with SMTP id qwCowADX3haXfoBkAQ8HDQ--.38410S2; Wed, 07 Jun 2023 20:56:56 +0800 (CST) From: Jiawei To: gcc-patches@gcc.gnu.org Cc: kito.cheng@sifive.com, palmer@dabbelt.com, christoph.muellner@vrull.eu, jeremy.bennett@embecosm.com, mary.bennett@embecosm.com, nandni.jamnadas@embecosm.com, charlie.keaney@embecosm.com, simon.cook@embecosm.com, tariq.kurd@codasip.com, ibrahim.abu.kharmeh1@huawei.com, gaofei@eswincomputing.com, sinan.lin@linux.alibaba.com, wuwei2016@iscas.ac.cn, shihua@iscas.ac.cn, shiyulong@iscas.ac.cn, chenyixuan@iscas.ac.cn, Jiawei Subject: [PATCH v2 0/3] RISC-V: Support ZC* extensions. Date: Wed, 7 Jun 2023 20:56:38 +0800 Message-Id: <20230607125641.727633-1-jiawei@iscas.ac.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CM-TRANSID: qwCowADX3haXfoBkAQ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106.175.39] X-CM-SenderInfo: 5mld4v3l6l2u1dvotugofq/1tbiCQcPAGSAdOkYDgAAsu X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" RISC-V Code Size Reduction(ZC*) extensions is a group of extensions which define subsets of the existing C extension (Zca, Zcd, Zcf) and new extensions(Zcb, Zcmp, Zcmt) which only contain 16-bit encodings.[1] The implementation of the RISC-V Code Size Reduction extension in GCC is an important step towards making the RISC-V architecture more efficient. The cooperation with OpenHW group has played a crucial role in this effort, with facilitating the implementation, testing and validation. Currently works can also find in OpenHW group's github repo.[2] Thanks to Tariq Kurd, Ibrahim Abu Kharmeh for help with explain the specification, and Jeremy Bennett's patient guidance throughout the whole development process.a V2 changes: Fix Kito's comments in first version, Eswin assisted in optimizing the implementation of Zcmp extension: https://gcc.gnu.org/pipermail/gcc-patches/2023-May/617440.html https://gcc.gnu.org/pipermail/gcc-patches/2023-May/617442.html https://gcc.gnu.org/pipermail/gcc-patches/2023-June/620869.html [1] github.com/riscv/riscv-code-size-reduction/tree/main/Zc-specification [2] github.com/openhwgroup/corev-gcc Co-Authored by: Charlie Keaney Co-Authored by: Mary Bennett Co-Authored by: Nandni Jamnadas Co-Authored by: Sinan Lin Co-Authored by: Simon Cook Co-Authored by: Shihua Liao Co-Authored by: Yulong Shi RISC-V: Minimal support for ZC extensions. RISC-V: Enable compressible features when use ZC* extensions. RISC-V: Add ZC* test for march args being passed. Jiawei (3): RISC-V: Minimal support for ZC* extensions. RISC-V: Enable compressible features when use ZC* extensions. RISC-V: Add ZC* test for failed march args being passed. gcc/common/config/riscv/riscv-common.cc | 38 +++++++++++++++++++++++ gcc/config/riscv/riscv-c.cc | 2 +- gcc/config/riscv/riscv-opts.h | 16 ++++++++++ gcc/config/riscv/riscv-shorten-memrefs.cc | 3 +- gcc/config/riscv/riscv.cc | 11 ++++--- gcc/config/riscv/riscv.h | 2 +- gcc/config/riscv/riscv.opt | 3 ++ gcc/testsuite/gcc.target/riscv/arch-22.c | 5 +++ gcc/testsuite/gcc.target/riscv/arch-23.c | 5 +++ 9 files changed, 78 insertions(+), 7 deletions(-) create mode 100644 gcc/testsuite/gcc.target/riscv/arch-22.c create mode 100644 gcc/testsuite/gcc.target/riscv/arch-23.c