<div dir="ltr">That, rather tangentially, reminds me: If we do start to teach the code generator about how to produce these sorts of things from simpler parts, e.g. via enabling something like LLVM's vectorization pass, or some internal future ghc compiler pass that checks for, say, <a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.106.4663&rep=rep1&type=pdf">Superword-Level Parallelism</a> in the style of Jaewook Shin, then we need to differentiate between flags for what ghc/llvm is allowed to produce via optimization, etc. and what the end user is allowed to explicitly emit. e.g. in my own code I can safely call avx2 primitives after I set up guards to check that I'm on a CPU that supports them, but I can only currently emit that code after I tell GHC that I want it to allow the avx2 instructions. If I build a complicated dispatch mechanism in Haskell for picking the right ISA and emitting code for several of them, I'm going to need to tell ghc to let me build with all sorts of instruction sets that the machine the final executable runs on may not fully support. We should be careful not to conflate these two things.<div><br></div><div>-Edward</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 13, 2017 at 2:44 PM, Ben Gamari <span dir="ltr"><<a href="mailto:ben@well-typed.com" target="_blank">ben@well-typed.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Siddhanathan Shanmugam <<a href="mailto:siddhanathan%2Beml@gmail.com">siddhanathan+eml@gmail.com</a>> writes:<br>
<br>
>> It would be even better if we could *also* teach the native back end about<br>
> SSE instructions. Is there anyone who might be willing to work on that?<br>
><br>
> Yes. Though, it would be better if someone with more experience than me<br>
> decides to pick this up instead.<br>
><br>
</span>I would be happy to advise if you would like to pick this up. I think it<br>
would be great if the NCG were to learn about SSE and GHC could really<br>
use more people knowledgable about its backend. The best way to learn is<br>
by doing.<br>
<br>
Cheers,<br>
<br>
- Ben<br>
</blockquote></div><br></div>