http://d.puremagic.com/issues/show_bug.cgi?id=7951

           Summary: DMD: Internal error: backend/cgxmm.c 567
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: suicide...@xited.de


--- Comment #0 from Zoadian <suicide...@xited.de> 2012-04-20 11:26:25 PDT ---
DMD 2.059 exits compilation with
tym = x1d
Internal error: backend/cgxmm.c 567

Code:


import std.stdio;
import std.math;
import core.simd;
import std.datetime;

T[D] simdAdd(T, int D)(T[D] a1, T[D] a2) {
    T[D] res;
    float4 v1;
    float4 v2;
    v1.array = a1;
    v2.array = a2;
    float4 r;

    string gen() {
        string s;
        foreach(i;0..D)
        {
            s ~= "";
        }
        return s;
    }
    //foreach(i;0..10)
        //r = v1+v2;//__simd(XMM.ADDPS, v1,v2);
    return cast(float[4])(v1+v2);
}

T[D] addV(T, int D)(T[D] a1, T[D] a2) {
    T[D] r;
    //foreach(x;0..10)
        foreach(i;0..D)
            r[i] = a1[i]+a2[i];
    return r;
}


void main()
{
    float[4] v1 = [1,2,3,4];
    float[4] v2 = [1,2,3,4];
    void test1(){addV(v1,v2);}
    void test2(){simdAdd(v1,v2);}


    //~ writeln("STD: ",
benchmark!(addS!(int,4)([1,2,3,4],[1,2,3,4]))(10_000_000));
    writeln("_VEC: ", benchmark!(test1)(10_000_000));
    writeln("SIMD: ", benchmark!(test2)(10_000_000));
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to