<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 --- - vector comparison 'less than' miscompiled on avx2"
   href="http://llvm.org/bugs/show_bug.cgi?id=17899">17899</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>vector comparison 'less than' miscompiled on avx2
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Linux
          </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>Backend: X86
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>kraiskil@ovi.com
          </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=11526" name="attach_11526" title="Sample reduced source to show the bug">attachment 11526</a> <a href="attachment.cgi?id=11526&action=edit" title="Sample reduced source to show the bug">[details]</a></span>
Sample reduced source to show the bug

The following OpenCL code is miscompiled when targeting core-avx2 CPU:s 
 c < (short16)0 ? b : a
Only 'less that' seems to be miscompiled, all other comparisons that I tried
give the correct result. Also all shorter that 16xi16 vectors work fine.

Attached is a tar.gz with complete example code. When compiling with CPU
corei7, the result is correct, when compiling with core-avx2 it is wrong:

$./run.sh corei7
res1.x=a
$./run.sh core-avx2
res1.x=b</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>