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:
--047d7b2e47f4d0c3e704deb2da7b
Content-Type: text/plain; charset=UTF-8

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. --047d7b2e47f4d0c3e704deb2da7b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">On 9 June 2013 10:36, Roderick Gibson <span dir=3D"ltr">&l= t;<a href=3D"mailto:kniteli gmail.com" target=3D"_blank">kniteli gmail.com<= /a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=3D"gmail_quo= te"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-lef= t:1px #ccc solid;padding-left:1ex"> I get a compiler assert failing when trying to compile the follow minimal c= ase:<br> <br> import core.simd;<br> <br> void main() {<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 auto arr =3D si;<br> }<br> <br> const float4 si =3D [1f, 1f, 1f, 1f];<br> <br> This compiles fine:<br> <br> import core.simd;<br> <br> void main() {<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 auto arr =3D si;<br> }<br> <br> float4 si =3D [1f, 1f, 1f, 1f];<br> <br> Should I file this or am I doing something dumb here?<br> </blockquote></div><br></div><div class=3D"gmail_extra" style>Possibly unre= lated to this, it looks like a bug... but certainly when it comes to any SI= MD operation. It&#39;s not really possible to solve unless the compiler bec= omes aware of all architectures intrinsics.</div> <div class=3D"gmail_extra" style>One of my goals for std.simd is a CTFE pat= h for all functions in the API.</div><div class=3D"gmail_extra" style><br><= /div><div class=3D"gmail_extra" style>This example should surely work thoug= h.</div> </div> --047d7b2e47f4d0c3e704deb2da7b--
Jun 08 2013