public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Liao Shihua <shihua@iscas.ac.cn>
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 <shihua@iscas.ac.cn>
Subject: [PATCH 1/5] RISC-V: Add prototypes for RISC-V Crypto built-in functions
Date: Mon, 13 Feb 2023 18:45:34 +0800	[thread overview]
Message-ID: <20230213104538.1287-2-shihua@iscas.ac.cn> (raw)
In-Reply-To: <20230213104538.1287-1-shihua@iscas.ac.cn>

    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))
-- 
2.38.1.windows.1


  reply	other threads:[~2023-02-13 10:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-13 10:45 [PATCH 0/5] RISC-V: Implement Scalar Cryptography Extension Liao Shihua
2023-02-13 10:45 ` Liao Shihua [this message]
2023-02-13 10:45 ` [PATCH 2/5] RISC-V: Implement ZBKB, ZBKC and ZBKX extensions Liao Shihua
2023-02-13 10:45 ` [PATCH 3/5] RISC-V: Implement ZKND and ZKNE extensions Liao Shihua
2023-02-13 10:45 ` [PATCH 4/5] RISC-V: Implement ZKNH extensions Liao Shihua
2023-02-13 10:45 ` [PATCH 5/5] RISC-V: Implement ZKSH and ZKSED extensions Liao 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=20230213104538.1287-2-shihua@iscas.ac.cn \
    --to=shihua@iscas.ac.cn \
    --cc=ben.marshall@pqshield.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jeff@riscv.org \
    --cc=jiawei@iscas.ac.cn \
    --cc=kito.cheng@gmail.com \
    --cc=mjos@iki.fi \
    --cc=palmer@dabbelt.com \
    /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).