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 1/5] Add prototypes for RISC-V Crypto built-in functions
Date: Thu, 16 Feb 2023 15:50:01 +0800 [thread overview]
Message-ID: <20230216075005.2600-2-shihua@iscas.ac.cn> (raw)
In-Reply-To: <20230216075005.2600-1-shihua@iscas.ac.cn>
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
Co-Authored-By: SiYu Wu
---
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))
--
2.38.1.windows.1
next prev parent reply other threads:[~2023-02-16 7:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-16 7:50 [PATCH V2 0/5] RISC-V: Implement Scalar Cryptography Extension Liao Shihua
2023-02-16 7:50 ` Liao Shihua [this message]
2023-02-16 7:50 ` [PATCH V2 2/5] Implement ZBKB, ZBKC and ZBKX extensions Liao Shihua
2023-02-16 7:50 ` [PATCH V2 3/5] Implement ZKND and ZKNE extensions Liao Shihua
2023-02-16 7:50 ` [PATCH V2 4/5] Implement ZKNH extensions Liao Shihua
2023-02-16 7:50 ` [PATCH V2 5/5] Implement ZKSH and ZKSED extensions Liao Shihua
2023-02-16 13:28 ` [PATCH V2 0/5] RISC-V: Implement Scalar Cryptography Extension Kito Cheng
2023-02-16 13:52 ` Markku-Juhani Olavi Saarinen
2023-02-16 14:00 ` Kito Cheng
2023-02-17 3:29 ` shihua
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230216075005.2600-2-shihua@iscas.ac.cn \
--to=shihua@iscas.ac.cn \
--cc=ben.marshall@pqshield.com \
--cc=christoph.muellner@vrull.eu \
--cc=gcc-patches@gcc.gnu.org \
--cc=jiawei@iscas.ac.cn \
--cc=kito.cheng@gmail.com \
--cc=mjos@iki.fi \
--cc=palmer@dabbelt.com \
--cc=shiyulong@iscas.ac.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).