Message ID | 20211122081910.1545117-1-siyu@isrc.iscas.ac.cn |
---|---|
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> 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 E2DD83857C58 for <patchwork@sourceware.org>; Mon, 22 Nov 2021 08:20:31 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from cstnet.cn (smtp21.cstnet.cn [159.226.251.21]) by sourceware.org (Postfix) with ESMTP id 7860D3858406 for <gcc-patches@gcc.gnu.org>; Mon, 22 Nov 2021 08:19:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7860D3858406 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=isrc.iscas.ac.cn Authentication-Results: sourceware.org; spf=none smtp.mailfrom=isrc.iscas.ac.cn Received: from localhost.localdomain (unknown [221.216.137.254]) by APP-01 (Coremail) with SMTP id qwCowACHUCN+Upthw+cjCA--.62405S2; Mon, 22 Nov 2021 16:19:10 +0800 (CST) From: siyu@isrc.iscas.ac.cn To: gcc-patches@gcc.gnu.org Subject: [PATCH v2 0/2] RISC-V: add gcc support for Scalar Cryptography v1.0.0-rc6 Date: Mon, 22 Nov 2021 16:19:08 +0800 Message-Id: <20211122081910.1545117-1-siyu@isrc.iscas.ac.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: qwCowACHUCN+Upthw+cjCA--.62405S2 X-Coremail-Antispam: 1UD129KBjvdXoW7Gw4xAr4fGF13tFWfKr1Utrb_yoWkXrg_AF yxKryUZw17Ca4fJayDJF45JrW2kFWUWry7XanYqry7Wry5XrZxJ3ykKryDKr1UC398t3Za kr97ZrySyr1a9jkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbTAFF20E14v26r4j6ryUM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_JFI_Gr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr0_ Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AKxVW8Jr 0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj 6xIIjxv20xvE14v26r1Y6r17McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr 0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7M4IIrI8v6xkF7I0E 8cxan2IY04v7M4kE6xkIj40Ew7xC0wCY02Avz4vE14v_GFyl42xK82IYc2Ij64vIr41l4I 8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AK xVWUGVWUWwC2zVAF1VAY17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcV AFwI0_JFI_Gr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8I cIk0rVWrJr0_WFyUJwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14 v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjfUeqXdUUUUU X-Originating-IP: [221.216.137.254] X-CM-SenderInfo: pvl13qplvuuh5lvft2wodfhubq/1tbiCwoNClz4knSJ3wAAsS X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00, FORGED_SPF_HELO, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KAM_NUMSUBJECT, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Cc: ben.marshall@pqshield.com, cmuellner@ventanamicro.com, andrew@sifive.com, Richard.Newell@microchip.com, jiawei@iscas.ac.cn, mjos@pqshield.com, kito.cheng@sifive.com, jimw@sifive.com Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
RISC-V: add gcc support for Scalar Cryptography v1.0.0-rc6
|
|
Message
siyu@isrc.iscas.ac.cn
Nov. 22, 2021, 8:19 a.m. UTC
From: SiYu Wu <siyu@isrc.iscas.ac.cn>
This patch add gcc backend support for RISC-V Scalar Cryptography
Extension (k-ext), including machine description, builtins defines and
testcases for each k-ext's subset.
A note about Zbkx: The Zbkx should be implemented in bitmanip's Zbp, but
since zbp is not included in the bitmanip spec v1.0, and crypto's v1.0
release will earlier than bitmanip's next release, so for now we
implementing it here.
Version logs:
v2: As Kito mentions, now this patch only includes the arch string related
stuff, the builtins and md changes is not included, waiting for the builtin
and intrinsic added to the spec. Also removed the unnecessary patches and add
Changelogs.
SiYu Wu (2):
RISC-V: Add option defines for Scalar Cryptography
RISC-V: Add implied defines of Zk, Zkn and Zks
gcc/common/config/riscv/riscv-common.c | 38 +++++++++++++++++++++++++-
gcc/config/riscv/arch-canonicalize | 16 ++++++++++-
gcc/config/riscv/riscv-opts.h | 22 +++++++++++++++
gcc/config/riscv/riscv.opt | 3 ++
4 files changed, 77 insertions(+), 2 deletions(-)
Comments
[Changing to Jim's new address] On Mon, 22 Nov 2021 00:19:08 PST (-0800), siyu@isrc.iscas.ac.cn wrote: > From: SiYu Wu <siyu@isrc.iscas.ac.cn> > > This patch add gcc backend support for RISC-V Scalar Cryptography > Extension (k-ext), including machine description, builtins defines and > testcases for each k-ext's subset. > > A note about Zbkx: The Zbkx should be implemented in bitmanip's Zbp, but > since zbp is not included in the bitmanip spec v1.0, and crypto's v1.0 > release will earlier than bitmanip's next release, so for now we > implementing it here. > > Version logs: > > v2: As Kito mentions, now this patch only includes the arch string related > stuff, the builtins and md changes is not included, waiting for the builtin > and intrinsic added to the spec. Also removed the unnecessary patches and add > Changelogs. I don't think there's anything wrong with what's here, but IMO we should hold off on merging until GCC does something with these extensions. IIUC all this enables is passing "-march=*Zk*" instead of "-Wa,-march=*Zk*", and while that is useful I'm worried it'll just make more of a headache for users who lose a simple way to detect the intrinsics. IMO forcing users to pass -Wa properly encodes the "GCC doesn't support these, but binutils does" scenario pretty sanely, and users doing things at this level of complexity should be used to that already because it happens somewhat frequently. I'm not sure if I'm missing some use case this for this, though. > SiYu Wu (2): > RISC-V: Add option defines for Scalar Cryptography > RISC-V: Add implied defines of Zk, Zkn and Zks > > gcc/common/config/riscv/riscv-common.c | 38 +++++++++++++++++++++++++- > gcc/config/riscv/arch-canonicalize | 16 ++++++++++- > gcc/config/riscv/riscv-opts.h | 22 +++++++++++++++ > gcc/config/riscv/riscv.opt | 3 ++ > 4 files changed, 77 insertions(+), 2 deletions(-)
I would prefer to accept those patchset even with no builtin function or intrinsic function yet, this not only add the support of -march option, but also introduce the predefined macros like __riscv_zk*, which could be used in *.S file to check if those instructions are available or not. On Wed, Nov 24, 2021 at 11:23 AM Palmer Dabbelt <palmer@rivosinc.com> wrote: > > [Changing to Jim's new address] > > On Mon, 22 Nov 2021 00:19:08 PST (-0800), siyu@isrc.iscas.ac.cn wrote: > > From: SiYu Wu <siyu@isrc.iscas.ac.cn> > > > > This patch add gcc backend support for RISC-V Scalar Cryptography > > Extension (k-ext), including machine description, builtins defines and > > testcases for each k-ext's subset. > > > > A note about Zbkx: The Zbkx should be implemented in bitmanip's Zbp, but > > since zbp is not included in the bitmanip spec v1.0, and crypto's v1.0 > > release will earlier than bitmanip's next release, so for now we > > implementing it here. > > > > Version logs: > > > > v2: As Kito mentions, now this patch only includes the arch string related > > stuff, the builtins and md changes is not included, waiting for the builtin > > and intrinsic added to the spec. Also removed the unnecessary patches and add > > Changelogs. > > I don't think there's anything wrong with what's here, but IMO we should > hold off on merging until GCC does something with these extensions. > > IIUC all this enables is passing "-march=*Zk*" instead of > "-Wa,-march=*Zk*", and while that is useful I'm worried it'll just make > more of a headache for users who lose a simple way to detect the > intrinsics. IMO forcing users to pass -Wa properly encodes the "GCC > doesn't support these, but binutils does" scenario pretty sanely, and > users doing things at this level of complexity should be used to that > already because it happens somewhat frequently. > > I'm not sure if I'm missing some use case this for this, though. > > > SiYu Wu (2): > > RISC-V: Add option defines for Scalar Cryptography > > RISC-V: Add implied defines of Zk, Zkn and Zks > > > > gcc/common/config/riscv/riscv-common.c | 38 +++++++++++++++++++++++++- > > gcc/config/riscv/arch-canonicalize | 16 ++++++++++- > > gcc/config/riscv/riscv-opts.h | 22 +++++++++++++++ > > gcc/config/riscv/riscv.opt | 3 ++ > > 4 files changed, 77 insertions(+), 2 deletions(-)
On Wed, 24 Nov 2021 02:00:33 PST (-0800), Kito Cheng wrote: > I would prefer to accept those patchset even with no builtin function > or intrinsic function yet, > this not only add the support of -march option, but also introduce the > predefined macros like __riscv_zk*, > which could be used in *.S file to check if those instructions are > available or not. That makes sense, I guess I hadn't thought of that use case. > On Wed, Nov 24, 2021 at 11:23 AM Palmer Dabbelt <palmer@rivosinc.com> wrote: >> >> [Changing to Jim's new address] >> >> On Mon, 22 Nov 2021 00:19:08 PST (-0800), siyu@isrc.iscas.ac.cn wrote: >> > From: SiYu Wu <siyu@isrc.iscas.ac.cn> >> > >> > This patch add gcc backend support for RISC-V Scalar Cryptography >> > Extension (k-ext), including machine description, builtins defines and >> > testcases for each k-ext's subset. >> > >> > A note about Zbkx: The Zbkx should be implemented in bitmanip's Zbp, but >> > since zbp is not included in the bitmanip spec v1.0, and crypto's v1.0 >> > release will earlier than bitmanip's next release, so for now we >> > implementing it here. >> > >> > Version logs: >> > >> > v2: As Kito mentions, now this patch only includes the arch string related >> > stuff, the builtins and md changes is not included, waiting for the builtin >> > and intrinsic added to the spec. Also removed the unnecessary patches and add >> > Changelogs. >> >> I don't think there's anything wrong with what's here, but IMO we should >> hold off on merging until GCC does something with these extensions. >> >> IIUC all this enables is passing "-march=*Zk*" instead of >> "-Wa,-march=*Zk*", and while that is useful I'm worried it'll just make >> more of a headache for users who lose a simple way to detect the >> intrinsics. IMO forcing users to pass -Wa properly encodes the "GCC >> doesn't support these, but binutils does" scenario pretty sanely, and >> users doing things at this level of complexity should be used to that >> already because it happens somewhat frequently. >> >> I'm not sure if I'm missing some use case this for this, though. >> >> > SiYu Wu (2): >> > RISC-V: Add option defines for Scalar Cryptography >> > RISC-V: Add implied defines of Zk, Zkn and Zks >> > >> > gcc/common/config/riscv/riscv-common.c | 38 +++++++++++++++++++++++++- >> > gcc/config/riscv/arch-canonicalize | 16 ++++++++++- >> > gcc/config/riscv/riscv-opts.h | 22 +++++++++++++++ >> > gcc/config/riscv/riscv.opt | 3 ++ >> > 4 files changed, 77 insertions(+), 2 deletions(-)
Hi SiYu: Committed, thanks! On Thu, Nov 25, 2021 at 12:42 AM Palmer Dabbelt <palmer@rivosinc.com> wrote: > > On Wed, 24 Nov 2021 02:00:33 PST (-0800), Kito Cheng wrote: > > I would prefer to accept those patchset even with no builtin function > > or intrinsic function yet, > > this not only add the support of -march option, but also introduce the > > predefined macros like __riscv_zk*, > > which could be used in *.S file to check if those instructions are > > available or not. > > That makes sense, I guess I hadn't thought of that use case. > > > On Wed, Nov 24, 2021 at 11:23 AM Palmer Dabbelt <palmer@rivosinc.com> wrote: > >> > >> [Changing to Jim's new address] > >> > >> On Mon, 22 Nov 2021 00:19:08 PST (-0800), siyu@isrc.iscas.ac.cn wrote: > >> > From: SiYu Wu <siyu@isrc.iscas.ac.cn> > >> > > >> > This patch add gcc backend support for RISC-V Scalar Cryptography > >> > Extension (k-ext), including machine description, builtins defines and > >> > testcases for each k-ext's subset. > >> > > >> > A note about Zbkx: The Zbkx should be implemented in bitmanip's Zbp, but > >> > since zbp is not included in the bitmanip spec v1.0, and crypto's v1.0 > >> > release will earlier than bitmanip's next release, so for now we > >> > implementing it here. > >> > > >> > Version logs: > >> > > >> > v2: As Kito mentions, now this patch only includes the arch string related > >> > stuff, the builtins and md changes is not included, waiting for the builtin > >> > and intrinsic added to the spec. Also removed the unnecessary patches and add > >> > Changelogs. > >> > >> I don't think there's anything wrong with what's here, but IMO we should > >> hold off on merging until GCC does something with these extensions. > >> > >> IIUC all this enables is passing "-march=*Zk*" instead of > >> "-Wa,-march=*Zk*", and while that is useful I'm worried it'll just make > >> more of a headache for users who lose a simple way to detect the > >> intrinsics. IMO forcing users to pass -Wa properly encodes the "GCC > >> doesn't support these, but binutils does" scenario pretty sanely, and > >> users doing things at this level of complexity should be used to that > >> already because it happens somewhat frequently. > >> > >> I'm not sure if I'm missing some use case this for this, though. > >> > >> > SiYu Wu (2): > >> > RISC-V: Add option defines for Scalar Cryptography > >> > RISC-V: Add implied defines of Zk, Zkn and Zks > >> > > >> > gcc/common/config/riscv/riscv-common.c | 38 +++++++++++++++++++++++++- > >> > gcc/config/riscv/arch-canonicalize | 16 ++++++++++- > >> > gcc/config/riscv/riscv-opts.h | 22 +++++++++++++++ > >> > gcc/config/riscv/riscv.opt | 3 ++ > >> > 4 files changed, 77 insertions(+), 2 deletions(-)