<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 2/4/19 6:15 PM, David Greene wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:nng8syvo4pm.fsf@lnx-dag.us.cray.com">
      <pre class="moz-quote-pre" wrap="">Simon Moll <a class="moz-txt-link-rfc2396E" href="mailto:moll@cs.uni-saarland.de"><moll@cs.uni-saarland.de></a> writes:

</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">You are referring to the sub-vector sizes, if i am understanding
correctly. I'd assume that the mask sub-vector length always has to be
either 1 or the same as the data sub-vector length. For example, this
is ok:

%result = call <scalable 3 x float> @llvm.evl.fsub.v4f32(<scalable 3 x
float> %x, <scalable 3 x float> %y, <scalable 1 x i1> %M, i32 %L)
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
What does <scalable 1 x i1> applied to <scalable 3 x float> mean?  I
would expect a requirement of <scalable 3 x i1>.  At least that's how I
understood the SVE proposal [1].  The n's in <scalable n x type> have to
match.</pre>
    </blockquote>
    <pre>It would mean that the each mask bit M[i] applies to data lanes D[3*i] to D[3*i+2]. It has applications in graphics codes where the vector element type would be a short vector as in [2]:

for(int i = 0; i < 1000; i++)
{
    vec4 color = colors[i];    // <scalable 4 x float>
    vec3 normal = normals[i];  // <scalable 3 x float>
    color.rgb *= fmax(0.0, dot(normal, light_dir));
    colors[i] = color;
}



I don't see any direct conflict with LLVM-SVE [1] but it will add complexity to the vectorizer, legal and TTI to choose a good sub-vector size/strategy for each target.

- Simon


[2] <a class="moz-txt-link-freetext" href="https://lists.llvm.org/pipermail/llvm-dev/2019-January/129822.html">https://lists.llvm.org/pipermail/llvm-dev/2019-January/129822.html</a></pre>
    <blockquote type="cite"
      cite="mid:nng8syvo4pm.fsf@lnx-dag.us.cray.com">
      <pre class="moz-quote-pre" wrap="">

                           -David

[1] <a class="moz-txt-link-freetext" href="http://lists.llvm.org/pipermail/llvm-dev/2016-November/106819.html">http://lists.llvm.org/pipermail/llvm-dev/2016-November/106819.html</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 

Simon Moll
Researcher / PhD Student

Compiler Design Lab (Prof. Hack)
Saarland University, Computer Science
Building E1.3, Room 4.31

Tel. +49 (0)681 302-57521 : <a class="moz-txt-link-abbreviated" href="mailto:moll@cs.uni-saarland.de">moll@cs.uni-saarland.de</a>
Fax. +49 (0)681 302-3065  : <a class="moz-txt-link-freetext" href="http://compilers.cs.uni-saarland.de/people/moll">http://compilers.cs.uni-saarland.de/people/moll</a></pre>
  </body>
</html>