public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/50481] New: builtin to reverse the bit order
@ 2011-09-22 10:33 marc.glisse at normalesup dot org
  2011-09-22 15:10 ` [Bug middle-end/50481] " paolo.carlini at oracle dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: marc.glisse at normalesup dot org @ 2011-09-22 10:33 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50481

             Bug #: 50481
           Summary: builtin to reverse the bit order
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: marc.glisse@normalesup.org


It would be useful if gcc provided a builtin to reverse the order of the bits
(turn abcdefgh into hgfedcba) in objects of all sizes from a byte to an
unsigned long long.

According to Joseph: "Various processors have an instruction to reverse the bit
order in a word (ARMv6T2 and later have RBIT, for example, and C6X has BITR on
C64X and above)." This kind of bit manipulation also has various optimizations
depending on the architecture (mirroring a byte can be implemented using a
64bit multiplication). It is thus well suited to a builtin with different
platform-specific implementations.

Such a builtin could be used for instance for Bug 50160.


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

end of thread, other threads:[~2024-05-21 15:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-22 10:33 [Bug middle-end/50481] New: builtin to reverse the bit order marc.glisse at normalesup dot org
2011-09-22 15:10 ` [Bug middle-end/50481] " paolo.carlini at oracle dot com
2011-09-23 15:47 ` devel@the-user.org
2012-03-29 10:51 ` ptim034 at gmail dot com
2021-11-05 13:37 ` f.boesing at gmx dot de
2022-10-25 12:26 ` carlo at gcc dot gnu.org
2023-10-02 11:17 ` xry111 at gcc dot gnu.org
2024-05-21 15:22 ` pinskia at gcc dot gnu.org
2024-05-21 15:24 ` pinskia at gcc dot gnu.org
2024-05-21 15:29 ` pinskia at gcc dot gnu.org

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