public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-9233] LoongArch: NFC: Deduplicate crc instruction defines
@ 2024-02-29  6:48 Xi Ruoyao
  0 siblings, 0 replies; only message in thread
From: Xi Ruoyao @ 2024-02-29  6:48 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:c556ea076dcbfe2a3059dd0ad2e06a0b1d1fa89b

commit r14-9233-gc556ea076dcbfe2a3059dd0ad2e06a0b1d1fa89b
Author: Xi Ruoyao <xry111@xry111.site>
Date:   Sun Feb 25 20:40:41 2024 +0800

    LoongArch: NFC: Deduplicate crc instruction defines
    
    Introduce an iterator for UNSPEC_CRC and UNSPEC_CRCC to make the next
    change easier.
    
    gcc/ChangeLog:
    
            * config/loongarch/loongarch.md (CRC): New define_int_iterator.
            (crc): New define_int_attr.
            (loongarch_crc_w_<size>_w, loongarch_crcc_w_<size>_w): Unify
            into ...
            (loongarch_<crc>_w_<size>_w): ... here.

Diff:
---
 gcc/config/loongarch/loongarch.md | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/gcc/config/loongarch/loongarch.md b/gcc/config/loongarch/loongarch.md
index dffa41b0bf5..9646fa90eab 100644
--- a/gcc/config/loongarch/loongarch.md
+++ b/gcc/config/loongarch/loongarch.md
@@ -4251,24 +4251,16 @@
 
 
 (define_mode_iterator QHSD [QI HI SI DI])
+(define_int_iterator CRC [UNSPEC_CRC UNSPEC_CRCC])
+(define_int_attr crc [(UNSPEC_CRC "crc") (UNSPEC_CRCC "crcc")])
 
-(define_insn "loongarch_crc_w_<size>_w"
+(define_insn "loongarch_<crc>_w_<size>_w"
   [(set (match_operand:SI 0 "register_operand" "=r")
 	(unspec:SI [(match_operand:QHSD 1 "register_operand" "r")
 		   (match_operand:SI 2 "register_operand" "r")]
-		     UNSPEC_CRC))]
+		     CRC))]
   ""
-  "crc.w.<size>.w\t%0,%1,%2"
-  [(set_attr "type" "unknown")
-   (set_attr "mode" "<MODE>")])
-
-(define_insn "loongarch_crcc_w_<size>_w"
-  [(set (match_operand:SI 0 "register_operand" "=r")
-	(unspec:SI [(match_operand:QHSD 1 "register_operand" "r")
-		   (match_operand:SI 2 "register_operand" "r")]
-		     UNSPEC_CRCC))]
-  ""
-  "crcc.w.<size>.w\t%0,%1,%2"
+  "<crc>.w.<size>.w\t%0,%1,%2"
   [(set_attr "type" "unknown")
    (set_attr "mode" "<MODE>")])

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-02-29  6:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-29  6:48 [gcc r14-9233] LoongArch: NFC: Deduplicate crc instruction defines Xi Ruoyao

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