<html>
    <head>
      <base href="https://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 --- - [powerpc-ubuntu] miscompilation on opencl for long/ulong vector data types" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D24230&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=M9V3_yXB04Nq-2UaKHlsXkOD6QdLYmWTkBvIpOAN52k&s=oluNExUSaSEsOFGB6DnlkMrWZIvqyXLdl9JGrBBoTbU&e=">24230</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[powerpc-ubuntu] miscompilation on opencl for long/ulong vector data types
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.6
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Windows NT
          </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>kanagak86@yahoo.ca
          </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=14636" name="attach_14636" title="miscompilation on long/ulong vector datatypes">attachment 14636</a> <a href="attachment.cgi?id=14636&action=edit" title="miscompilation on long/ulong vector datatypes">[details]</a></span>
miscompilation on long/ulong vector datatypes

Miscompilation for long/ulong data types computation with vector sizes more
than 1 (ie. long2/ulong2, long3/ulong3, long4/ulong4 and etc.)

Bug was reproducible on all 3.6.1 and 3.6.2 (latest 3.6.2 r242926). 

The last revision it worked on was 3.6 r222776. 

Here's more detail explanation of possible way to reproduce the problem. Also,
I have attached file generated from bugpoint.

For example: 
------------
Description: For each component of a vector type, result[i] = if MSB of c[i] is
set ? b[i] : a[i]. In our example, to avoid branch, we're using the following
tricks to get the result. 

Code Snip
---------
static inline ulong4 __attribute__((overloadable)) select(ulong4 a,ulong4
b,long4 c)
{
    long4 msb = (c & ((long4)0x8000000000000000));
    return (as_ulong4(msb == (long4)(0x0)) & a) | (as_ulong4(msb ==
(long4)(0x8000000000000000)) & b);
}

Output: 
-------
ulong4: 0) select(2442926672567622827, 3967573090254568380,
-5840417280764598375) expected 3967573090254568380 got 3967573092447682495
ulong4: 1) select(-8456079605802066238, -406108156188768074,
-6400753874706939934) expected -406108156188768074 got -406108156087836938
ulong4: 2) select(-3206018145846460440, 4990307068426073364,
-493767623234204525) expected 4990307068426073364 got 4990307068565880828

It seems like the "expected" value and "got" value is pretty similar. Closely
looking at it, the last 4 Bytes are being manipulated.</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>