Hi,

On Fri, Oct 21, 2011 at 1:34 PM, David Peixotto <d...@rice.edu> wrote:

> I believe that we should be narrowing the argument before calling the
> function (and in fact both gcc and llvm-gcc will narrow it before a
> call to hs_popcnt8). My question is what is the right way to do
> that in the code generator?
>

I *think* the right way to address this is to call the one of the
narrowXWord/Int# primops in GHC.Word and GHC.Int (where the Bits instances
are defined). I have a vague memory of there being instances defined
elsewhere to (for the CTypes newtypes). Grep for 'instance Bits' in the base
package.

Aside: it would be really nice if GHC had primitive types such as Word8#,
etc so we don't have to remember to narrow in this way.

Cheers,
Johan
_______________________________________________
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to