There's also the question of whether or not the high level simd ops that llvm exposes are the ones that can be easily supported by the native code Gen without duplicating llvm specific logic around lowering on various architectures.  Though for the basic horizontal operations that are currently exposed that should be straight forward.  But might be more tricky for shuffle and dot product kinds of things. <span></span><br><br>On Tuesday, June 7, 2016, Ömer Sinan Ağacan <<a href="mailto:omeragacan@gmail.com">omeragacan@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ahh, I see... I finally found the primops, machops, and code generator for x86:<br>
<br>
      MO_V_Insert {}   -> needLlvm<br>
      MO_V_Extract {}  -> needLlvm<br>
      MO_V_Add {}      -> needLlvm<br>
      MO_V_Sub {}      -> needLlvm<br>
      ...<br>
<br>
> The reason this is not available more widely is lack of support in the native<br>
> code generator. Do you have any interest in working on adding such support?<br>
> :)<br>
<br>
I'm afraid I'm short on free time at the moment but I'll let you know if I have<br>
a chance to work on that.<br>
<br>
Thanks,<br>
Omer<br>
<br>
2016-06-07 11:22 GMT-04:00 Geoffrey Mainland <<a href="javascript:;" onclick="_e(event, 'cvml', 'mainland@apeiron.net')">mainland@apeiron.net</a>>:<br>
> Only programs that use vector primops will generate VecRep's. GHC is not<br>
> such a program.<br>
><br>
> The branch of vector that I modified to use vector primops will generate<br>
> VecRep's. You can find it here:<br>
><br>
> <a href="https://github.com/mainland/vector/tree/simd" target="_blank">https://github.com/mainland/vector/tree/simd</a><br>
><br>
> It uses a modified version of primitive. See here, for example:<br>
><br>
> <a href="https://github.com/mainland/primitive/blob/simd/Data/Primitive/Multi.hs" target="_blank">https://github.com/mainland/primitive/blob/simd/Data/Primitive/Multi.hs</a><br>
><br>
> The reason this is not available more widely is lack of support in the<br>
> native code generator. Do you have any interest in working on adding<br>
> such support? :)<br>
><br>
> Cheers,<br>
> Geoff<br>
><br>
> On 06/07/2016 11:08 AM, Ömer Sinan Ağacan wrote:<br>
>> Thanks, I can see the TyCons with VecReps there.. but I still can't see how the<br>
>> terms are constructed? Can you show me some example programs, or functions in<br>
>> the compiler, that generate vector terms? (e.g. terms with types with VecReps)<br>
>><br>
>> 2016-06-07 10:48 GMT-04:00 Geoffrey Mainland <<a href="javascript:;" onclick="_e(event, 'cvml', 'mainland@apeiron.net')">mainland@apeiron.net</a>>:<br>
>>> VecRep is used for vector operations. If you aren't using LLVM, you<br>
>>> won't see them.<br>
>>><br>
>>> VecRep's are generated by utils/genprimopcode/Main.hs.<br>
>>><br>
>>> Check out compiler/stage1/build/primop-vector-tys.hs-incl in your build<br>
>>> tree---should be plenty of generated VecRep's there :)<br>
>>><br>
>>> Cheers,<br>
>>> Geoff<br>
>>><br>
>>> On 06/07/2016 05:00 AM, Ömer Sinan Ağacan wrote:<br>
>>>> I have some code that does things depending on PrimReps of terms and so I have<br>
>>>> to handle VecRep there. To understand what VecRep exactly is and how to use it I<br>
>>>> looked at its uses, and all I can find was that we have a wired-in DataCon<br>
>>>> `vecRepDataCon` which has a type that I thought should have VecRep PrimRep, but<br>
>>>> when I test in GHCi I see that its PrimRep is PtrRep:<br>
>>>><br>
>>>>     λ> map typePrimRep (map dataConRepType (tyConDataCons runtimeRepTyCon))<br>
>>>>     [PtrRep,PtrRep,PtrRep,PtrRep,PtrRep,PtrRep,PtrRep,PtrRep,PtrRep,PtrRep,PtrRep,PtrRep,PtrRep]<br>
>>>><br>
>>>> (This DataCon is not exported and only used in runtimeRepTyCon)<br>
>>>><br>
>>>> So I think VecRep may not be in use at the moment. Do we still need to maintain<br>
>>>> it? What's the use case? Can anyone show me a Core term that has a type whose<br>
>>>> PrimRep is VecRep?<br>
>>>><br>
>>>> Thanks..<br>
>>>> _______________________________________________<br>
>>>> ghc-devs mailing list<br>
>>>> <a href="javascript:;" onclick="_e(event, 'cvml', 'ghc-devs@haskell.org')">ghc-devs@haskell.org</a><br>
>>>> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
><br>
_______________________________________________<br>
ghc-devs mailing list<br>
<a href="javascript:;" onclick="_e(event, 'cvml', 'ghc-devs@haskell.org')">ghc-devs@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
</blockquote>