On Monday, 3 November 2014 at 15:33:00 UTC, Laeeth Isharc wrote:
Hi.

Not sure if my code is correct - I wanted to build the simplest working example of simd use. The following compiles and works under ldc (I have not disassessembled the result to see if it is using simd instructions), but generates a compiler error under dmd (2.066 and 2.067.0-b1 running under Fedora 20).

The only message is:

"Internal error: backend/el.c 2874"

Let me know if you think the code is okay, and if so I will see if I can figure out how to generate a bug report (if it's not something already known).

Thanks.


Laeeth.





import std.stdio;
import core.simd;

void main()
{
        short8 vec;
        foreach(i;0..8)
        {
                vec.ptr[i]=cast(short)i;
        }
        vec=3*vec;
        foreach(i;0..8)
        {
                writefln("%s",vec.ptr[i]);
        }
}

It looks OK to me.

Whether or not the code is correct, any internal compiler error or segfault is a bug.

Reply via email to