<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - pminuw instruction not generated for <16 x i16> selection encoding a 'min' (SSE4)"
   href="http://llvm.org/bugs/show_bug.cgi?id=16695">16695</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>pminuw instruction not generated for <16 x i16> selection encoding a 'min' (SSE4)
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>matt@pharr.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=10920" name="attach_10920" title="test case">attachment 10920</a> <a href="attachment.cgi?id=10920&action=edit" title="test case">[details]</a></span>
test case

With a SSE4 target, given a vector select of <16xi16> representing a 'min':

define <16 x i16> @foo16(<16 x i16> %a, <16 x i16> %b, <16 x i8> %__mask) #0 {
allocas:
  %less_a_load_b_load.i = icmp ult <16 x i16> %a, %b
  %blend.i8 = select <16 x i1> %less_a_load_b_load.i, <16 x i16> %a, <16 x i16>
%b
  ret <16 x i16> %blend.i8
}

roughly 30 instructions are generated if I run "llc
-mattr=+sse,+sse2,+sse3,+sse41,-sse42,-sse4a,+ssse3,-popcnt,+cmov bug.ll -o -".
In contrast, given a vector select of an <8 x i16> vector:

define <8 x i16> @foo8(<8 x i16> %a, <8 x i16> %b, <8 x i8> %__mask) #0 {
allocas:
  %less_a_load_b_load.i = icmp ult <8 x i16> %a, %b
  %blend.i8 = select <8 x i1> %less_a_load_b_load.i, <8 x i16> %a, <8 x i16> %b
  ret <8 x i16> %blend.i8
}

A single pminuw is generated.

_foo8:                                  ## @foo8
## BB#0:                                ## %allocas
    pminuw    %xmm1, %xmm0
    ret

It'd be nice if the <16 x i16> case turned into two nice little pminuw
instructions.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>