Do we need to maintain PrimRep.VecRep?
mainland at apeiron.net
Tue Jun 7 15:22:56 UTC 2016
Only programs that use vector primops will generate VecRep's. GHC is not
such a program.
The branch of vector that I modified to use vector primops will generate
VecRep's. You can find it here:
It uses a modified version of primitive. See here, for example:
The reason this is not available more widely is lack of support in the
native code generator. Do you have any interest in working on adding
such support? :)
On 06/07/2016 11:08 AM, Ömer Sinan Ağacan wrote:
> Thanks, I can see the TyCons with VecReps there.. but I still can't see how the
> terms are constructed? Can you show me some example programs, or functions in
> the compiler, that generate vector terms? (e.g. terms with types with VecReps)
> 2016-06-07 10:48 GMT-04:00 Geoffrey Mainland <mainland at apeiron.net>:
>> VecRep is used for vector operations. If you aren't using LLVM, you
>> won't see them.
>> VecRep's are generated by utils/genprimopcode/Main.hs.
>> Check out compiler/stage1/build/primop-vector-tys.hs-incl in your build
>> tree---should be plenty of generated VecRep's there :)
>> On 06/07/2016 05:00 AM, Ömer Sinan Ağacan wrote:
>>> I have some code that does things depending on PrimReps of terms and so I have
>>> to handle VecRep there. To understand what VecRep exactly is and how to use it I
>>> looked at its uses, and all I can find was that we have a wired-in DataCon
>>> `vecRepDataCon` which has a type that I thought should have VecRep PrimRep, but
>>> when I test in GHCi I see that its PrimRep is PtrRep:
>>> λ> map typePrimRep (map dataConRepType (tyConDataCons runtimeRepTyCon))
>>> (This DataCon is not exported and only used in runtimeRepTyCon)
>>> So I think VecRep may not be in use at the moment. Do we still need to maintain
>>> it? What's the use case? Can anyone show me a Core term that has a type whose
>>> PrimRep is VecRep?
>>> ghc-devs mailing list
>>> ghc-devs at haskell.org
More information about the ghc-devs