<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 23, 2016 at 2:22 PM, Krzysztof Parzyszek <span dir="ltr"><<a href="mailto:kparzysz@codeaurora.org" target="_blank">kparzysz@codeaurora.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 9/23/2016 3:33 PM, Sean Silva wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
<br>
<br>
On Fri, Sep 23, 2016 at 1:08 PM, Matthias Braun <<a href="mailto:matze@braunis.de" target="_blank">matze@braunis.de</a><br></span>
<mailto:<a href="mailto:matze@braunis.de" target="_blank">matze@braunis.de</a>>> wrote:<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
    On Sep 23, 2016, at 1:01 PM, Sean Silva via llvm-dev<br></span>
    <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a> <mailto:<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.or<wbr>g</a>>> wrote:<br>
<br>
    [...]<span class=""><br>
    ARM SVE sounds like it will have similar<br>
    issues: <a href="https://community.arm.com/groups/processors/blog/2016/08/22/technology-update-the-scalable-vector-extension-sve-for-the-armv8-a-architecture" rel="noreferrer" target="_blank">https://community.arm.com/grou<wbr>ps/processors/blog/2016/08/22/<wbr>technology-update-the-scalable<wbr>-vector-extension-sve-for-the-<wbr>armv8-a-architecture</a><br>
    <<a href="https://community.arm.com/groups/processors/blog/2016/08/22/technology-update-the-scalable-vector-extension-sve-for-the-armv8-a-architecture" rel="noreferrer" target="_blank">https://community.arm.com/gro<wbr>ups/processors/blog/2016/08/<wbr>22/technology-update-the-scala<wbr>ble-vector-extension-sve-for-<wbr>the-armv8-a-architecture</a>><br>
</span></blockquote><span class="">
<br>
    From glancing over the slides, it seems like SVE has dynamically<br>
    sized (i.e. you don't know yet at compile time) registers which<br>
    would be a step further than this.<br>
<br>
<br>
>From what Krzysztof wrote, it sounds like HVX has a similar situation<br>
("it is possible to have a binary that runs in both modes").<br>
</span></blockquote>
<br>
Yes. The instruction and register encodings are identical between the modes. The mode is controlled by a bit in some system configuration register, otherwise the application does not know what mode it works in. Vector loads and stores are indexed in a similar way as in VLA, i.e.<br>
  vmem(r0+#2) = v0<br>
will store vector register v0 at the address r0 + 2*VL.<br>
<br>
In practice, HVX programs are usually compiled for one of the modes. I think that the biggest complication in writing dual-mode programs is that the application does not have a good way of finding out what mode it runs in by querying the hardware (IIRC you need to run in the supervisor mode to examine the configuration bit).</blockquote><div><br></div><div>Although it is sort of hacky, one could zero a block of memory and then see where `vmem(r0+#2) = v0` ends up (making sure that v0 is all 1's for example).</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Another thing is that HVX users generally have a specific mode in mind when developing programs and being able to run in a different mode is not a high priority for them. At least for now...</blockquote><div><br></div><div>At least in the ARM SVE case, it seems like VLA could maybe be useful for big.LITTLE arrangements where the big cores may have wider vector width. That may not be possible in practice actually (would need program restrictions on how it relies on the vector length so that when a core migration little<->big you would have to paper over the VL change (e.g. big core can run temporarily in a "narrow" mode maybe?); that's a bit hand-wavey... not sure it would actually work) </div><div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
<br>
-Krzysztof<br>
<br>
-- <br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation<br>
</div></div></blockquote></div><br></div></div>