[Issue 15145] New: Array initializers for SIMD not working inside functions.

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Oct 3 09:44:51 PDT 2015


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

          Issue ID: 15145
           Summary: Array initializers for SIMD not working inside
                    functions.
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Keywords: rejects-valid, SIMD
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: Marco.Leise at gmx.de

Practically this compiles:

  import core.simd, std.range, std.array;
  ubyte[16] a = ubyte(16).iota.array;
  ubyte16   b = ubyte(16).iota.array;

But simply moving the definition inside a function does not work:

  void main()
  {
    import core.simd, std.range, std.array;
    ubyte16 b = ubyte(16).iota.array;
  }

Error: cannot implicitly convert expression (array(iota(cast(ubyte)16u))) of
type ubyte[] to __vector(ubyte[16])

To be fair it works when you declare the vector as static, and that should
probably be done for performance, but it should not be an error and the message
is too general, as it works for static/global vectors.

--


More information about the Digitalmars-d-bugs mailing list