From patchwork Thu Feb 9 11:06:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yulong X-Patchwork-Id: 1739881 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PCDb50Cpzz23hX for ; Thu, 9 Feb 2023 22:06:55 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DBBD8385B519 for ; Thu, 9 Feb 2023 11:06:52 +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 ESMTP id 04DEA3858C60 for ; Thu, 9 Feb 2023 11:06:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 04DEA3858C60 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 [43.139.163.53]) by APP-01 (Coremail) with SMTP id qwCowABXcNS20+RjQ2g2BA--.63625S2; Thu, 09 Feb 2023 19:06:30 +0800 (CST) From: shiyulong@iscas.ac.cn To: gcc-patches@gcc.gnu.org Cc: andrew@sifive.com, palmer@dabbelt.com, kito.cheng@gmail.com, jim.wilson.gcc@gmail.com, philipp.tomsich@vrull.eu, research_trasio@irq.a4lg.com, wuwei2016@iscas.ac.cn, jiawei@iscas.ac.cn, shihua@iscas.ac.cn, chenyixuan@iscas.ac.cn, yulong Subject: [PATCH V1 0/1] UNRATIFIED RISC-V:Add 'ZiCond' extension Date: Thu, 9 Feb 2023 19:06:16 +0800 Message-Id: <20230209110617.3370-1-shiyulong@iscas.ac.cn> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: qwCowABXcNS20+RjQ2g2BA--.63625S2 X-Coremail-Antispam: 1UD129KBjvJXoW7AFWUAw4kKr17AF15Kr1rJFb_yoW8AryUpF 4UGrW5Ca45Ar9xWw4ftryjqw15CrnYg3yru397Aw10yFW5ZrZFyFn5Kw17Xr15XF4rJr4f ur4jkry5uw12y3DanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUU9v14x267AKxVW8JVW5JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26r4j6ryUM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4j 6F4UM28EF7xvwVC2z280aVAFwI0_Cr1j6rxdM28EF7xvwVC2z280aVCY1x0267AKxVW0oV Cq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0 I7IYx2IY67AKxVWUGVWUXwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r 4UM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwACI402YVCY1x02628v n2kIc2xKxwAKzVCY07xG64k0F24lc2xSY4AK6cvj6r4kMxAIw28IcxkI7VAKI48JMxC20s 026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_ JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14 v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAIw20EY4v20xva j40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVW8JV W8JrUvcSsGvfC2KfnxnUUI43ZEXa7VU1jQ6JUUUUU== X-Originating-IP: [43.139.163.53] X-CM-SenderInfo: 5vkl53porqwq5lvft2wodfhubq/ X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_SHORT, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP 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+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" From: yulong *** WAIT FOR SPECIFICATION FREEZE *** This is an implementation for unratified and not frozen RISC-V extension and not intended to be merged for now. The intent to submit this patchset is to synchronize with the implementation of binutils about the ZiCond extension. This patchset adds following unratified extension to GNU gcc: - 'ZiCond'(Integer Conditional Operations) version 1.0 development which adds 2 instructions ('czero.eqz' and 'czero.nez'). This extension makes conditional arithmetic feature much simpler (fewer instructions when no branches are allowed). Note that constant timing guarantee (data-independence / certain side-channel resistance) for this extension is being discussed and may not be guaranteed. This is based on the commit 394e24376939 of the specification document: *** BLURB HERE *** yulong (1): UNRATIFIED RISC-V: Add 'ZiCond' extension gcc/common/config/riscv/riscv-common.cc | 4 ++++ gcc/config/riscv/riscv-builtins.cc | 8 ++++++++ gcc/config/riscv/riscv-ftypes.def | 2 ++ gcc/config/riscv/riscv-opts.h | 3 +++ gcc/config/riscv/riscv-zicond.def | 5 +++++ gcc/config/riscv/riscv.md | 22 ++++++++++++++++++++++ gcc/config/riscv/riscv.opt | 3 +++ gcc/testsuite/gcc.target/riscv/zicond-1.c | 15 +++++++++++++++ gcc/testsuite/gcc.target/riscv/zicond-2.c | 15 +++++++++++++++ 9 files changed, 77 insertions(+) create mode 100644 gcc/config/riscv/riscv-zicond.def create mode 100644 gcc/testsuite/gcc.target/riscv/zicond-1.c create mode 100644 gcc/testsuite/gcc.target/riscv/zicond-2.c