From patchwork Mon Feb 13 10:45:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liao Shihua X-Patchwork-Id: 56194 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2275975wrn; Mon, 13 Feb 2023 02:47:53 -0800 (PST) X-Google-Smtp-Source: AK7set8HFcIDK8iQYKcDBtK6gK9gD1INVTrcKlg6xdNR3W6kOseaOfrmk+e219KQ8V2DE5AhLcYB X-Received: by 2002:a17:906:db0b:b0:87b:dc07:380f with SMTP id xj11-20020a170906db0b00b0087bdc07380fmr31835538ejb.0.1676285273602; Mon, 13 Feb 2023 02:47:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676285273; cv=none; d=google.com; s=arc-20160816; b=sxeBTLuWuCTaRoCvotK0IYH58BhZoBsV6wcc9ZUabnpMDTAWhievoaXeBEbTqpWU7R w/1YOnaRFr7u7NSB4u+ROf2Kih6P4S/KhYALs9gexpVR4aY1c0Wocx76eT9/sr5Ndd9i Tb3kjXEpLrfh5hgHCNvRbWN+ZNurDyBFgPCE81ZrFX3mVb6Q1xkCICqfcQmPZaZ6lgP4 T0mPJ2s03IPCspbbF2NlNtdgvbmV0Ng6/RTfk8OB8H9Pu7R1qvW5n/7ZVQ+As+WNTQiZ +WG7Ii27PFZTpDSO8uBNuAycHTM2BfWTH8vQ52hTsz5jQ4cm8NHwu0WePi2Wh98n8h8C nqUQ== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dmarc-filter:delivered-to; bh=xkAzNil8Y1lcIsNTF6p9+z8PAdEx2iDx94DClun1nKU=; b=bR5XtFkcDsj7TLX6tqcO4ydSz3kfrR2vWrFI0NRahUQRUph8B6R7/bj9pH0HafItSw GprHBhTjVLYPls8SbDHTCeBLH3hxC0+rhhKL67ZoJDAErtf6JQWfnZ6zHfajLfGZ86/5 wCXbcvOoYbDTGKbWFoXvKdcNm+mCkMj1oGjTsmRoXf5Sq8U3YzzFP+2WeoFWyF92axgy tGo+ZuASIC61jd9U7TjJWLF4/O5X2EhNrdIcb+0x2c5pqk9AIxUWY0WXdslgNHAaC4kC LpVIDvjwB7e6qL+x6rQQ/VLh2KM2DeIUCkQDX0k1gAE2Z2rsJ9m+k92GbAmv0RTri7Lr Nx7g== 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 ep16-20020a1709069b5000b0088f8cd24b7fsi10975891ejc.663.2023.02.13.02.47.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 02:47:53 -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 C6EDD382E68F for ; Mon, 13 Feb 2023 10:46:34 +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 B69963854153 for ; Mon, 13 Feb 2023 10:45:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B69963854153 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 qwCowAB3fc3gFOpjeCzlBA--.20197S3; Mon, 13 Feb 2023 18:45:54 +0800 (CST) From: Liao Shihua To: gcc-patches@gcc.gnu.org Cc: palmer@dabbelt.com, kito.cheng@gmail.com, jiawei@iscas.ac.cn, jeff@riscv.org, mjos@iki.fi, ben.marshall@pqshield.com, Liao Shihua Subject: [PATCH 1/5] RISC-V: Add prototypes for RISC-V Crypto built-in functions Date: Mon, 13 Feb 2023 18:45:34 +0800 Message-Id: <20230213104538.1287-2-shihua@iscas.ac.cn> X-Mailer: git-send-email 2.38.1.windows.1 In-Reply-To: <20230213104538.1287-1-shihua@iscas.ac.cn> References: <20230213104538.1287-1-shihua@iscas.ac.cn> MIME-Version: 1.0 X-CM-TRANSID: qwCowAB3fc3gFOpjeCzlBA--.20197S3 X-Coremail-Antispam: 1UD129KBjvJXoWxuF4UWr13Zr4DKryftw1kKrg_yoW5ArW7pa 18Kan5Crn5J3Z3Gw4xtF1rtr4ft39ag3y5JwsxZF43AFW7WryvqF1qga1UWw1DuF1UGw1j 934rKFyF9r4Ykr7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUU9m14x267AKxVW5JVWrJwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_Jr4l82xGYIkIc2 x26xkF7I0E14v26r1I6r4UM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0 Y4vE2Ix0cI8IcVAFwI0_tr0E3s1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJw A2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq3wAS 0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2 IY67AKxVWUAVWUtwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0 Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCF04k20xvY0x0EwIxGrwCFx2 IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v2 6r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67 AKxVW8JVW5JwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IY s7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r4j6F4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr 0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0JUy6wZUUUUU= X-Originating-IP: [39.170.88.238] X-CM-SenderInfo: xvklx33d6l2u1dvotugofq/1tbiAwsBEWPp-7A12gAAsy X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, 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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757712506898805074?= X-GMAIL-MSGID: =?utf-8?q?1757712506898805074?= Add prototypes for RISC-V Crypto built-in functions . gcc/ChangeLog: * config/riscv/riscv-builtins.cc (RISCV_FTYPE_NAME2): New enumeration identifier. (RISCV_FTYPE_NAME3): Likewise. (RISCV_ATYPE_QI): New Argument types. (RISCV_ATYPE_HI): Likewise. (RISCV_FTYPE_ATYPES2): New RISCV_ATYPE. (RISCV_FTYPE_ATYPES3): Likewise. * config/riscv/riscv-ftypes.def (2): New Definitions of prototypes. (3):Likewise --- gcc/config/riscv/riscv-builtins.cc | 8 ++++++++ gcc/config/riscv/riscv-ftypes.def | 10 ++++++++++ 2 files changed, 18 insertions(+) diff --git a/gcc/config/riscv/riscv-builtins.cc b/gcc/config/riscv/riscv-builtins.cc index 25ca407f9a9..ded91e17554 100644 --- a/gcc/config/riscv/riscv-builtins.cc +++ b/gcc/config/riscv/riscv-builtins.cc @@ -42,6 +42,8 @@ along with GCC; see the file COPYING3. If not see /* Macros to create an enumeration identifier for a function prototype. */ #define RISCV_FTYPE_NAME0(A) RISCV_##A##_FTYPE #define RISCV_FTYPE_NAME1(A, B) RISCV_##A##_FTYPE_##B +#define RISCV_FTYPE_NAME2(A, B, C) RISCV_##A##_FTYPE_##B##_##C +#define RISCV_FTYPE_NAME3(A, B, C, D) RISCV_##A##_FTYPE_##B##_##C##_##D /* Classifies the prototype of a built-in function. */ enum riscv_function_type { @@ -132,6 +134,8 @@ AVAIL (always, (!0)) /* Argument types. */ #define RISCV_ATYPE_VOID void_type_node #define RISCV_ATYPE_USI unsigned_intSI_type_node +#define RISCV_ATYPE_QI intQI_type_node +#define RISCV_ATYPE_HI intHI_type_node #define RISCV_ATYPE_SI intSI_type_node #define RISCV_ATYPE_DI intDI_type_node #define RISCV_ATYPE_VOID_PTR ptr_type_node @@ -142,6 +146,10 @@ AVAIL (always, (!0)) RISCV_ATYPE_##A #define RISCV_FTYPE_ATYPES1(A, B) \ RISCV_ATYPE_##A, RISCV_ATYPE_##B +#define RISCV_FTYPE_ATYPES2(A, B, C) \ + RISCV_ATYPE_##A, RISCV_ATYPE_##B, RISCV_ATYPE_##C +#define RISCV_FTYPE_ATYPES3(A, B, C, D) \ + RISCV_ATYPE_##A, RISCV_ATYPE_##B, RISCV_ATYPE_##C, RISCV_ATYPE_##D static const struct riscv_builtin_description riscv_builtins[] = { #include "riscv-cmo.def" diff --git a/gcc/config/riscv/riscv-ftypes.def b/gcc/config/riscv/riscv-ftypes.def index 3a40c33e7c2..3b518195a29 100644 --- a/gcc/config/riscv/riscv-ftypes.def +++ b/gcc/config/riscv/riscv-ftypes.def @@ -32,3 +32,13 @@ DEF_RISCV_FTYPE (1, (VOID, USI)) DEF_RISCV_FTYPE (1, (VOID, VOID_PTR)) DEF_RISCV_FTYPE (1, (SI, SI)) DEF_RISCV_FTYPE (1, (DI, DI)) +DEF_RISCV_FTYPE (2, (SI, QI, QI)) +DEF_RISCV_FTYPE (2, (SI, HI, HI)) +DEF_RISCV_FTYPE (2, (SI, SI, SI)) +DEF_RISCV_FTYPE (2, (DI, QI, QI)) +DEF_RISCV_FTYPE (2, (DI, HI, HI)) +DEF_RISCV_FTYPE (2, (DI, SI, SI)) +DEF_RISCV_FTYPE (2, (DI, DI, SI)) +DEF_RISCV_FTYPE (2, (DI, DI, DI)) +DEF_RISCV_FTYPE (3, (SI, SI, SI, SI)) +DEF_RISCV_FTYPE (3, (DI, DI, DI, SI))