Proposal: Add Data.Bits.popCount

Johan Tibell johan.tibell at
Wed Aug 17 22:33:29 CEST 2011

On Wed, Aug 17, 2011 at 7:44 PM, Maciej Marcin Piechotka
<uzytkownik2 at> wrote:
> I posted bug for various similar instructions some time ago:
> 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:

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

More information about the Libraries mailing list