public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: siyu@isrc.iscas.ac.cn
To: gcc-patches@gcc.gnu.org
Cc: kito.cheng@sifive.com, jimw@sifive.com,
	cmuellner@ventanamicro.com, palmer@dabbelt.com,
	andrew@sifive.com, lazyparser@gmail.com, jiawei@iscas.ac.cn,
	ben.marshall@pqshield.com, mjos@pqshield.com,
	Richard.Newell@microchip.com, SiYu Wu <siyu@isrc.iscas.ac.cn>
Subject: [PATCH 19/21] [crypto]: add machine description for Zbkx
Date: Sun, 31 Oct 2021 17:34:43 +0800	[thread overview]
Message-ID: <20211031093445.1414518-20-siyu@isrc.iscas.ac.cn> (raw)
In-Reply-To: <20211031093445.1414518-1-siyu@isrc.iscas.ac.cn>

From: SiYu Wu <siyu@isrc.iscas.ac.cn>

NOTE: 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.
---
 gcc/config/riscv/crypto.md | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/gcc/config/riscv/crypto.md b/gcc/config/riscv/crypto.md
index 79ca2ec2696..8753f2f585c 100644
--- a/gcc/config/riscv/crypto.md
+++ b/gcc/config/riscv/crypto.md
@@ -42,6 +42,10 @@ (define_c_enum "unspec" [
   UNSPEC_SM3_P1
   UNSPEC_SM4_ED
   UNSPEC_SM4_KS
+
+  ;; Zbkx unspecs, see below
+  UNSPEC_XPERM8
+  UNSPEC_XPERM4
 ])
 
 
@@ -290,3 +294,26 @@ (define_insn "riscv_sm4ks_<mode>"
   "TARGET_ZKSED"
   "sm4ks\t%0,%1,%2")
 
+;; 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.
+;;                                                                   2021/10/24
+
+(define_insn "riscv_xperm8_<mode>"
+  [(set (match_operand:X 0 "register_operand" "=r")
+        (unspec:X [(match_operand:X 1 "register_operand" "r")
+                  (match_operand:X 2 "register_operand" "r")]
+                  UNSPEC_XPERM8))]
+  "TARGET_ZBKX"
+  "xperm8\t%0,%1,%2")
+
+(define_insn "riscv_xperm4_<mode>"
+  [(set (match_operand:X 0 "register_operand" "=r")
+        (unspec:X [(match_operand:X 1 "register_operand" "r")
+                  (match_operand:X 2 "register_operand" "r")]
+                  UNSPEC_XPERM4))]
+  "TARGET_ZBKX"
+  "xperm4\t%0,%1,%2")
+
-- 
2.25.1


  parent reply	other threads:[~2021-10-31  9:34 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-31  9:34 [PATCH 00/21] RISC-V: add gcc support for Scalar Cryptography v1.0.0-rc5 siyu
2021-10-31  9:34 ` [PATCH 01/21] Fix riscv_expand_block_move siyu
2021-11-02 10:45   ` Kito Cheng
2021-10-31  9:34 ` [PATCH 02/21] Fix attribute bugs due to zicsr/zifencei siyu
2021-11-02 10:42   ` Kito Cheng
2021-10-31  9:34 ` [PATCH 03/21] [crypto]: add machine description for Zknd and Zkne siyu
2021-10-31  9:34 ` [PATCH 04/21] [crypto]: add builtins " siyu
2021-10-31  9:34 ` [PATCH 05/21] [crypto]: add testcases " siyu
2021-10-31  9:34 ` [PATCH 06/21] [crypto]: add machine description for Zknh siyu
2021-10-31  9:34 ` [PATCH 07/21] [crypto]: add builtins " siyu
2021-10-31  9:34 ` [PATCH 08/21] [crypto]: add testcases " siyu
2021-10-31  9:34 ` [PATCH 09/21] [crypto]: add machine description for Zksed siyu
2021-10-31  9:34 ` [PATCH 10/21] [crypto]: add builtins " siyu
2021-10-31  9:34 ` [PATCH 11/21] [crypto]: add testcases " siyu
2021-10-31  9:34 ` [PATCH 12/21] [crypto]: add machine description for Zksh siyu
2021-10-31  9:34 ` [PATCH 13/21] [crypto]: add builtins " siyu
2021-10-31  9:34 ` [PATCH 14/21] [crypto]: add testcases " siyu
2021-11-03 22:54   ` Christoph Muellner
2021-10-31  9:34 ` [PATCH 15/21] [crypto]: add option defines for Zkr and Zkt siyu
2021-10-31  9:34 ` [PATCH 16/21] [crypto]: add option defines for Zbkb, Zbkc and Zbkx siyu
2021-10-31  9:34 ` [PATCH 17/21] [crypto]: add implied defines of Zk, Zkn and Zks siyu
2021-10-31  9:34 ` [PATCH 18/21] change z* subset assert to allow "zk" siyu
2021-10-31  9:34 ` siyu [this message]
2021-10-31  9:34 ` [PATCH 20/21] [crypto]: add builtins for Zbkx siyu
2021-11-02 11:16 ` [PATCH 00/21] RISC-V: add gcc support for Scalar Cryptography v1.0.0-rc5 Kito Cheng

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=20211031093445.1414518-20-siyu@isrc.iscas.ac.cn \
    --to=siyu@isrc.iscas.ac.cn \
    --cc=Richard.Newell@microchip.com \
    --cc=andrew@sifive.com \
    --cc=ben.marshall@pqshield.com \
    --cc=cmuellner@ventanamicro.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jiawei@iscas.ac.cn \
    --cc=jimw@sifive.com \
    --cc=kito.cheng@sifive.com \
    --cc=lazyparser@gmail.com \
    --cc=mjos@pqshield.com \
    --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).