<div dir="ltr"><div dir="ltr">On Fri, Feb 1, 2019 at 1:54 AM Simon Moll <<a href="mailto:moll@cs.uni-saarland.de">moll@cs.uni-saarland.de</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF">
    <p>Hi,<br>
    </p>
    <div class="gmail-m_-1232461774573130078moz-cite-prefix">On 1/31/19 11:20 PM, Jacob Lifshay
      wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="auto">We're in-progress designing a RISC-V extension (<a href="http://lists.libre-riscv.org/pipermail/libre-riscv-dev/2019-January/000433.html" target="_blank">http://lists.libre-riscv.org/pipermail/libre-riscv-dev/2019-January/000433.html</a>)
        that would have variable-length vectors of short vectors (1 to
        4):
        <div dir="auto"><VL x <4 x float>></div>
        <div dir="auto">where each predicate bit masks out a whole short
          vector. We're using this extension to vectorize graphics code
          where where variables in the pre-vectorization code are short
          vectors.</div>
        <div dir="auto">So, vectorizing code like:<br>
        </div>
        <div dir="auto">for(int i = 0; i < 1000; i++)</div>
        <div dir="auto">{</div>
        <div dir="auto">    vec4 color = colors[i];</div>
        <div dir="auto">    vec3 normal = normals[i];</div>
        <div dir="auto">    color.rgb *= fmax(0.0, dot(normal,
          light_dir));</div>
        <div dir="auto">    colors[i] = color;</div>
        <div dir="auto">}</div>
        <div dir="auto"><br>
        </div>
        <div dir="auto">
          <div dir="auto" style="font-family:sans-serif">I'm planning on
            passing already vectorized code into LLVM and using LLVM as
            a backend for optimization and JIT code generation.</div>
        </div>
        <div dir="auto"><br>
        </div>
        <div dir="auto">Do you think the EVL proposal would support an
          ISA like this as it's currently written (by pattern matching
          on predicate expansion and vector-length multiplication)?</div>
        <div dir="auto">Or, do you think the EVL proposal would need
          modification to effectively support this (by adding a element
          group size argument to EVL intrinsics or something)?</div>
      </div>
    </blockquote>
    <p>We could untie the mask length from the data length:</p>
    <p>  %result = call <scalable 4 x float>
      @llvm.evl.fsub.v4f32(<scalable 4 x float> %x, <scalable 4
      x float> %y, <scalable 1 x i1> %M, i32 %L)</p>
    <p>would then indicate the the mask %M applies to groups of "4 / 1"
      float elements.</p></div></blockquote><div>Sounds good to me. I haven't checked if the current code allows for that.</div><div><br></div><div>Jacob </div></div></div>