public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [nvptx PATCH] Update nvptx's bitrev<mode>2 pattern to use BITREVERSE rtx.
@ 2023-06-07 23:09 Roger Sayle
  2023-11-15 14:33 ` Thomas Schwinge
  0 siblings, 1 reply; 2+ messages in thread
From: Roger Sayle @ 2023-06-07 23:09 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 596 bytes --]


This minor tweak to the nvptx backend switches the representation of
of the brev instruction from an UNSPEC to instead use the new BITREVERSE
rtx.  This allows various RTL optimizations including evaluation (constant
folding) of integer constant arguments at compile-time.

This patch has been tested on nvptx-none with make and make -k check
with no new failures.  Ok for mainline?


2023-06-07  Roger Sayle  <roger@nextmovesoftware.com>

gcc/ChangeLog
        * config/nvptx/nvptx.md (UNSPEC_BITREV): Delete.
        (bitrev<mode>2): Represent using bitreverse.


Thanks in advance,
Roger
--


[-- Attachment #2: patchbr.txt --]
[-- Type: text/plain, Size: 639 bytes --]

diff --git a/gcc/config/nvptx/nvptx.md b/gcc/config/nvptx/nvptx.md
index 1bb9304..7a7c994 100644
--- a/gcc/config/nvptx/nvptx.md
+++ b/gcc/config/nvptx/nvptx.md
@@ -34,8 +34,6 @@
    UNSPEC_FPINT_CEIL
    UNSPEC_FPINT_NEARBYINT
 
-   UNSPEC_BITREV
-
    UNSPEC_ALLOCA
 
    UNSPEC_SET_SOFTSTACK
@@ -636,8 +634,7 @@
 
 (define_insn "bitrev<mode>2"
   [(set (match_operand:SDIM 0 "nvptx_register_operand" "=R")
-	(unspec:SDIM [(match_operand:SDIM 1 "nvptx_register_operand" "R")]
-		     UNSPEC_BITREV))]
+	(bitreverse:SDIM (match_operand:SDIM 1 "nvptx_register_operand" "R")))]
   ""
   "%.\\tbrev.b%T0\\t%0, %1;")
 

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

end of thread, other threads:[~2023-11-15 14:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-07 23:09 [nvptx PATCH] Update nvptx's bitrev<mode>2 pattern to use BITREVERSE rtx Roger Sayle
2023-11-15 14:33 ` Thomas Schwinge

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