]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
CRIS: Replace unspec CRIS_UNSPEC_SWAP_BITS with rtx bitreverse
authorHans-Peter Nilsson <hp@axis.com>
Sun, 2 Jul 2023 00:59:32 +0000 (02:59 +0200)
committerHans-Peter Nilsson <hp@bitrange.com>
Tue, 4 Jul 2023 01:05:21 +0000 (03:05 +0200)
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.

gcc/config/cris/cris.md

index 7504b63dabf30ecc2df3076f4980a2fdf4953154..deb2f0c6b7c74a4d72a03f5094272743b723747f 100644 (file)
@@ -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.
 
 (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"
          (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")