Message ID | 20230216074544.2567-1-shihua@iscas.ac.cn |
---|---|
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp165272wrn; Wed, 15 Feb 2023 23:49:18 -0800 (PST) X-Google-Smtp-Source: AK7set/tVsb3+Ca6DiqDIqaW8UMB2RkGpK+883TN2XsLEh/yoRbGsO2jIhq+UHzFm2/9Ctxj+8MW X-Received: by 2002:a17:906:3b15:b0:878:6519:c740 with SMTP id g21-20020a1709063b1500b008786519c740mr5989815ejf.44.1676533758219; Wed, 15 Feb 2023 23:49:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676533758; cv=none; d=google.com; s=arc-20160816; b=h7a5Nocf7cy4PGeNDz4hZMtO6UUFuUwIGn7KY8TgY8ZhjufbmkK2iXjatEocnOL91i 8/dNB2494p8d5OnMepaTBbVNUxeiGulEGrrPgw8EXfNSmrAT1MCR1Jua9zvF+496E+N6 DJSPw1wh/iOQBxfNLVLp0d5TkxYlcnN4VIHgym09haK8yPFehFhX7il/HI/jtHZOUT8t hxqc2FkkD7Vvcf9FzTQx6AjxzjzJ4+DGPJL1vDl2NVW8b7hGgSzU1Ul1W6Aq143BaTqY ziXs+z9murpiMM6l2kd+JSX1xuAO/pDpmJ1DalAqwcRE0BEwkgzEv5mDalcRFr8b4N6p 1nJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dmarc-filter :delivered-to; bh=Z2cNyp63piq8F6dp6G7SVSL2JNgxGRQMVeSSvifBcgI=; b=o8Gab8C0EQq9rRE4XiBrxuDWcQjyUHE7VGfQDyJxHgqFQZxHEaVr0ZekTqOHBgdOuh upYWIFUhyc33wjtkwTV9rqLWWDOVB8mEAR1IFOKgkZgrc+7xSqhXI36hF5MccfWc29By peX8DXA2Brt1e88p2MOv3ClzUOh2fVIH7pwGV82e9uSNPHtS3lypKns//g6ZytIz3Ob3 up5nqSY0/8GiJgO5t+ikx/F82JRIQfZVZ7rLqFK9nSyHszki/UzyLrMew/SAfHPtIgwT 67/hH0KUQJXrRQUFvtWy6aHOYhScENgEJ1ZyAIR/2FvfEFIk998GiGm8eKj5mFtOgWyh cPeA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id z13-20020a17090674cd00b008785a767443si1670275ejl.348.2023.02.15.23.49.18 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Feb 2023 23:49:18 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B25FB385E004 for <ouuuleilei@gmail.com>; Thu, 16 Feb 2023 07:47:27 +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 177BC385840D for <gcc-patches@gcc.gnu.org>; Thu, 16 Feb 2023 07:46:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 177BC385840D 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 [39.170.88.238]) by APP-01 (Coremail) with SMTP id qwCowABHYNRA3+1jimRbBQ--.9693S2; Thu, 16 Feb 2023 15:46:10 +0800 (CST) From: Liao Shihua <shihua@iscas.ac.cn> To: gcc-patches@gcc.gnu.org Cc: jiawei@iscas.ac.cn, kito.cheng@gmail.com, mjos@iki.fi, palmer@dabbelt.com, shiyulong@iscas.ac.cn, ben.marshall@pqshield.com, christoph.muellner@vrull.eu, Liao Shihua <shihua@iscas.ac.cn> Subject: [PATCH V2 0/5] RISC-V: Implement Scalar Cryptography Extension Date: Thu, 16 Feb 2023 15:45:39 +0800 Message-Id: <20230216074544.2567-1-shihua@iscas.ac.cn> X-Mailer: git-send-email 2.38.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: qwCowABHYNRA3+1jimRbBQ--.9693S2 X-Coremail-Antispam: 1UD129KBjvJXoWxWFWUZF18Cry8try3Jr17Awb_yoW5Zry8pa 1rGrWFkFy5JF9rGr1ftFy7ta1Uuw4vgrW5uw1xJr1IyFWftrWDtFn7Kw1xAFW3JF48Grn3 ur4I93W5uw12qFDanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUyG14x267AKxVW8JVW5JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26r1I6r4UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4j 6F4UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Cr 1j6rxdM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj 6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr 0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7MxAIw28IcxkI7VAK I48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7 xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42IY6xII jxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw2 0EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x02 67AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7VUbXdbUUUUUU== X-Originating-IP: [39.170.88.238] X-CM-SenderInfo: xvklx33d6l2u1dvotugofq/1tbiAw0EEWPt1f0fHgAAs8 X-Spam-Status: No, score=-6.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 <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> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757973061888249615?= X-GMAIL-MSGID: =?utf-8?q?1757973061888249615?= |
Series |
RISC-V: Implement Scalar Cryptography Extension
|
|
Message
Liao Shihua
Feb. 16, 2023, 7:45 a.m. UTC
This series adds basic support for the Scalar Cryptography extensions: * Zbkb * Zbkc * Zbkx * Zknd * Zkne * Zknh * Zksed * Zksh The implementation follows the version Scalar Cryptography v1.0.0 of the specification, and the intrinsic of Scalar Cryptography extensions follows riscv-c-api which can be found here: https://github.com/riscv/riscv-crypto/releases/tag/v1.0.0-scalar https://github.com/riscv-non-isa/riscv-c-api-doc/pull/31 It works by Wu Siyu and Liao Shihua . Liao Shihua (5): Add prototypes for RISC-V Crypto built-in functions Implement ZBKB, ZBKC and ZBKX extensions Implement ZKND and ZKNE extensions Implement ZKNH extensions Implement ZKSH and ZKSED extensions gcc/config.gcc | 2 +- gcc/config/riscv/bitmanip.md | 20 +- gcc/config/riscv/constraints.md | 8 + gcc/config/riscv/crypto.md | 435 ++++++++++++++++++ gcc/config/riscv/riscv-builtins.cc | 26 ++ gcc/config/riscv/riscv-crypto.def | 94 ++++ gcc/config/riscv/riscv-ftypes.def | 10 + gcc/config/riscv/riscv.md | 4 +- gcc/config/riscv/riscv_scalar_crypto.h | 218 +++++++++ gcc/testsuite/gcc.target/riscv/zbkb32.c | 36 ++ gcc/testsuite/gcc.target/riscv/zbkb64.c | 28 ++ gcc/testsuite/gcc.target/riscv/zbkc32.c | 17 + gcc/testsuite/gcc.target/riscv/zbkc64.c | 17 + gcc/testsuite/gcc.target/riscv/zbkx32.c | 18 + gcc/testsuite/gcc.target/riscv/zbkx64.c | 18 + gcc/testsuite/gcc.target/riscv/zknd32.c | 18 + gcc/testsuite/gcc.target/riscv/zknd64.c | 36 ++ gcc/testsuite/gcc.target/riscv/zkne32.c | 18 + gcc/testsuite/gcc.target/riscv/zkne64.c | 30 ++ gcc/testsuite/gcc.target/riscv/zknh-sha256.c | 29 ++ .../gcc.target/riscv/zknh-sha512-32.c | 43 ++ .../gcc.target/riscv/zknh-sha512-64.c | 31 ++ gcc/testsuite/gcc.target/riscv/zksed.c | 20 + gcc/testsuite/gcc.target/riscv/zksh.c | 19 + 24 files changed, 1183 insertions(+), 12 deletions(-) create mode 100644 gcc/config/riscv/crypto.md create mode 100644 gcc/config/riscv/riscv-crypto.def create mode 100644 gcc/config/riscv/riscv_scalar_crypto.h create mode 100644 gcc/testsuite/gcc.target/riscv/zbkb32.c create mode 100644 gcc/testsuite/gcc.target/riscv/zbkb64.c create mode 100644 gcc/testsuite/gcc.target/riscv/zbkc32.c create mode 100644 gcc/testsuite/gcc.target/riscv/zbkc64.c create mode 100644 gcc/testsuite/gcc.target/riscv/zbkx32.c create mode 100644 gcc/testsuite/gcc.target/riscv/zbkx64.c create mode 100644 gcc/testsuite/gcc.target/riscv/zknd32.c create mode 100644 gcc/testsuite/gcc.target/riscv/zknd64.c create mode 100644 gcc/testsuite/gcc.target/riscv/zkne32.c create mode 100644 gcc/testsuite/gcc.target/riscv/zkne64.c create mode 100644 gcc/testsuite/gcc.target/riscv/zknh-sha256.c create mode 100644 gcc/testsuite/gcc.target/riscv/zknh-sha512-32.c create mode 100644 gcc/testsuite/gcc.target/riscv/zknh-sha512-64.c create mode 100644 gcc/testsuite/gcc.target/riscv/zksed.c create mode 100644 gcc/testsuite/gcc.target/riscv/zksh.c