[GHC] #16164: Provide bitreverse primop

#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

#16164: Provide bitreverse primop -------------------------------------+------------------------------------- Reporter: Fuuzetsu | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.6.3 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * keywords: => newcomer Comment: Indeed. This would be great to have. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16164#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16164: Provide bitreverse primop -------------------------------------+------------------------------------- Reporter: Fuuzetsu | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.6.3 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by rockbmb): I've got a couple of questions: 1. Does the inexistence of such an operation in GCC mean such a primop would, at first, only be available when the compiler uses the LLVM backend? 2. From the [understanding](https://ghc.haskell.org/trac/ghc/wiki/Commentary/PrimOps#AddinganewPrimOp) I've been gathering, am I right to assume that this primop will be out-of- line? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16164#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC