[GHC] #16164: Provide bitreverse primop
GHC
ghc-devs at haskell.org
Thu Jan 10 07:03:04 UTC 2019
#16164: Provide bitreverse primop
-------------------------------------+-------------------------------------
Reporter: Fuuzetsu | Owner: (none)
Type: feature | Status: new
request |
Priority: normal | Milestone:
Component: Compiler | Version: 8.6.3
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: None/Unknown
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
We already have nice primops like {{{byteSwap#}}}, it'd be nice to also
have {{{bitreverse}}}.
Clang provides {{{__builtin_bitreverse}}}
(http://clang.llvm.org/docs/LanguageExtensions.html#builtin-bitreverse)
functions which could be the default. GCC currently doesn't have a built-
in (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50481).
One prominent place where this primop could be used is
Data.IntSet.Internal where it's implemented as a {{{revNat}}}. Many other
libraries also define own versions.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16164>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list