www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - compiler assert failure with ctfe on simd vector type

reply "Roderick Gibson" <kniteli gmail.com> writes:
I get a compiler assert failing when trying to compile the follow 
minimal case:

import core.simd;

void main() {
	auto arr = si;
}

const float4 si = [1f, 1f, 1f, 1f];

This compiles fine:

import core.simd;

void main() {
	auto arr = si;
}

float4 si = [1f, 1f, 1f, 1f];

Should I file this or am I doing something dumb here?
Jun 08 2013
next sibling parent Walter Bright <newshound2 digitalmars.com> writes:
On 6/8/2013 5:36 PM, Roderick Gibson wrote:
 I get a compiler assert failing when trying to compile the follow minimal case:

Please report all bugs to: http://d.puremagic.com/issues/
Jun 08 2013
prev sibling parent Manu <turkeyman gmail.com> writes:
On 9 June 2013 10:36, Roderick Gibson <kniteli gmail.com> wrote:

 I get a compiler assert failing when trying to compile the follow minimal
 case:

 import core.simd;

 void main() {
         auto arr = si;
 }

 const float4 si = [1f, 1f, 1f, 1f];

 This compiles fine:

 import core.simd;

 void main() {
         auto arr = si;
 }

 float4 si = [1f, 1f, 1f, 1f];

 Should I file this or am I doing something dumb here?

Possibly unrelated to this, it looks like a bug... but certainly when it comes to any SIMD operation. It's not really possible to solve unless the compiler becomes aware of all architectures intrinsics. One of my goals for std.simd is a CTFE path for all functions in the API. This example should surely work though.
Jun 08 2013