[Haskell-cafe] Implementing a new primtype

Daniel Fischer daniel.is.fischer at googlemail.com
Tue Oct 11 01:10:22 CEST 2011


On Tuesday 11 October 2011, 00:57:39, Paul Monday wrote:
> There seems to be plenty of documentation around on implementing a new
> primop, much of it needs some tweaking as files have moved and such.  I
> can't seem to find any documentation about how to implement primtypes
> though.
> 
> For example, I want to experiment with a new primtype "DV#", my
> assumption that the type was first declared in the primops.txt.pp seems
> incorrect.  So I'm trying to backtrack a bit and see where primtypes
> first appear, I'm hoping someone can at least give me a pointer :-)
> 
> For example:
> ./compiler/prelude/primops.txt.pp
> 
> Add the following:
> primtype DoubleVec# a

Has a type parameter

> 
> Compiles fine
> 
> Add a primop on the type:
> primop ExtractDoubleVecOp "extractDoubleVec#" GenPrimOp
>    DoubleVec# -> Int# -> Double#

Used without type parameter

Might be as simple as that.

> genprimopcode: ppType: can't handle: TyApp "DoubleVec#" []




More information about the Haskell-Cafe mailing list