On Thu, Sep 5, 2013 at 12:20 AM, GHC <[email protected]> wrote:
>  Should we switch to calling the "slower" popCount for this certain case?
>  
> https://github.com/ghc/testsuite/blob/master/tests/codeGen/should_run/cgrun071.hs#L41-L46
>  {{{
>  slowPopcnt :: Word -> Word
>  slowPopcnt x = count' (bitSize x) x 0
>    where
>      count' 0 _ !acc = acc
>      count' n x acc  = count' (n-1) (x `shiftR` 1)
>                        (acc + if x .&. 1 == 1 then 1 else 0)
>  }}}

I've not been following this closely so apologies if I've
misunderstood the issue.

Are you asking if we should call slowPopcnt in the test in more
circumstances or if we should call it in the real implementation of
the primop? The primop already has a fallback if the popcnt
instruction isn't available (it uses a table-based implementation).

_______________________________________________
ghc-devs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/ghc-devs

Reply via email to