Proposal: Add Data.Bits.popCount

Daniel Peebles pumpkingod at gmail.com
Wed Aug 17 23:25:51 CEST 2011


If someone wanted to spruce up my patch here
http://hackage.haskell.org/trac/ghc/ticket/3489 to include the GMP popcount
call, so that we can make the Integer instance of Bits work efficiently with
the new call, that might also help this proposal. But yeah, even if not, +1.

On Wed, Aug 17, 2011 at 4:33 PM, Johan Tibell <johan.tibell at gmail.com>wrote:

> On Wed, Aug 17, 2011 at 7:44 PM, Maciej Marcin Piechotka
> <uzytkownik2 at gmail.com> wrote:
> > I posted bug for various similar instructions some time ago:
> >
> > http://hackage.haskell.org/trac/ghc/ticket/4102
> >
> > Probably the update should be done in batch (i.e. popCount,
> > trailing/leading zeros etc.)
>
> I'd be happy to see these as well. If someone would like to do the GHC
> work needed to have them translate into single machine instructions
> where available, have a look at the implementation of the popCnt#
> primops here:
>
>
> https://github.com/ghc/ghc/commit/2d0438f329ac153f9e59155f405d27fac0c43d65
>
> https://github.com/ghc/packages-ghc-prim/commit/cefc19afafe5107ff98d5205c204b190da1d497b
>
> https://github.com/ghc/testsuite/commit/2f4d13348e2140f7fc0d4b8b995a2be0fa6291f0
>
> I don't have time to do so at the moment.
>
> I'd prefer to not wait with adding popCount until this is done, unless
> someone takes it on them to add the others before GHC 7.4.
>
> -- Johan
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20110817/d7c863c6/attachment.htm>


More information about the Libraries mailing list