www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12429] New: SIMD vector type errors are too eager

https://d.puremagic.com/issues/show_bug.cgi?id=12429

           Summary: SIMD vector type errors are too eager
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: john.loughran.colvin gmail.com



12:43:27 GMT ---
template MakeVecType(Base, ubyte length)
{
    mixin(`alias MakeVecType = ` ~ Base.stringof ~ length.to!string() ~ `;`);
}

alias BaseT = float;
static if(is(MakeVecType!(BaseT, 8)))
{
    enum vecLength = 8;
}
else static if(is(MakeVecType!(BaseT, 4)))
{
    enum vecLength = 4;
}
else static if(is(MakeVecType!(BaseT, 2)))
{
    enum vecLength = 2;
}
else
{
    static assert(false, "Insufficient SIMD support");
}

fails to compile with the error
Error: AVX vector types not supported


If my understanding is correct, this shouldn't be an error. The first is(...)
should just evaluate to false.

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