www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16703] New: Support indexing of SIMD vector types

https://issues.dlang.org/show_bug.cgi?id=16703

          Issue ID: 16703
           Summary: Support indexing of SIMD vector types
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: bugzilla digitalmars.com

Indexing should work, at least on lvalues:

  import core.simd;

  float foo(float4 f4) {
    // This should work
    return f4[2];

    // This currently does work
    return (*cast(float[4]*)&f4)[2];
  }

Slicing should also work:

  float[4] foo(float4 f4) {
    return f4[];
  }

--
Nov 19 2016