Re: [GHC] #7684: cgrun071 segfaults

On Thu, Sep 5, 2013 at 12:20 AM, GHC
Should we switch to calling the "slower" popCount for this certain case? https://github.com/ghc/testsuite/blob/master/tests/codeGen/should_run/cgrun0... {{{ 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).
participants (1)
-
Johan Tibell