<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On 2 October 2013 12:17, Renato Golin <span dir="ltr"><<a href="mailto:renato.golin@linaro.org" target="_blank">renato.golin@linaro.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="im">On 2 October 2013 10:12, Steven Newbury <span dir="ltr"><<a href="mailto:steve@snewbury.org.uk" target="_blank">steve@snewbury.org.uk</a>></span> wrote:<br>
</div><div class="gmail_extra"><div class="gmail_quote"><div class="im">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">How does this make any sense?<br></blockquote><div> </div></div><div>I have to agree with you that this doesn't make much sense, but there is a case where you would want something like that: when the original source uses NEON intrinsics, and there is no alternative in AltiVec, AVX or even plain C.</div>
</div></div></div></blockquote><div><br></div><div>This is exactly the case that I am in. I want to make DSP code written in C, but with NEON intrinsics "portable" as it is less feasible to rewrite it.</div><div>
 </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">Stanislav,</div><div class="gmail_extra"><br></div><div class="gmail_extra">
If I got it right above, I think it would be better if you could do that transformation in IR, with a mapping infrastructure between each SIMD ISA. Something that could represent every possible SIMD instruction, and how each target represents them, so in one side you read the intrinsics (and possibly IR operations on vectors), translate to this meta-SIMD language, then export on the SIMD language that you want.</div>

<div class="gmail_extra"><br></div><div class="gmail_extra">A tool like this, possibly exporting back to C code (so you can add it to your project as an one-off pass), would be valuable to all programs that have legacy hard-coded SSE routines to run on any platform that support SIMD operations.</div>

<div class="gmail_extra"><br></div><div class="gmail_extra">I have no idea how easy would be to do that, let alone if it's at all possible, but it seems that this is what you want. Correct me if I'm wrong.</div></div>
</blockquote><div><br></div><div>Again, the tool you describe is exactly what I ultimately want to create. The translation to AltiVec would be a step towards understanding how to manipulate the intrinsics, but it is not a goal on its own.<br>
</div><div><br></div><div>Do you have any ideas where in the whole LLVM structure would it fit (should it be implemented as a separate optional pass)?</div><div><br></div><div>Thanks,</div><div> - Stan</div></div></div></div>