<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 --- - Is OpenCL indexing supposed to work on a 'hi'/'lo' vector components?"
   href="http://llvm.org/bugs/show_bug.cgi?id=20697">20697</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Is OpenCL indexing supposed to work on a 'hi'/'lo' vector components?
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

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

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </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>Frontend
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>fjahanian@apple.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>Currently, clang asserts in IRGen on the following code (and if assert is off
it
produces unexpected result).

#include <stdio.h>

int main()
{
  typedef __attribute__ ((ext_vector_type( 4),__aligned__( 32))) double
double4;

  double4 va;
  va.lo[0] = 1.0;
  va.lo[1] = 2.0;
  va.hi[0] = 3.0;
  va.hi[1] = 4.0;

  printf("%g, %g, %g, %g\n", va[0], va[1], va[2], va[3]);
  return 0;
}
// Answer expected to be: 1,2,3,4 instead of 3, 4, 0, 0

Is this expected to work. Documentation is unclear. It does work on the
vector itself:

va[0] = 1.0;</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>