public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* RISC-V: Replace unspec with bitreverse in riscv_brev8_<mode> insn
@ 2023-07-26  7:54 Jivan Hakobyan
  2023-07-26  8:21 ` Kito Cheng
  0 siblings, 1 reply; 3+ messages in thread
From: Jivan Hakobyan @ 2023-07-26  7:54 UTC (permalink / raw)
  To: gcc-patches


[-- Attachment #1.1: Type: text/plain, Size: 252 bytes --]

This small patch replaces unspec opcode with bitreverse in
riscv_brev8_<mode> insn.

gcc/ChangeLog:
        * config/riscv/crypto.md (UNSPEC_BREV8): Remov.
        (riscv_brev8_<mode>): Use bitreverse opcode.


-- 
With the best regards
Jivan Hakobyan

[-- Attachment #2: remove_unspec_brev8.diff --]
[-- Type: text/x-patch, Size: 671 bytes --]

diff --git a/gcc/config/riscv/crypto.md b/gcc/config/riscv/crypto.md
index e4b7f0190df..d40e108b10d 100644
--- a/gcc/config/riscv/crypto.md
+++ b/gcc/config/riscv/crypto.md
@@ -19,7 +19,6 @@
 
 (define_c_enum "unspec" [
     ;; Zbkb unspecs
-    UNSPEC_BREV8
     UNSPEC_ZIP
     UNSPEC_UNZIP
     UNSPEC_PACK
@@ -73,8 +72,7 @@
 ;; ZBKB extension
 (define_insn "riscv_brev8_<mode>"
   [(set (match_operand:X 0 "register_operand" "=r")
-        (unspec:X [(match_operand:X 1 "register_operand" "r")]
-                  UNSPEC_BREV8))]
+        (bitreverse:X (match_operand:X 1 "register_operand" "r")))]
   "TARGET_ZBKB"
   "brev8\t%0,%1"
   [(set_attr "type" "crypto")])

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-07-26 16:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-26  7:54 RISC-V: Replace unspec with bitreverse in riscv_brev8_<mode> insn Jivan Hakobyan
2023-07-26  8:21 ` Kito Cheng
2023-07-26 16:23   ` Jeff Law

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).