public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-2277] CRIS: Replace unspec CRIS_UNSPEC_SWAP_BITS with rtx bitreverse
@ 2023-07-04  1:05 Hans-Peter Nilsson
  0 siblings, 0 replies; only message in thread
From: Hans-Peter Nilsson @ 2023-07-04  1:05 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:48c85cb5334df621a05b322661089dd08be27094

commit r14-2277-g48c85cb5334df621a05b322661089dd08be27094
Author: Hans-Peter Nilsson <hp@axis.com>
Date:   Sun Jul 2 02:59:32 2023 +0200

    CRIS: Replace unspec CRIS_UNSPEC_SWAP_BITS with rtx bitreverse
    
    This is just expected to be a change in representation.
    No code is expected to change; no new tests are added.
    
            * config/cris/cris.md (CRIS_UNSPEC_SWAP_BITS): Remove.
            ("cris_swap_bits", "ctzsi2"): Use bitreverse instead.

Diff:
---
 gcc/config/cris/cris.md | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/gcc/config/cris/cris.md b/gcc/config/cris/cris.md
index 7504b63dabf..deb2f0c6b7c 100644
--- a/gcc/config/cris/cris.md
+++ b/gcc/config/cris/cris.md
@@ -50,9 +50,6 @@
   [
    ;; Stack frame deallocation barrier.
    CRIS_UNSPEC_FRAME_DEALLOC
-
-   ;; Swap all 32 bits of the operand; 31 <=> 0, 30 <=> 1...
-   CRIS_UNSPEC_SWAP_BITS
   ])
 
 ;; Register numbers.
@@ -2177,8 +2174,7 @@
 
 (define_insn "cris_swap_bits"
   [(set (match_operand:SI 0 "register_operand" "=r")
-	(unspec:SI [(match_operand:SI 1 "register_operand" "0")]
-		   CRIS_UNSPEC_SWAP_BITS))
+	(bitreverse:SI (match_operand:SI 1 "register_operand" "0")))
    (clobber (reg:CC CRIS_CC0_REGNUM))]
   "TARGET_HAS_SWAP"
   "swapwbr %0"
@@ -2193,8 +2189,7 @@
 	  (match_operand:SI 1 "register_operand"))
      (clobber (reg:CC CRIS_CC0_REGNUM))])
    (parallel
-    [(set (match_dup 2)
-	  (unspec:SI [(match_dup 2)] CRIS_UNSPEC_SWAP_BITS))
+    [(set (match_dup 2) (bitreverse:SI (match_dup 2)))
      (clobber (reg:CC CRIS_CC0_REGNUM))])
    (parallel
     [(set (match_operand:SI 0 "register_operand")

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

only message in thread, other threads:[~2023-07-04  1:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-04  1:05 [gcc r14-2277] CRIS: Replace unspec CRIS_UNSPEC_SWAP_BITS with rtx bitreverse Hans-Peter Nilsson

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