core.simd woes

Manu turkeyman at gmail.com
Fri Oct 5 03:28:57 PDT 2012


On 3 October 2012 16:40, Iain Buclaw <ibuclaw at ubuntu.com> wrote:

> On 3 October 2012 02:31, jerro <a at a.com> wrote:
> >> import core.simd, std.stdio;
> >>
> >> void main()
> >> {
> >>   float4 a = 1, b = 2;
> >>   writeln((a + b).array); // WORKS: [3, 3, 3, 3]
> >>
> >>   float4 c = [1, 2, 3, 4]; // ERROR: "Stored value type does
> >>                            // not match pointer operand type!"
> >>                            // [..a bunch of LLVM error code..]
> >>
> >>   float4 c = 0, d = 1;
> >>   c.array[0] = 4;
> >>   c.ptr[1] = 4;
> >>   writeln((c + d).array); // WRONG: [1, 1, 1, 1]
> >> }
> >
> >
> > Oh, that doesn't work for me either. I never tried to use those, so I
> didn't
> > notice that before. This code gives me internal compiler errors with GDC
> and
> > DMD too (with "float4 c = [1, 2, 3, 4]" commented out). I'm using DMD
> 2.060
> > and a recent versions of GDC and LDC on 64 bit Linux.
>
> Then don't just talk about it, raise a bug - otherwise how do you
> expect it to get fixed!  ( http://www.gdcproject.org/bugzilla )
>
> I've made a note of the error you get with `__vector(float[4]) c =
> [1,2,3,4];' - That is because vector expressions implementation is
> very basic at the moment.  Look forward to hear from all your
> experiences so we can make vector support rock solid in GDC. ;-)
>

I didn't realise vector literals like that were supported properly in the
front end yet?
Do they work at all? What does the code generated look like?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20121005/fe0cc7e4/attachment.html>


More information about the Digitalmars-d mailing list