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
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ 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] 7+ messages in thread

* [Bug middle-end/50481] builtin to reverse the bit order
  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 ` paolo.carlini at oracle dot com
  2011-09-23 15:47 ` devel@the-user.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-09-22 15:10 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-09-22
     Ever Confirmed|0                           |1


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

* [Bug middle-end/50481] builtin to reverse the bit order
  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
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: devel@the-user.org @ 2011-09-23 15:47 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Schmidt-Dominé <devel@the-user.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |devel@the-user.org

--- Comment #1 from Jonathan Schmidt-Dominé <devel@the-user.org> 2011-09-23 15:30:33 UTC ---
Informative web-page listing some methods:
http://graphics.stanford.edu/~seander/bithacks.html#ReverseByteWith64BitsDiv


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

* [Bug middle-end/50481] builtin to reverse the bit order
  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
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: ptim034 at gmail dot com @ 2012-03-29 10:51 UTC (permalink / raw)
  To: gcc-bugs

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

Tim Parker <ptim034 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ptim034 at gmail dot com

--- Comment #2 from Tim Parker <ptim034 at gmail dot com> 2012-03-29 10:46:11 UTC ---
I totally don't understand what you talking about =_=
http://www.buyanessay.com/


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

* [Bug middle-end/50481] builtin to reverse the bit order
  2011-09-22 10:33 [Bug middle-end/50481] New: builtin to reverse the bit order marc.glisse at normalesup dot org
                   ` (2 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: f.boesing at gmx dot de @ 2021-11-05 13:37 UTC (permalink / raw)
  To: gcc-bugs

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

Frank <f.boesing at gmx dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |f.boesing at gmx dot de

--- Comment #7 from Frank <f.boesing at gmx dot de> ---
Would be really useful to have this.

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

* [Bug middle-end/50481] builtin to reverse the bit order
  2011-09-22 10:33 [Bug middle-end/50481] New: builtin to reverse the bit order marc.glisse at normalesup dot org
                   ` (3 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: carlo at gcc dot gnu.org @ 2022-10-25 12:26 UTC (permalink / raw)
  To: gcc-bugs

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

Carlo Wood <carlo at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |carlo at gcc dot gnu.org

--- Comment #8 from Carlo Wood <carlo at gcc dot gnu.org> ---
Bump - I need this too ;)

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

* [Bug middle-end/50481] builtin to reverse the bit order
  2011-09-22 10:33 [Bug middle-end/50481] New: builtin to reverse the bit order marc.glisse at normalesup dot org
                   ` (4 preceding siblings ...)
  2022-10-25 12:26 ` carlo at gcc dot gnu.org
@ 2023-10-02 11:17 ` xry111 at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: xry111 at gcc dot gnu.org @ 2023-10-02 11:17 UTC (permalink / raw)
  To: gcc-bugs

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

Xi Ruoyao <xry111 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |xry111 at gcc dot gnu.org

--- Comment #9 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
Useful for LoongArch too.  And now we already have bitreverse RTX code since
r14-1586.

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

end of thread, other threads:[~2023-10-02 11:17 UTC | newest]

Thread overview: 7+ 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

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