[LLVMbugs] [Bug 20697] New: Is OpenCL indexing supposed to work on a 'hi'/'lo' vector components?

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Aug 18 09:45:38 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20697

            Bug ID: 20697
           Summary: Is OpenCL indexing supposed to work on a 'hi'/'lo'
                    vector components?
           Product: clang
           Version: trunk
          Hardware: Macintosh
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: fjahanian at apple.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

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;

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140818/736ac21b/attachment.html>


More information about the llvm-bugs mailing list